From adc1413d984b49b1c80e5574a9d650c07f38c35e Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 11 Nov 2021 17:48:15 -0500 Subject: [PATCH 1/3] add kings rock serene grace boost config --- include/constants/battle_config.h | 1 + src/battle_util.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index aaf02a37f1..ba9c1b984c 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -181,6 +181,7 @@ #define B_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3. #define B_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_8 // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. +#define B_KINGS_ROCK_BOOST GEN_7 // In Gen5+, King's Rock is boosted by Serene Grace // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. diff --git a/src/battle_util.c b/src/battle_util.c index 4b3fc11aa9..8b23cdec37 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6860,8 +6860,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) switch (atkHoldEffect) { case HOLD_EFFECT_FLINCH: - if (GetBattlerAbility(gBattlerAttacker) == ABILITY_SERENE_GRACE) - atkHoldEffectParam *= 2; + #if B_KINGS_ROCK_BOOST >= GEN_5 + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_SERENE_GRACE) + atkHoldEffectParam *= 2; + #endif if (gBattleMoveDamage != 0 // Need to have done damage && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED From 6214d8b62511df9c5a0c519589d2b7a84f1ae66b Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 12 Nov 2021 07:47:24 -0500 Subject: [PATCH 2/3] rename config --- include/constants/battle_config.h | 2 +- src/battle_util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index ba9c1b984c..d28e9da5c2 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -181,7 +181,7 @@ #define B_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3. #define B_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_8 // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. -#define B_KINGS_ROCK_BOOST GEN_7 // In Gen5+, King's Rock is boosted by Serene Grace +#define B_SERENE_GRACE_BOOST GEN_7 // In Gen5+, Serene Grace boosts King's Rock and Razor fang // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. diff --git a/src/battle_util.c b/src/battle_util.c index 8b23cdec37..18847b8cce 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6860,7 +6860,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) switch (atkHoldEffect) { case HOLD_EFFECT_FLINCH: - #if B_KINGS_ROCK_BOOST >= GEN_5 + #if B_SERENE_GRACE_BOOST >= GEN_5 if (GetBattlerAbility(gBattlerAttacker) == ABILITY_SERENE_GRACE) atkHoldEffectParam *= 2; #endif From c5dabf34b89f2934316a2a66122acf131210bdca Mon Sep 17 00:00:00 2001 From: ultima-soul <33333039+ultima-soul@users.noreply.github.com> Date: Fri, 12 Nov 2021 09:39:18 -0800 Subject: [PATCH 3/3] Improve Serene Grace boost config comment. --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index d28e9da5c2..eb7600cc2a 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -181,7 +181,7 @@ #define B_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3. #define B_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_8 // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. -#define B_SERENE_GRACE_BOOST GEN_7 // In Gen5+, Serene Grace boosts King's Rock and Razor fang +#define B_SERENE_GRACE_BOOST GEN_7 // In Gen5+, Serene Grace boosts the added flinch chance of King's Rock and Razor Fang. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.