From 7fbd64ec37293cf5d7430ac9bb5698e3d89fbf82 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sat, 17 Oct 2020 01:26:51 -0300 Subject: [PATCH] Moved Shiny Charm rerolls into config file --- include/constants/item_config.h | 1 + include/constants/pokemon.h | 1 - src/pokemon.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/constants/item_config.h b/include/constants/item_config.h index bffe5740e..30c180521 100644 --- a/include/constants/item_config.h +++ b/include/constants/item_config.h @@ -14,6 +14,7 @@ #endif // Item config +#define P_SHINY_CHARM_REROLLS 3 // Amount of re-rolls if the player has the Shiny Charm. Set to 0 to disable Shiny Charm's effects. #define P_KEY_FOSSILS GEN_7 // In Gen4+, all Gen 3 fossils became regular items. #define P_KEY_ESCAPE_ROPE GEN_7 // In Gen8, Escape Rope became a Key Item. diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 47e197824..8cc78d8ce 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -91,7 +91,6 @@ // Shiny odds #define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536 -#define SHINY_CHARM_REROLLS 3 // Amount of re-rolls if has Shiny Charm. // Flags for Get(Box)MonData / Set(Box)MonData #define MON_DATA_PERSONALITY 0 diff --git a/src/pokemon.c b/src/pokemon.c index 4fbdcffd0..2e6b02e59 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2233,7 +2233,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, personality = Random32(); shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality); rolls++; - } while (shinyValue >= SHINY_ODDS && rolls < SHINY_CHARM_REROLLS); + } while (shinyValue >= SHINY_ODDS && rolls < P_SHINY_CHARM_REROLLS); } }