From d811cd1c4c15b2a0f8ef765eb8fdcd075fc9b269 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sat, 18 May 2024 20:59:32 +0200 Subject: [PATCH] Add egg cycle length config (#4596) --- include/config/pokemon.h | 1 + src/daycare.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index 32415e5247..18f9c28e45 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -45,6 +45,7 @@ #define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255. #define P_SHOW_TERA_TYPE GEN_8 // Since Gen 9, the Tera Type is shown on the summary screen. #define P_TM_LITERACY GEN_LATEST // Since Gen 6, TM illiterate Pokémon can learn TMs that teach moves that are in their level-up learnsets. +#define P_EGG_CYCLE_LENGTH GEN_LATEST // Since Gen 8, egg cycles take half as many steps as before. // Learnset helper toggles #define P_LEARNSET_HELPER_TEACHABLE TRUE // If TRUE, teachable_learnsets.h will be populated by tools/learnset_helpers/teachable.py using the included JSON files based on available TMs and tutors. diff --git a/src/daycare.c b/src/daycare.c index 8f4e9e7d53..34597f257e 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1173,7 +1173,7 @@ static bool8 TryProduceOrHatchEgg(struct DayCare *daycare) } // Try to hatch Egg - if (++daycare->stepCounter == 255) + if (++daycare->stepCounter == ((P_EGG_CYCLE_LENGTH >= GEN_8) ? 127 : 255)) { u32 eggCycles; u8 toSub = GetEggCyclesToSubtract();