[BUG] Magic Guard-Spiky Shield Fix (#2803)

* Added new condition for PostDefendContactAbAttr

* Magic Guard-Spiky Shield interaction fix

---------

Co-authored-by: Frutescens <info@laptop>
This commit is contained in:
Mumble 2024-07-04 22:06:36 -07:00 committed by GitHub
parent ed80ad4bef
commit 25a619708a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -934,9 +934,11 @@ export class ContactDamageProtectedTag extends ProtectedTag {
const effectPhase = pokemon.scene.getCurrentPhase();
if (effectPhase instanceof MoveEffectPhase && effectPhase.move.getMove().hasFlag(MoveFlags.MAKES_CONTACT)) {
const attacker = effectPhase.getPokemon();
if (!attacker.hasAbilityWithAttr(BlockNonDirectDamageAbAttr)) {
attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER);
}
}
}
return ret;
}