mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 13:52:18 +02:00
Made a small fix and added better comments in
relation to interaction with Wonder_guard ability
This commit is contained in:
parent
08a7f00ed9
commit
05c241c964
@ -249,8 +249,10 @@ export class PreDefendFormChangeAbAttr extends PreDefendAbAttr {
|
|||||||
}
|
}
|
||||||
export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr {
|
export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr {
|
||||||
applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
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
|
if (pokemon.hp === pokemon.getMaxHp() &&
|
||||||
return pokemon.addTag(BattlerTagType.STURDY, 1); //activates sturdy
|
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
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user