From ad8576d5489a2c6e13e4c898747cfee47477b459 Mon Sep 17 00:00:00 2001 From: sneed <56992013+Sneed69@users.noreply.github.com> Date: Sun, 2 Jun 2024 19:20:00 +0300 Subject: [PATCH] Fix some abilities preventing stat dropping move effects when used on self (#4696) * Move SOLAR_POWER_HP_DROP label * Abilities don't prevent self stat dropping effects Hyper cutter does not stop MOVE_EFFECT_ATK_MINUS_1 and MOVE_EFFECT_ATK_MINUS_2. Big Pecks does not stop MOVE_EFFECT_DEF_MINUS_1 and MOVE_EFFECT_DEF_MINUS_2. Keen Eye and Illuminate do not stop MOVE_EFFECT_ACC_MINUS_1 and MOVE_EFFECT_ACC_MINUS_2. --- src/battle_script_commands.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 621b2c23128c..e9679239317f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3350,7 +3350,10 @@ void SetMoveEffect(bool32 primary, bool32 certain) case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1: - flags = affectsUser; + if (affectsUser == MOVE_EFFECT_AFFECTS_USER) + flags = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN; + else + flags = 0; if (mirrorArmorReflected) flags |= (STAT_CHANGE_ALLOW_PTR * !affectsUser); else @@ -3400,7 +3403,10 @@ void SetMoveEffect(bool32 primary, bool32 certain) case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: - flags = affectsUser; + if (affectsUser == MOVE_EFFECT_AFFECTS_USER) + flags = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN; + else + flags = 0; if (mirrorArmorReflected && !affectsUser) flags |= STAT_CHANGE_ALLOW_PTR; if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE,