Clean up Unseen Fist Check (#5420)

* Clean up Unseedn Fist Check

* fix compiling
This commit is contained in:
Alex 2024-09-22 16:41:26 +02:00 committed by GitHub
parent 60e2c0f859
commit b924461ae3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8541,13 +8541,9 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move)
if (gProtectStructs[battlerDef].maxGuarded && IsMoveBlockedByMaxGuard(move))
return TRUE;
// 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
&& (gMovesInfo[move].makesContact
|| (gMovesInfo[move].effect == EFFECT_SHELL_SIDE_ARM
&& gBattleStruct->shellSideArmCategory[battlerAtk][battlerDef] == DAMAGE_CATEGORY_PHYSICAL))
&& !gProtectStructs[battlerDef].maxGuarded) // Max Guard cannot be bypassed by Unseen Fist
if (!gProtectStructs[battlerDef].maxGuarded // Max Guard cannot be bypassed by Unseen Fist
&& IsMoveMakingContact(move, gBattlerAttacker)
&& GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST)
return FALSE;
else if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_CRAFTY_SHIELD
&& IS_MOVE_STATUS(move))