Skip to content

Commit

Permalink
Make Tandemaus only evolve at the end of battles (#4759)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian authored Jun 12, 2024
1 parent fd08e59 commit 341fa36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions include/constants/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@
#define EVO_LEVEL_FOG 42 // Pokémon reaches the specified level during fog in the overworld
#define EVO_MOVE_TWO_SEGMENT 43 // Pokémon levels up, knows specified move, has a personality value with a modulus of 0
#define EVO_MOVE_THREE_SEGMENT 44 // Pokémon levels up, knows specified move, has a personality value with a modulus of 1-99
#define EVO_LEVEL_FAMILY_OF_THREE 45 // Pokémon reaches the specified level with a personality value with a modulus of 0
#define EVO_LEVEL_FAMILY_OF_FOUR 46 // Pokémon reaches the specified level with a personality value with a modulus of 1-99
#define EVO_LEVEL_FAMILY_OF_THREE 45 // Pokémon reaches the specified level in battle with a personality value with a modulus of 0
#define EVO_LEVEL_FAMILY_OF_FOUR 46 // Pokémon reaches the specified level in battle with a personality value with a modulus of 1-99
#define EVO_LEVEL_MOVE_TWENTY_TIMES 47 // Pokémon levels up after having used a move for at least 20 times
#define EVO_LEVEL_RECOIL_DAMAGE_MALE 48 // Pokémon levels up after having suffered specified amount of non-fainting recoil damage as a male
#define EVO_LEVEL_RECOIL_DAMAGE_FEMALE 49 // Pokémon levels up after having suffered specified amount of non-fainting recoil damage as a female
Expand All @@ -302,6 +302,7 @@
#define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve
#define EVO_MODE_BATTLE_SPECIAL 4
#define EVO_MODE_OVERWORLD_SPECIAL 5
#define EVO_MODE_BATTLE_ONLY 6 // This mode is only used in battles to support Tandemaus' unique requirement

#define MON_PIC_WIDTH 64
#define MON_PIC_HEIGHT 64
Expand Down
2 changes: 1 addition & 1 deletion src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5837,7 +5837,7 @@ static void TryEvolvePokemon(void)
if (species == SPECIES_NONE && (gLeveledUpInBattle & gBitTable[i]))
{
gLeveledUpInBattle &= ~(gBitTable[i]);
species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_NORMAL, gLeveledUpInBattle, NULL);
species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_ONLY, gLeveledUpInBattle, NULL);
}

if (species != SPECIES_NONE)
Expand Down
5 changes: 3 additions & 2 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -4176,6 +4176,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
switch (mode)
{
case EVO_MODE_NORMAL:
case EVO_MODE_BATTLE_ONLY:
level = GetMonData(mon, MON_DATA_LEVEL, 0);
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);

Expand Down Expand Up @@ -4264,11 +4265,11 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
targetSpecies = evolutions[i].targetSpecies;
break;
case EVO_LEVEL_FAMILY_OF_FOUR:
if (evolutions[i].param <= level && (personality % 100) != 0)
if (mode == EVO_MODE_BATTLE_ONLY && evolutions[i].param <= level && (personality % 100) != 0)
targetSpecies = evolutions[i].targetSpecies;
break;
case EVO_LEVEL_FAMILY_OF_THREE:
if (evolutions[i].param <= level && (personality % 100) == 0)
if (mode == EVO_MODE_BATTLE_ONLY && evolutions[i].param <= level && (personality % 100) == 0)
targetSpecies = evolutions[i].targetSpecies;
break;
case EVO_BEAUTY:
Expand Down

0 comments on commit 341fa36

Please sign in to comment.