From cc30dc06d520314e87e5c6d9392f3a88628e4f65 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 26 Sep 2023 16:25:15 -0500 Subject: [PATCH] Add friendship evo threshold constant --- src/pokemon.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 7eab3ccf68..be8a08341c 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -48,11 +48,13 @@ #include "constants/trainers.h" #include "constants/union_room.h" -#define DAY_EVO_HOUR_BEGIN 12 -#define DAY_EVO_HOUR_END HOURS_PER_DAY +#define DAY_EVO_HOUR_BEGIN 12 +#define DAY_EVO_HOUR_END HOURS_PER_DAY -#define NIGHT_EVO_HOUR_BEGIN 0 -#define NIGHT_EVO_HOUR_END 12 +#define NIGHT_EVO_HOUR_BEGIN 0 +#define NIGHT_EVO_HOUR_END 12 + +#define FRIENDSHIP_EVO_THRESHOLD 220 struct SpeciesItem { @@ -5499,17 +5501,17 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem) switch (gEvolutionTable[species][i].method) { case EVO_FRIENDSHIP: - if (friendship >= 220) + 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 >= 220) + 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_FRIENDSHIP_NIGHT: RtcCalcLocalTime(); - if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= 220) + 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: