Skip to content

Commit

Permalink
Added missing cross-gen evolutions (rh-hideout#3547)
Browse files Browse the repository at this point in the history
* Added missing cross-gen evolutions

* Added forms for evos

* Converted some EVO_NONEs into EVO_MOVE

* Moved Ursaring's evolution up

* Added evolution methods for Dudunsparce and Maushold
  • Loading branch information
fdeblasio authored and PCG06 committed Nov 20, 2023
1 parent b9f2385 commit fbbab77
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 14 deletions.
16 changes: 10 additions & 6 deletions include/constants/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,16 @@
#define EVO_ITEM_DAY 40 // specified item is used on Pokémon, is day
#define EVO_ITEM_HOLD 41 // Pokémon levels up, holds specified item
#define EVO_LEVEL_FOG 42 // Pokémon reaches the specified level during fog in the overworld
#define EVO_MOVE_FEMALE 43 // Pokémon learn specific move, evolves, female (for Basculegion)
#define EVO_MOVE_MALE 44 // Pokémon learn specific move, evolves, male (for Basculegion)
#define EVO_ITEM_SPECIFIC_MAP 45 // Alolan cross-evolutions (like Alolan Exeggutor)
#define EVO_LEVEL_SPECIFIC_MAP 46 // Galarian Weezing
#define EVO_MOVE_SPECIFIC_MAP 47 // Galarian Mr. Mime
#define EVO_NIGHT_SPECIFIC_MAP 48 // Alolan Marowak
#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-9
#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-9
#define EVO_MOVE_FEMALE 47 // Pokémon learn specific move, evolves, female (for Basculegion)
#define EVO_MOVE_MALE 48 // Pokémon learn specific move, evolves, male (for Basculegion)
#define EVO_ITEM_SPECIFIC_MAP 49 // Alolan cross-evolutions (like Alolan Exeggutor)
#define EVO_LEVEL_SPECIFIC_MAP 50 // Galarian Weezing
#define EVO_MOVE_SPECIFIC_MAP 51 // Galarian Mr. Mime
#define EVO_NIGHT_SPECIFIC_MAP 52 // Alolan Marowak

#define EVOS_PER_MON 11

Expand Down
6 changes: 3 additions & 3 deletions src/data/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -9933,9 +9933,9 @@ const struct Item gItems[] =
.name = _("Leader's Crest"),
.price = 3000,
.description = sLeadersCrestDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.pocket = POCKET_POWER_UP,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_EvolutionStone,
},

