From baca050724070d137cf8b6e9492863917d603aeb Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 26 Sep 2023 15:05:44 -0500 Subject: [PATCH] Allow Sliggoo to evolve during overworld fog (#3343) --- include/constants/pokemon.h | 3 ++- src/data/pokemon/evolution.h | 6 ++++-- src/pokemon.c | 8 +++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 9b504eaec5fb..e3dd15000fb0 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -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 @@ -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 diff --git a/src/data/pokemon/evolution.h b/src/data/pokemon/evolution.h index e9a799850594..b26f5772576d 100644 --- a/src/data/pokemon/evolution.h +++ b/src/data/pokemon/evolution.h @@ -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}, diff --git a/src/pokemon.c b/src/pokemon.c index dc7054c04b72..1320774f1e11 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -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; @@ -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)