mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-14 12:22:19 +02:00
Fixes sturdy to stop popping up even if not used
This commit is contained in:
parent
f18ff5b6cc
commit
4038b9d629
@ -249,10 +249,11 @@ 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.getMaxHp() <= 1 && (pokemon.getHpRatio() < 1 || (args[0] as Utils.NumberHolder).value < pokemon.hp))
|
||||
return false;
|
||||
|
||||
return pokemon.addTag(BattlerTagType.STURDY, 1);
|
||||
if (pokemon.hp === pokemon.getMaxHp() && (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
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user