[ITEM_MALICIOUS_ARMOR] =
Expand Down
27 changes: 22 additions & 5 deletions src/data/pokemon/evolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_MEOWTH] = {{EVO_LEVEL, 28, SPECIES_PERSIAN}},
[SPECIES_PSYDUCK] = {{EVO_LEVEL, 33, SPECIES_GOLDUCK}},
[SPECIES_MANKEY] = {{EVO_LEVEL, 28, SPECIES_PRIMEAPE}},
#if P_GEN_9_POKEMON == TRUE
[SPECIES_PRIMEAPE] = {{EVO_MOVE, MOVE_RAGE_FIST, SPECIES_ANNIHILAPE}},
#endif
[SPECIES_GROWLITHE] = {{EVO_ITEM, ITEM_FIRE_STONE, SPECIES_ARCANINE}},
[SPECIES_GROWLITHE_HISUIAN] = {{EVO_ITEM, ITEM_FIRE_STONE, SPECIES_ARCANINE_HISUIAN}},
[SPECIES_POLIWAG] = {{EVO_LEVEL, 25, SPECIES_POLIWHIRL}},
Expand Down Expand Up @@ -150,8 +153,15 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
#if P_GEN_4_POKEMON == TRUE
[SPECIES_MURKROW] = {{EVO_ITEM, ITEM_DUSK_STONE, SPECIES_HONCHKROW}},
[SPECIES_MISDREAVUS] = {{EVO_ITEM, ITEM_DUSK_STONE, SPECIES_MISMAGIUS}},
#endif
#if P_GEN_9_POKEMON == TRUE
[SPECIES_GIRAFARIG] = {{EVO_MOVE, MOVE_TWIN_BEAM, SPECIES_FARIGIRAF}},
#endif
[SPECIES_PINECO] = {{EVO_LEVEL, 31, SPECIES_FORRETRESS}},
#if P_GEN_9_POKEMON == TRUE
[SPECIES_DUNSPARCE] = {{EVO_MOVE_TWO_SEGMENT, MOVE_HYPER_DRILL, SPECIES_DUDUNSPARCE_TWO_SEGMENT},
{EVO_MOVE_THREE_SEGMENT, MOVE_HYPER_DRILL, SPECIES_DUDUNSPARCE_THREE_SEGMENT}},
#endif
#if P_GEN_4_POKEMON == TRUE
[SPECIES_GLIGAR] = {{EVO_ITEM_NIGHT, ITEM_RAZOR_FANG, SPECIES_GLISCOR}},
#endif
Expand All @@ -160,6 +170,9 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_SNEASEL] = {{EVO_ITEM_NIGHT, ITEM_RAZOR_CLAW, SPECIES_WEAVILE}},
#endif
[SPECIES_TEDDIURSA] = {{EVO_LEVEL, 30, SPECIES_URSARING}},
#if P_GEN_8_POKEMON == TRUE
[SPECIES_URSARING] = {{EVO_ITEM_NIGHT, ITEM_PEAT_BLOCK, SPECIES_URSALUNA}},
#endif
[SPECIES_SLUGMA] = {{EVO_LEVEL, 38, SPECIES_MAGCARGO}},
[SPECIES_SWINUB] = {{EVO_LEVEL, 33, SPECIES_PILOSWINE}},
#if P_GEN_4_POKEMON == TRUE
Expand All @@ -170,6 +183,9 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_PHANPY] = {{EVO_LEVEL, 25, SPECIES_DONPHAN}},
#if P_GEN_4_POKEMON == TRUE
[SPECIES_PORYGON2] = {{EVO_ITEM, ITEM_DUBIOUS_DISC, SPECIES_PORYGON_Z}},
#endif
#if P_GEN_9_POKEMON == TRUE
[SPECIES_STANTLER] = {{EVO_MOVE, MOVE_PSYSHIELD_BASH, SPECIES_WYRDEER}},
#endif
[SPECIES_TYROGUE] = {{EVO_LEVEL_ATK_LT_DEF, 20, SPECIES_HITMONCHAN},
{EVO_LEVEL_ATK_GT_DEF, 20, SPECIES_HITMONLEE},
Expand Down Expand Up @@ -375,6 +391,9 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_MIENFOO] = {{EVO_LEVEL, 50, SPECIES_MIENSHAO}},
[SPECIES_GOLETT] = {{EVO_LEVEL, 43, SPECIES_GOLURK}},
[SPECIES_PAWNIARD] = {{EVO_LEVEL, 52, SPECIES_BISHARP}},
#if P_GEN_9_POKEMON == TRUE
[SPECIES_BISHARP] = {{EVO_ITEM, ITEM_LEADERS_CREST, SPECIES_KINGAMBIT}},
#endif
[SPECIES_RUFFLET] = {{EVO_LEVEL, 54, SPECIES_BRAVIARY},
{EVO_LEVEL_SPECIFIC_MAP, 54, SPECIES_BRAVIARY_HISUIAN, MAP_FIERY_PATH}}, // hisui
[SPECIES_VULLABY] = {{EVO_LEVEL, 54, SPECIES_MANDIBUZZ}},
Expand Down Expand Up @@ -520,8 +539,8 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_NYMBLE] = {{EVO_LEVEL, 24, SPECIES_LOKIX}},
[SPECIES_PAWMI] = {{EVO_LEVEL, 18, SPECIES_PAWMO}},
[SPECIES_PAWMO] = {{EVO_NONE, 0, SPECIES_PAWMOT}},
[SPECIES_TANDEMAUS] = {{EVO_NONE, 0, SPECIES_MAUSHOLD},
{EVO_NONE, 0, SPECIES_MAUSHOLD_FAMILY_OF_THREE}},
[SPECIES_TANDEMAUS] = {{EVO_LEVEL_FAMILY_OF_FOUR, 25, SPECIES_MAUSHOLD_FAMILY_OF_FOUR},
{EVO_LEVEL_FAMILY_OF_THREE, 25, SPECIES_MAUSHOLD_FAMILY_OF_THREE}},
[SPECIES_FIDOUGH] = {{EVO_LEVEL, 26, SPECIES_DACHSBUN}},
[SPECIES_SMOLIV] = {{EVO_LEVEL, 25, SPECIES_DOLLIV}},
[SPECIES_DOLLIV] = {{EVO_LEVEL, 35, SPECIES_ARBOLIVA}},
Expand Down Expand Up @@ -554,7 +573,7 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_SANDSHREW_ALOLAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_SANDSLASH_ALOLAN}},
[SPECIES_VULPIX_ALOLAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_NINETALES_ALOLAN}},
[SPECIES_DIGLETT_ALOLAN] = {{EVO_LEVEL, 26, SPECIES_DUGTRIO_ALOLAN}},
[SPECIES_MEOWTH_ALOLAN] = {{EVO_FRIENDSHIP, 28, SPECIES_PERSIAN_ALOLAN}},
[SPECIES_MEOWTH_ALOLAN] = {{EVO_FRIENDSHIP, 0, SPECIES_PERSIAN_ALOLAN}},
[SPECIES_GEODUDE_ALOLAN] = {{EVO_LEVEL, 25, SPECIES_GRAVELER_ALOLAN}},
[SPECIES_GRAVELER_ALOLAN] = {{EVO_ITEM, ITEM_LINKING_CORD, SPECIES_GOLEM_ALOLAN}},
[SPECIES_GRIMER_ALOLAN] = {{EVO_LEVEL, 38, SPECIES_MUK_ALOLAN}},
Expand Down Expand Up @@ -608,8 +627,6 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_SINISTEA_ANTIQUE] = {{EVO_ITEM, ITEM_CHIPPED_POT, SPECIES_POLTEAGEIST_ANTIQUE}},
[SPECIES_QWILFISH_HISUIAN] = {{EVO_MOVE, MOVE_BARB_BARRAGE, SPECIES_OVERQWIL}},
[SPECIES_SNEASEL_HISUIAN] = {{EVO_ITEM_DAY, ITEM_RAZOR_CLAW, SPECIES_SNEASLER}},
[SPECIES_URSARING] = {{EVO_ITEM_NIGHT, ITEM_PEAT_BLOCK, SPECIES_URSALUNA}},
[SPECIES_STANTLER] = {{EVO_MOVE, MOVE_PSYSHIELD_BASH, SPECIES_WYRDEER}},
[SPECIES_BASCULIN_WHITE_STRIPED] = {{EVO_MOVE_FEMALE, MOVE_WAVE_CRASH, SPECIES_BASCULEGION_FEMALE},
{EVO_MOVE_MALE, MOVE_WAVE_CRASH, SPECIES_BASCULEGION}},
#endif
Expand Down
1 change: 1 addition & 0 deletions src/data/pokemon/item_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ const u8 *const gItemEffectTable[ITEMS_COUNT] =
[ITEM_BLACK_AUGURITE] = gItemEffect_EvoItem,
[ITEM_LINKING_CORD] = gItemEffect_EvoItem,
[ITEM_PEAT_BLOCK] = gItemEffect_EvoItem,
[ITEM_LEADERS_CREST] = gItemEffect_EvoItem,

// Berries
[ITEM_CHERI_BERRY] = gItemEffect_CheriBerry,
Expand Down
16 changes: 16 additions & 0 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -6974,6 +6974,14 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
if (gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_FAMILY_OF_FOUR:
if (gEvolutionTable[species][i].param <= level && (personality % 100) != 0)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_FAMILY_OF_THREE:
if (gEvolutionTable[species][i].param <= level && (personality % 100) == 0)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_BEAUTY:
if (gEvolutionTable[species][i].param <= beauty)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
Expand All @@ -6982,6 +6990,14 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
if (MonKnowsMove(mon, gEvolutionTable[species][i].param))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_MOVE_TWO_SEGMENT:
if (MonKnowsMove(mon, gEvolutionTable[species][i].param) && (personality % 100) != 0)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_MOVE_THREE_SEGMENT:
if (MonKnowsMove(mon, gEvolutionTable[species][i].param) && (personality % 100) == 0)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_MOVE_TYPE:
if (friendship >= FRIENDSHIP_EVO_THRESHOLD)
{
Expand Down

0 comments on commit fbbab77

Please sign in to comment.