diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index b8d7c9f8ae0..4b6c0cc1ec0 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -86,6 +86,7 @@ #define B_HEAL_BLOCKING GEN_LATEST // In Gen5+, Heal Block prevents healing by Black Sludge, Leftovers, Shell Bell. Affected Pokémon will not consume held HP-restoring Berries or Berry Juice. // Draining abilities will not heal but will prevent damage. In Gen6+, Heal Block prevents the use of most HP-draining moves. #define B_ROOTED_GROUNDING GEN_LATEST // In Gen4+, Ingrain causes the affected Pokémon to become grounded. +#define B_METRONOME_MOVES GEN_LATEST // This config will determine up to which generation will Metronome pull moves from. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b03220066db..f5884d206db 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -11472,9 +11472,23 @@ static void Cmd_mimicattackcopy(void) static void Cmd_metronome(void) { +#if B_METRONOME_MOVES >= GEN_8 + u16 moveCount = MOVES_COUNT_GEN8; +#elif B_METRONOME_MOVES >= GEN_7 + u16 moveCount = MOVES_COUNT_GEN7; +#elif B_METRONOME_MOVES >= GEN_6 + u16 moveCount = MOVES_COUNT_GEN6; +#elif B_METRONOME_MOVES >= GEN_5 + u16 moveCount = MOVES_COUNT_GEN5; +#elif B_METRONOME_MOVES >= GEN_4 + u16 moveCount = MOVES_COUNT_GEN4; +#elif B_METRONOME_MOVES >= GEN_3 + u16 moveCount = MOVES_COUNT_GEN3; +#endif + while (TRUE) { - gCurrentMove = (Random() % (MOVES_COUNT - 1)) + 1; + gCurrentMove = (Random() % (moveCount - 1)) + 1; if (gBattleMoves[gCurrentMove].effect == EFFECT_PLACEHOLDER) continue;