From 6a5bd947da441d7e663fd5fb6c37a234d174a9bf Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Mon, 8 Jan 2024 00:16:29 +0100 Subject: [PATCH 1/5] Fix some ball multiplier configs --- include/config/battle.h | 1 + src/battle_script_commands.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index e963dc775bd1..dc521c83cbaf 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -163,6 +163,7 @@ #define B_HEAVY_BALL_MODIFIER GEN_LATEST // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_LATEST // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. #define B_SPORT_BALL_MODIFIER GEN_LATEST // In Gen8, Sport Ball's catch multiplier was reduced from x1.5 to x1. +#define B_SAFARI_BALL_MODIFIER GEN_LATEST // In Gen8, Safari Ball's catch multiplier was reduced from x1.5 to x1. #define B_SERENE_GRACE_BOOST GEN_LATEST // In Gen5+, Serene Grace boosts the added flinch chance of King's Rock and Razor Fang. // Flag settings diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 51f6ebfd00f2..a28660d2c0d7 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -14839,10 +14839,14 @@ static void Cmd_handleballthrow(void) case ITEM_SPORT_BALL: if (B_SPORT_BALL_MODIFIER <= GEN_7) ballMultiplier = 150; + break; case ITEM_GREAT_BALL: - case ITEM_SAFARI_BALL: ballMultiplier = 150; break; + case ITEM_SAFARI_BALL: + if (B_SAFARI_BALL_MODIFIER <= GEN_7) + ballMultiplier = 150; + break; case ITEM_NET_BALL: if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG)) ballMultiplier = B_NET_BALL_MODIFIER >= GEN_7 ? 350 : 300; @@ -14901,7 +14905,7 @@ static void Cmd_handleballthrow(void) break; case ITEM_LURE_BALL: if (gIsFishingEncounter) - ballMultiplier = (B_LURE_BALL_MODIFIER >= GEN_7 ? 500 : 300); + ballMultiplier = (B_LURE_BALL_MODIFIER >= GEN_7 ? ((B_LURE_BALL_MODIFIER) >= GEN_8 ? 400: 500) : 300); break; case ITEM_MOON_BALL: { From 44df39c16f517058b7a494ad6077aed513f4b697 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 7 Jan 2024 21:12:54 -0300 Subject: [PATCH 2/5] Updated the comment of B_LURE_BALL_MODIFIER --- include/config/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config/battle.h b/include/config/battle.h index dc521c83cbaf..fe044a4186bd 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -159,7 +159,7 @@ #define B_TIMER_BALL_MODIFIER GEN_LATEST // In Gen5+, Timer Ball's effectiveness increases by x0.3 per turn instead of x0.1 #define B_DUSK_BALL_MODIFIER GEN_LATEST // In Gen7+, Dusk Ball's catch multiplier is x3 instead of x3.5. #define B_QUICK_BALL_MODIFIER GEN_LATEST // In Gen5+, Quick Ball's catch multiplier is x5 instead of x4. -#define B_LURE_BALL_MODIFIER GEN_LATEST // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3. +#define B_LURE_BALL_MODIFIER GEN_LATEST // In Gen7+, Lure Ball's catch multiplier is greater than x3. #define B_HEAVY_BALL_MODIFIER GEN_LATEST // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_LATEST // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. #define B_SPORT_BALL_MODIFIER GEN_LATEST // In Gen8, Sport Ball's catch multiplier was reduced from x1.5 to x1. From 8ce9ae2c78c90158ea5650a1ce76e7f25700ea7a Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 7 Jan 2024 21:23:23 -0300 Subject: [PATCH 3/5] Specified the effects of B_LURE_BALL_MODIFIER in itsa state its effects in a more specific manner Co-authored-by: Eduardo Quezada D'Ottone --- include/config/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config/battle.h b/include/config/battle.h index fe044a4186bd..433f29ede05b 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -159,7 +159,7 @@ #define B_TIMER_BALL_MODIFIER GEN_LATEST // In Gen5+, Timer Ball's effectiveness increases by x0.3 per turn instead of x0.1 #define B_DUSK_BALL_MODIFIER GEN_LATEST // In Gen7+, Dusk Ball's catch multiplier is x3 instead of x3.5. #define B_QUICK_BALL_MODIFIER GEN_LATEST // In Gen5+, Quick Ball's catch multiplier is x5 instead of x4. -#define B_LURE_BALL_MODIFIER GEN_LATEST // In Gen7+, Lure Ball's catch multiplier is greater than x3. +#define B_LURE_BALL_MODIFIER GEN_LATEST // In Gen8+, Lure Ball's catch multiplier is x4. In Gen7, it's x5. In Gen6 and earlier, it's x3. #define B_HEAVY_BALL_MODIFIER GEN_LATEST // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_LATEST // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. #define B_SPORT_BALL_MODIFIER GEN_LATEST // In Gen8, Sport Ball's catch multiplier was reduced from x1.5 to x1. From 909dc2f01bf145739db2722b72eab3695e314093 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 7 Jan 2024 21:29:59 -0300 Subject: [PATCH 4/5] Corrected the comments of B_DREAM_BALL_MODIFIER, B_SPORT_BALL_MODIFIER and B_SAFARI_BALL_MODIFIER Co-authored-by: Eduardo Quezada D'Ottone --- include/config/battle.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index 433f29ede05b..b25060dccec6 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -161,9 +161,9 @@ #define B_QUICK_BALL_MODIFIER GEN_LATEST // In Gen5+, Quick Ball's catch multiplier is x5 instead of x4. #define B_LURE_BALL_MODIFIER GEN_LATEST // In Gen8+, Lure Ball's catch multiplier is x4. In Gen7, it's x5. In Gen6 and earlier, it's x3. #define B_HEAVY_BALL_MODIFIER GEN_LATEST // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. -#define B_DREAM_BALL_MODIFIER GEN_LATEST // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. -#define B_SPORT_BALL_MODIFIER GEN_LATEST // In Gen8, Sport Ball's catch multiplier was reduced from x1.5 to x1. -#define B_SAFARI_BALL_MODIFIER GEN_LATEST // In Gen8, Safari Ball's catch multiplier was reduced from x1.5 to x1. +#define B_DREAM_BALL_MODIFIER GEN_LATEST // In Gen8+, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. +#define B_SPORT_BALL_MODIFIER GEN_LATEST // In Gen8+, Sport Ball's catch multiplier was reduced from x1.5 to x1. +#define B_SAFARI_BALL_MODIFIER GEN_LATEST // In Gen8+, Safari Ball's catch multiplier was reduced from x1.5 to x1. #define B_SERENE_GRACE_BOOST GEN_LATEST // In Gen5+, Serene Grace boosts the added flinch chance of King's Rock and Razor Fang. // Flag settings From 848409757968f29586dce3c16c6f33e28ba435e3 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 7 Jan 2024 22:18:17 -0300 Subject: [PATCH 5/5] Turned the ternaries in the case for the Lure Ball's catch rate in Cmd_handleballthrow into a regular if/else if statement Co-authored-by: Eduardo Quezada D'Ottone --- src/battle_script_commands.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a28660d2c0d7..f848753da02d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -14905,7 +14905,14 @@ static void Cmd_handleballthrow(void) break; case ITEM_LURE_BALL: if (gIsFishingEncounter) - ballMultiplier = (B_LURE_BALL_MODIFIER >= GEN_7 ? ((B_LURE_BALL_MODIFIER) >= GEN_8 ? 400: 500) : 300); + { + if (B_LURE_BALL_MODIFIER >= GEN_8) + ballMultiplier = 400; + else if (B_LURE_BALL_MODIFIER >= GEN_7) + ballMultiplier = 500; + else + ballMultiplier = 300; + } break; case ITEM_MOON_BALL: {