From 05c241c964d0032125d1642bdb35e87e3a329f3d Mon Sep 17 00:00:00 2001 From: Tiduzz Date: Sun, 12 May 2024 12:24:44 -0300 Subject: [PATCH] Made a small fix and added better comments in relation to interaction with Wonder_guard ability --- src/data/ability.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index e2cc4c56da7..cad6257152d 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -249,8 +249,10 @@ export class PreDefendFormChangeAbAttr extends PreDefendAbAttr { } export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (pokemon.hp === pokemon.getMaxHp() && pokemon.getMaxHp() >= 1 && (args[0] as Utils.NumberHolder).value >= pokemon.hp){ //Checks if pokemon hp is full and if the damage is higher or equal to defender hp - return pokemon.addTag(BattlerTagType.STURDY, 1); //activates sturdy + if (pokemon.hp === pokemon.getMaxHp() && + pokemon.getMaxHp() > 1 && //Checks if pokemon has wonder_guard (which forces 1hp) + (args[0] as Utils.NumberHolder).value >= pokemon.hp){ //Damage >= hp + return pokemon.addTag(BattlerTagType.STURDY, 1); } return false