Skip to content

Commit

Permalink
Allow Sliggoo to evolve during overworld fog (#3343)
Browse files Browse the repository at this point in the history
  • Loading branch information
kittenchilly authored Sep 26, 2023
1 parent e1d1236 commit baca050
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/constants/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
#define EVO_MAPSEC 25 // Pokémon levels up on specified mapsec
#define EVO_ITEM_MALE 26 // specified item is used on a male Pokémon
#define EVO_ITEM_FEMALE 27 // specified item is used on a female Pokémon
#define EVO_LEVEL_RAIN 28 // Pokémon reaches the specified level while it's raining
#define EVO_LEVEL_RAIN 28 // Pokémon reaches the specified level during rain in the overworld
#define EVO_SPECIFIC_MON_IN_PARTY 29 // Pokémon levels up with a specified Pokémon in party
#define EVO_LEVEL_DARK_TYPE_MON_IN_PARTY 30 // Pokémon reaches the specified level with a Dark Type Pokémon in party
#define EVO_TRADE_SPECIFIC_MON 31 // Pokémon is traded for a specified Pokémon
Expand All @@ -283,6 +283,7 @@
#define EVO_ITEM_NIGHT 39 // specified item is used on Pokémon, is night
#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 EVOS_PER_MON 10

Expand Down
6 changes: 4 additions & 2 deletions src/data/pokemon/evolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,10 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_AMAURA] = {{EVO_LEVEL_NIGHT, 39, SPECIES_AURORUS}},
[SPECIES_GOOMY] = {{EVO_LEVEL, 40, SPECIES_SLIGGOO},
{EVO_NONE, 0, SPECIES_SLIGGOO_HISUIAN}},
[SPECIES_SLIGGOO] = {{EVO_LEVEL_RAIN, 50, SPECIES_GOODRA}},
[SPECIES_SLIGGOO_HISUIAN] = {{EVO_LEVEL_RAIN, 40, SPECIES_GOODRA_HISUIAN}},
[SPECIES_SLIGGOO] = {{EVO_LEVEL_RAIN, 50, SPECIES_GOODRA},
{EVO_LEVEL_FOG, 50, SPECIES_GOODRA}},
[SPECIES_SLIGGOO_HISUIAN] = {{EVO_LEVEL_RAIN, 50, SPECIES_GOODRA_HISUIAN},
{EVO_LEVEL_FOG, 50, SPECIES_GOODRA_HISUIAN}},
[SPECIES_PHANTUMP] = {{EVO_TRADE, 0, SPECIES_TREVENANT},
{EVO_ITEM, ITEM_LINKING_CORD, SPECIES_TREVENANT}},
[SPECIES_PUMPKABOO] = {{EVO_TRADE, 0, SPECIES_GOURGEIST},
Expand Down
8 changes: 7 additions & 1 deletion src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -6605,6 +6605,12 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
&& (j == WEATHER_RAIN || j == WEATHER_RAIN_THUNDERSTORM || j == WEATHER_DOWNPOUR))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_FOG:
j = GetCurrentWeather();
if (gEvolutionTable[species][i].param <= level
&& (j == WEATHER_FOG_HORIZONTAL || j == WEATHER_FOG_DIAGONAL))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_MAPSEC:
if (gMapHeader.regionMapSectionId == gEvolutionTable[species][i].param)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
Expand Down Expand Up @@ -6775,7 +6781,7 @@ bool8 IsMonPastEvolutionLevel(struct Pokemon *mon)
int i;
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);

for (i = 0; i < EVOS_PER_MON; i++)
{
switch (gEvolutionTable[species][i].method)
Expand Down

0 comments on commit baca050

Please sign in to comment.