From 91fc406b0a733930b83e884a92cc164308c1df7c Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Tue, 22 Apr 2025 18:54:04 +0100 Subject: [PATCH] Fixes Mirror Armor stat drops not being stopped by Substitute (#6675) --- data/battle_scripts_1.s | 9 ++++++++- test/battle/ability/mirror_armor.c | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a4f13be0b9..c6d6075ad5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3202,7 +3202,7 @@ BattleScript_StatDownEnd:: BattleScript_MirrorArmorReflect:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp - jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss + jumpifstatus2 BS_ATTACKER, STATUS2_SUBSTITUTE, BattleScript_MirrorArmorDoesntAffect BattleScript_MirrorArmorReflectStatLoss: statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_MIRROR_ARMOR | STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim @@ -3216,6 +3216,13 @@ BattleScript_MirrorArmorReflectPrintString: BattleScript_MirrorArmorReflectEnd: return +BattleScript_MirrorArmorDoesntAffect: + swapattackerwithtarget + printstring STRINGID_ITDOESNTAFFECT + waitmessage B_WAIT_TIME_LONG + swapattackerwithtarget + return + BattleScript_MirrorArmorReflectWontFall: copybyte gBattlerTarget, gBattlerAttacker @ STRINGID_STATSWONTDECREASE uses target goto BattleScript_MirrorArmorReflectPrintString diff --git a/test/battle/ability/mirror_armor.c b/test/battle/ability/mirror_armor.c index 0918682d76..97e7616c94 100644 --- a/test/battle/ability/mirror_armor.c +++ b/test/battle/ability/mirror_armor.c @@ -102,10 +102,8 @@ SINGLE_BATTLE_TEST("Mirror Armor lowers the Attack of Pokemon with Intimidate") } } -// Unsure whether this should or should not fail, as Showdown has conflicting information. Needs testing in gen8 games. SINGLE_BATTLE_TEST("Mirror Armor doesn't lower the stats of an attacking Pokemon behind Substitute") { - KNOWN_FAILING; GIVEN { PLAYER(SPECIES_CORVIKNIGHT) { Ability(ABILITY_MIRROR_ARMOR); } OPPONENT(SPECIES_WYNAUT);