mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 22:02:18 +02:00
bug fix to save illusion status
This commit is contained in:
parent
83491b0c3c
commit
f2a120a848
@ -888,8 +888,7 @@ export default class BattleScene extends SceneBase {
|
||||
}
|
||||
|
||||
public getPlayerParty(): PlayerPokemon[] {
|
||||
const party = this.party;
|
||||
return party;
|
||||
return this.party;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5232,6 +5232,7 @@ export class IllusionPreSummonAbAttr extends PreSummonAbAttr {
|
||||
}
|
||||
|
||||
override canApplyPreSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
|
||||
pokemon.initSummondata()
|
||||
if(pokemon.hasTrainer()){
|
||||
const party: Pokemon[] = (pokemon.isPlayer() ? globalScene.getPlayerParty() : globalScene.getEnemyParty()).filter(p => p.isAllowedInBattle());
|
||||
const lastPokemon: Pokemon = party.filter(p => p !==pokemon).at(-1) || pokemon;
|
||||
|
@ -560,7 +560,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
|
||||
init(): void {
|
||||
this.fieldPosition = FieldPosition.CENTER;
|
||||
this.summonData = new PokemonSummonData(); // Need to be init for illusion to work
|
||||
this.initBattleInfo();
|
||||
|
||||
globalScene.fieldUI.addAt(this.battleInfo, 0);
|
||||
@ -5797,6 +5796,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
this.summonDataPrimer = summonDataPrimer;
|
||||
}
|
||||
|
||||
// For PreSummonAbAttr to get access to summonData
|
||||
initSummondata(): void {
|
||||
this.summonData = this.summonData ?? this.summonDataPrimer ?? new PokemonSummonData()
|
||||
}
|
||||
|
||||
resetSummonData(): void {
|
||||
const illusion: IllusionData | null = this.summonData?.illusion;
|
||||
if (this.summonData?.speciesForm) {
|
||||
|
@ -180,6 +180,7 @@ export default class PokemonData {
|
||||
this.summonData.types = source.summonData.types;
|
||||
this.summonData.speciesForm = source.summonData.speciesForm;
|
||||
this.summonDataSpeciesFormIndex = source.summonDataSpeciesFormIndex;
|
||||
this.summonData.illusionBroken = source.summonData.illusionBroken;
|
||||
|
||||
if (source.summonData.tags) {
|
||||
this.summonData.tags = source.summonData.tags?.map(t => loadBattlerTag(t));
|
||||
@ -225,6 +226,7 @@ export default class PokemonData {
|
||||
if (this.summonData) {
|
||||
// when loading from saved session, recover summonData.speciesFrom and form index species object
|
||||
// used to stay transformed on reload session
|
||||
|
||||
if (this.summonData.speciesForm) {
|
||||
this.summonData.speciesForm = getPokemonSpeciesForm(
|
||||
this.summonData.speciesForm.speciesId,
|
||||
|
Loading…
Reference in New Issue
Block a user