From f9272a89fa3fade69f26a37462cc2fe93e9abc15 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 12 Oct 2021 21:09:27 -0400 Subject: [PATCH] add mirror armor check to two-stage stat decrease effects --- src/battle_script_commands.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9c0b4ec370..253f87c1ca 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3016,9 +3016,7 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_EVS_MINUS_1: flags = affectsUser | certain; if (mirrorArmorReflected && !affectsUser) - { flags |= STAT_BUFF_ALLOW_PTR; - } if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, @@ -3063,11 +3061,15 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: + flags = affectsUser | certain; + if (mirrorArmorReflected && !affectsUser) + flags |= STAT_BUFF_ALLOW_PTR; if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE, gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_2 + 1, - affectsUser, 0)) + flags, gBattlescriptCurrInstr + 1)) { - gBattlescriptCurrInstr++; + if (!mirrorArmorReflected) + gBattlescriptCurrInstr++; } else {