From 85c2ca718af6ddec8a96aaac018fcfb659636d65 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 29 May 2023 13:25:36 -0400 Subject: [PATCH] Add Wonder Guard HP exception --- src/pokemon.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pokemon.ts b/src/pokemon.ts index bc6b99db0..3ae89057f 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -23,7 +23,7 @@ import { WeatherType } from './data/weather'; import { TempBattleStat } from './data/temp-battle-stat'; import { ArenaTagType, WeakenMoveTypeTag } from './data/arena-tag'; import { Biome } from './data/biome'; -import { Abilities, Ability, BattleStatMultiplierAbAttr, BlockCritAbAttr, PreApplyBattlerTagAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, abilities, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs } from './data/ability'; +import { Abilities, Ability, BattleStatMultiplierAbAttr, BlockCritAbAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, abilities, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs } from './data/ability'; import PokemonData from './system/pokemon-data'; import { BattlerIndex } from './battle'; @@ -364,6 +364,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { let value = Math.floor(((2 * baseStat + this.ivs[s] + (0 / 4)) * this.level) * 0.01); if (isHp) { value = Math.min(value + this.level + 10, 99999); + if (this.getAbility().hasAttr(NonSuperEffectiveImmunityAbAttr)) + value = 1; if (this.hp > value || this.hp === undefined) this.hp = value; else if (this.hp) {