From 0dfbbde7ce0629083b451eff28498bcc60335bda Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sat, 17 Oct 2020 01:47:04 -0300 Subject: [PATCH] Heavy Ball modifier in config. --- include/constants/item_config.h | 1 + src/battle_script_commands.c | 31 +++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/include/constants/item_config.h b/include/constants/item_config.h index 5e9c99874e..018efcff7f 100644 --- a/include/constants/item_config.h +++ b/include/constants/item_config.h @@ -18,5 +18,6 @@ #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. #define P_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3. +#define P_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #endif // GUARD_CONSTANTS_ITEM_CONFIG_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f115fc073b..5b3d97fcbe 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9855,16 +9855,27 @@ static void Cmd_handleballthrow(void) break; case ITEM_HEAVY_BALL: i = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1); - if (i < 1024) - ballMultiplier = 5; - else if (i < 2048) - ballMultiplier = 10; - else if (i < 3072) - ballMultiplier = 20; - else if (i < 4096) - ballMultiplier = 30; - else - ballMultiplier = 40; + #if P_HEAVY_BALL_MODIFIER >= GEN_7 + if (i < 1000) + ballMultiplier = 5; + else if (i < 2000) + ballMultiplier = 10; + else if (i < 3000) + ballMultiplier = 20; + else + ballMultiplier = 30; + #else + if (i < 1024) + ballMultiplier = 5; + else if (i < 2048) + ballMultiplier = 10; + else if (i < 3072) + ballMultiplier = 20; + else if (i < 4096) + ballMultiplier = 30; + else + ballMultiplier = 40; + #endif break; case ITEM_FAST_BALL: if (gBaseStats[gBattleMons[gBattlerTarget].species].baseSpeed >= 100)