From 2bfefa630b6ca7d3828cc6f4edcbb1ef937178dc Mon Sep 17 00:00:00 2001 From: Mumble Date: Thu, 4 Jul 2024 15:18:09 -0700 Subject: [PATCH] [Bug] Added new condition for PostDefendContactAbAttr for Magic Guard and Iron Barbs/Rough Skin (#2793) Co-authored-by: Frutescens --- src/data/ability.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 4f4807ed614..d3f871c9c19 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -879,7 +879,7 @@ export class PostDefendContactDamageAbAttr extends PostDefendAbAttr { } applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean { - if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) { + if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.hasAbilityWithAttr(BlockNonDirectDamageAbAttr)) { attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER); attacker.turnData.damageTaken += Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)); return true;