revert to normal forms when fainted

This commit is contained in:
torranx 2024-09-05 21:49:10 +08:00
parent c902369eed
commit 6595162d42

View File

@ -17,6 +17,7 @@ import { ToggleDoublePositionPhase } from "./toggle-double-position-phase";
import { GameOverPhase } from "./game-over-phase";
import { SwitchPhase } from "./switch-phase";
import { VictoryPhase } from "./victory-phase";
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms.js";
export class FaintPhase extends PokemonPhase {
private preventEndure: boolean;
@ -59,6 +60,7 @@ export class FaintPhase extends PokemonPhase {
}
this.scene.queueMessage(i18next.t("battle:fainted", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }), null, true);
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);
if (pokemon.turnData?.attacksReceived?.length) {
const lastAttack = pokemon.turnData.attacksReceived[0];