From 08364d9060c5ea702df439ccef3ca8507e706738 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 22 Oct 2023 10:41:49 -0400 Subject: [PATCH] Fix reviver seed causing infinite loop and clear status on revive --- src/modifier/modifier.ts | 4 +++- src/pokemon.ts | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index b73796ba9..5e53a7754 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -683,7 +683,9 @@ export class PokemonInstantReviveModifier extends PokemonHeldItemModifier { const pokemon = args[0] as Pokemon; pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, pokemon.getBattlerIndex(), - Math.max(Math.floor(pokemon.getMaxHp() / 2), 1),getPokemonMessage(pokemon, ` was revived\nby its ${this.type.name}!`), false, false, true)); + Math.max(Math.floor(pokemon.getMaxHp() / 2), 1), getPokemonMessage(pokemon, ` was revived\nby its ${this.type.name}!`), false, false, true)); + + pokemon.resetStatus(); return true; } diff --git a/src/pokemon.ts b/src/pokemon.ts index 3e04b289e..cc55dd92f 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -760,9 +760,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } heal(amount: integer): void { - if (this.isFainted()) - return; - this.hp = Math.min(this.hp + amount, this.getMaxHp()); }