From 3b238737a1541063c170f72674f31a3ffda1c8ed Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 21 Apr 2023 00:10:45 -0400 Subject: [PATCH] Fix some bugs --- src/battle-phases.ts | 2 +- src/pokemon.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle-phases.ts b/src/battle-phases.ts index 4dfaf51a3..9d56952f3 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -598,7 +598,7 @@ export class TurnEndPhase extends BattlePhase { const enemyPokemon = this.scene.getEnemyPokemon(); const handlePokemon = (pokemon: Pokemon) => { - if (!pokemon) + if (!pokemon || !pokemon.hp) return; pokemon.lapseTags(BattleTagLapseType.TURN_END); diff --git a/src/pokemon.ts b/src/pokemon.ts index fc7591e9e..f7e434502 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -273,7 +273,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { let ret = this.stats[stat] * (Math.max(2, 2 + statLevel.value) / Math.max(2, 2 - statLevel.value)); if (stat === Stat.SPDEF && this.scene.arena.weather?.weatherType === WeatherType.SANDSTORM) ret *= 1.5; - if (this.status && this.status.effect === StatusEffect.PARALYSIS) + if (stat === Stat.SPD && this.status && this.status.effect === StatusEffect.PARALYSIS) ret >>= 2; return ret; }