From 3583174ac9d7ed54ebad6606b9abb475dfd200db Mon Sep 17 00:00:00 2001 From: Griffin Zody Date: Tue, 14 May 2024 17:37:59 -0600 Subject: [PATCH] Reuse prevent endure for status move damage --- src/field/pokemon.ts | 6 +++--- src/phases.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f2922c71d..fd1613df1 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -630,7 +630,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { let value = Math.floor(((2 * baseStat + this.ivs[s]) * this.level) * 0.01); if (isHp) { value = value + this.level + 10; - if (this.hasAbility(Abilities.WONDER_GUARD, false, true) || this.species.speciesId == Species.SHEDINJA) + if (this.hasAbility(Abilities.WONDER_GUARD, false, true)) value = 1; if (this.hp > value || this.hp === undefined) this.hp = value; @@ -1657,7 +1657,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return result; } - damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false, statusDamage: boolean = false): integer { + damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false): integer { if (this.isFainted()) return 0; const surviveDamage = new Utils.BooleanHolder(false); @@ -1667,7 +1667,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { surviveDamage.value = this.lapseTag(BattlerTagType.ENDURING) else if (this.hp > 1 && this.getTag(BattlerTagType.STURDY)) surviveDamage.value = this.lapseTag(BattlerTagType.STURDY) - if (!statusDamage && !surviveDamage.value) + if (!surviveDamage.value) this.scene.applyModifiers(SurviveDamageModifier, this.isPlayer(), this, surviveDamage); if (surviveDamage.value) damage = this.hp - 1; diff --git a/src/phases.ts b/src/phases.ts index 2ab0cf426..ef6d92c20 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2992,7 +2992,7 @@ export class PostTurnStatusEffectPhase extends PokemonPhase { break; } if (damage) { - this.scene.damageNumberHandler.add(this.getPokemon(), pokemon.damage(damage, statusDamage)); + this.scene.damageNumberHandler.add(this.getPokemon(), pokemon.damage(damage, false, statusDamage)); pokemon.updateInfo(); } new CommonBattleAnim(CommonAnim.POISON + (pokemon.status.effect - 1), pokemon).play(this.scene, () => this.end());