[P2 Bug] Revert to normal form when Pokémon is fainted (#4049)

* revert to normal forms when fainted

* Remove `.js` from import

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
This commit is contained in:
Adrian T. 2024-09-07 03:17:08 +08:00 committed by GitHub
parent 33cb999774
commit e6a574c48f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

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";
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];