From c4f27174c3f138b591f582399193b80c6d1b8d33 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Fri, 19 Nov 2021 16:21:33 +1300 Subject: [PATCH] Implement Unseen Fist Unseen Fist allows contact moves to bypass protect effects, but doesn't lift the effect. --- src/battle_util.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 1e29695e2..0b25f7227 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7517,8 +7517,13 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) else if (gProtectStructs[battlerId].protected) return FALSE; } - - if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED)) + + // Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here. + // This means extra logic is needed to handle Shell Side Arm. + if (GetBattlerAbility(gBattlerAttacker == ABILITY_UNSEEN_FIST) + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT || (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory))) + return FALSE; + else if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED)) return FALSE; else if (gBattleMoves[move].effect == MOVE_EFFECT_FEINT) return FALSE;