From 59155b7c18d041243ad9bf87dd00453ae633261f Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 18 Apr 2023 16:47:29 -0400 Subject: [PATCH] Fix no faint bug with certain kinds of damage --- src/battle-tag.ts | 6 +++--- src/game-data.ts | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/battle-tag.ts b/src/battle-tag.ts index d80ce7215..fd82659c0 100644 --- a/src/battle-tag.ts +++ b/src/battle-tag.ts @@ -106,7 +106,7 @@ export class ConfusedTag extends PseudoStatusTag { const atk = pokemon.getBattleStat(Stat.ATK); const def = pokemon.getBattleStat(Stat.DEF); const damage = Math.ceil(((((2 * pokemon.level / 5 + 2) * 40 * atk / def) / 50) + 2) * ((Utils.randInt(15) + 85) / 100)); - pokemon.hp = Math.max(pokemon.hp - damage, 0); + pokemon.damage(damage); pokemon.scene.unshiftPhase(new MessagePhase(pokemon.scene, 'It hurt itself in its\nconfusion!')); pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.isPlayer())); (pokemon.scene.getCurrentPhase() as MovePhase).cancel(); @@ -136,7 +136,7 @@ export class SeedTag extends PseudoStatusTag { pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, !pokemon.isPlayer(), CommonAnim.LEECH_SEED)); const damage = Math.max(Math.floor(pokemon.getMaxHp() / 8), 1); - pokemon.hp = Math.max(pokemon.hp - damage, 0); + pokemon.damage(damage); pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.isPlayer())); pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, !pokemon.isPlayer(), damage, getPokemonMessage(pokemon, '\'s health is\nsapped by LEECH SEED!'), false, true)); } @@ -170,7 +170,7 @@ export class NightmareTag extends PseudoStatusTag { pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.isPlayer(), CommonAnim.CURSE)); // TODO: Update animation type const damage = Math.ceil(pokemon.getMaxHp() / 4); - pokemon.hp = Math.max(pokemon.hp - damage, 0); + pokemon.damage(damage); pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.isPlayer())); } diff --git a/src/game-data.ts b/src/game-data.ts index b5559d989..be99bb6fd 100644 --- a/src/game-data.ts +++ b/src/game-data.ts @@ -127,8 +127,6 @@ export class GameData { entry.caught = true; } - data[Species.SHAYMIN][1][1].caught = true; - this.dexData = data; }