From fd8e7949a69586d76541a5c19971e19de1621a65 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 3 Oct 2023 15:46:43 -0500 Subject: [PATCH 1/4] Update friendship evo threshold to gen 8+ with config --- include/config/pokemon.h | 3 +++ src/pokemon.c | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index a65eddb73c35..b3f4f654ca34 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -7,6 +7,9 @@ #define P_UPDATED_ABILITIES GEN_LATEST // Since Gen 6, certain Pokémon have their abilities changed. #define P_UPDATED_EGG_GROUPS GEN_LATEST // Since Gen 8, certain Pokémon have gained new egg groups. +//Evolution settings +#define P_FRIENDSHIP_EVO_THRESHOLD 160 //Since Gen 8, Pokémon that evolve by friendship evolve at or above 160 friendship instead of 220. + // Breeding settings #define P_NIDORAN_M_DITTO_BREED GEN_LATEST // Since Gen 5, when Nidoran♂ breeds with Ditto it can produce Nidoran♀ offspring. Before, it would only yield male offspring. This change also applies to Volbeat. #define P_INCENSE_BREEDING GEN_LATEST // Since Gen 9, cross-generation Baby Pokémon don't require Incense being held by the parents to be obtained via breeding. diff --git a/src/pokemon.c b/src/pokemon.c index 03c7c34712d6..63f290e0b2b9 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -62,7 +62,6 @@ #define NIGHT_EVO_HOUR_BEGIN 0 #define NIGHT_EVO_HOUR_END 12 -#define FRIENDSHIP_EVO_THRESHOLD 220 struct SpeciesItem { @@ -6479,12 +6478,12 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s switch (gEvolutionTable[species][i].method) { case EVO_FRIENDSHIP: - if (friendship >= FRIENDSHIP_EVO_THRESHOLD) + if (friendship >= P_FRIENDSHIP_EVO_THRESHOLD) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_FRIENDSHIP_DAY: RtcCalcLocalTime(); - if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD) + if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= P_FRIENDSHIP_EVO_THRESHOLD) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_LEVEL_DAY: @@ -6494,7 +6493,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s break; case EVO_FRIENDSHIP_NIGHT: RtcCalcLocalTime(); - if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD) + if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= P_FRIENDSHIP_EVO_THRESHOLD) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_LEVEL_NIGHT: @@ -6573,7 +6572,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_FRIENDSHIP_MOVE_TYPE: - if (friendship >= FRIENDSHIP_EVO_THRESHOLD) + if (friendship >= P_FRIENDSHIP_EVO_THRESHOLD) { for (j = 0; j < MAX_MON_MOVES; j++) { From 6096fcfefe5b06da7afb712376a094c1f234bba1 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 3 Oct 2023 15:47:57 -0500 Subject: [PATCH 2/4] Update pokemon.h --- include/config/pokemon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index b3f4f654ca34..e10d60ac0c4b 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -7,7 +7,7 @@ #define P_UPDATED_ABILITIES GEN_LATEST // Since Gen 6, certain Pokémon have their abilities changed. #define P_UPDATED_EGG_GROUPS GEN_LATEST // Since Gen 8, certain Pokémon have gained new egg groups. -//Evolution settings +// Evolution settings #define P_FRIENDSHIP_EVO_THRESHOLD 160 //Since Gen 8, Pokémon that evolve by friendship evolve at or above 160 friendship instead of 220. // Breeding settings From e8bf01f2814cf28ad245e3608250bd0f5bb39ea1 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 3 Oct 2023 15:52:50 -0500 Subject: [PATCH 3/4] Update pokemon.h --- include/config/pokemon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index e10d60ac0c4b..4651eacc4122 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -8,7 +8,7 @@ #define P_UPDATED_EGG_GROUPS GEN_LATEST // Since Gen 8, certain Pokémon have gained new egg groups. // Evolution settings -#define P_FRIENDSHIP_EVO_THRESHOLD 160 //Since Gen 8, Pokémon that evolve by friendship evolve at or above 160 friendship instead of 220. +#define P_FRIENDSHIP_EVO_THRESHOLD 160 // Since Gen 8, Pokémon that evolve by friendship evolve at or above 160 friendship instead of 220. // Breeding settings #define P_NIDORAN_M_DITTO_BREED GEN_LATEST // Since Gen 5, when Nidoran♂ breeds with Ditto it can produce Nidoran♀ offspring. Before, it would only yield male offspring. This change also applies to Volbeat. From 14abf496778170181420ae7bc9ffa50d164aa418 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Sun, 22 Oct 2023 15:19:04 -0500 Subject: [PATCH 4/4] Change config to be by gen --- include/config/pokemon.h | 2 +- src/pokemon.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index 4651eacc4122..271a77add4c4 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -8,7 +8,7 @@ #define P_UPDATED_EGG_GROUPS GEN_LATEST // Since Gen 8, certain Pokémon have gained new egg groups. // Evolution settings -#define P_FRIENDSHIP_EVO_THRESHOLD 160 // Since Gen 8, Pokémon that evolve by friendship evolve at or above 160 friendship instead of 220. +#define P_FRIENDSHIP_EVO_THRESHOLD GEN_LATEST // Since Gen 8, Pokémon that evolve by friendship evolve at or above 160 friendship instead of 220. // Breeding settings #define P_NIDORAN_M_DITTO_BREED GEN_LATEST // Since Gen 5, when Nidoran♂ breeds with Ditto it can produce Nidoran♀ offspring. Before, it would only yield male offspring. This change also applies to Volbeat. diff --git a/src/pokemon.c b/src/pokemon.c index da88f8f71c3d..877bc55a48e8 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -62,6 +62,11 @@ #define NIGHT_EVO_HOUR_BEGIN 0 #define NIGHT_EVO_HOUR_END 12 +#if P_FRIENDSHIP_EVO_THRESHOLD >= GEN_9 +#define FRIENDSHIP_EVO_THRESHOLD 160 +#else +#define FRIENDSHIP_EVO_THRESHOLD 220 +#endif struct SpeciesItem { @@ -6663,12 +6668,12 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s switch (gEvolutionTable[species][i].method) { case EVO_FRIENDSHIP: - if (friendship >= P_FRIENDSHIP_EVO_THRESHOLD) + if (friendship >= FRIENDSHIP_EVO_THRESHOLD) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_FRIENDSHIP_DAY: RtcCalcLocalTime(); - if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= P_FRIENDSHIP_EVO_THRESHOLD) + if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_LEVEL_DAY: @@ -6678,7 +6683,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s break; case EVO_FRIENDSHIP_NIGHT: RtcCalcLocalTime(); - if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= P_FRIENDSHIP_EVO_THRESHOLD) + if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_LEVEL_NIGHT: @@ -6757,7 +6762,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_FRIENDSHIP_MOVE_TYPE: - if (friendship >= P_FRIENDSHIP_EVO_THRESHOLD) + if (friendship >= FRIENDSHIP_EVO_THRESHOLD) { for (j = 0; j < MAX_MON_MOVES; j++) {