Fix crash when returning shiny
parent
4b61e50d72
commit
a005c7c850
|
@ -550,11 +550,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
queuePostSummon() {
|
onEnd(): void {
|
||||||
this.scene.pushPhase(new PostSummonPhase(this.scene, this.getPokemon().getBattlerIndex()));
|
|
||||||
}
|
|
||||||
|
|
||||||
end() {
|
|
||||||
const pokemon = this.getPokemon();
|
const pokemon = this.getPokemon();
|
||||||
|
|
||||||
if (pokemon.shiny)
|
if (pokemon.shiny)
|
||||||
|
@ -563,6 +559,14 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
||||||
pokemon.resetTurnData();
|
pokemon.resetTurnData();
|
||||||
|
|
||||||
this.queuePostSummon();
|
this.queuePostSummon();
|
||||||
|
}
|
||||||
|
|
||||||
|
queuePostSummon(): void {
|
||||||
|
this.scene.pushPhase(new PostSummonPhase(this.scene, this.getPokemon().getBattlerIndex()));
|
||||||
|
}
|
||||||
|
|
||||||
|
end() {
|
||||||
|
this.onEnd();
|
||||||
|
|
||||||
super.end();
|
super.end();
|
||||||
}
|
}
|
||||||
|
@ -632,19 +636,19 @@ export class SwitchSummonPhase extends SummonPhase {
|
||||||
this.end();
|
this.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
queuePostSummon() {
|
onEnd(): void {
|
||||||
this.scene.unshiftPhase(new PostSummonPhase(this.scene, this.getPokemon().getBattlerIndex()));
|
super.onEnd();
|
||||||
}
|
|
||||||
|
|
||||||
end() {
|
|
||||||
const pokemon = this.getPokemon();
|
const pokemon = this.getPokemon();
|
||||||
|
|
||||||
if (this.batonPass && pokemon)
|
if (this.batonPass && pokemon)
|
||||||
pokemon.transferSummon(this.lastPokemon);
|
pokemon.transferSummon(this.lastPokemon);
|
||||||
|
|
||||||
this.lastPokemon?.resetSummonData();
|
this.lastPokemon?.resetSummonData();
|
||||||
|
}
|
||||||
|
|
||||||
super.end();
|
queuePostSummon(): void {
|
||||||
|
this.scene.unshiftPhase(new PostSummonPhase(this.scene, this.getPokemon().getBattlerIndex()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -659,7 +663,12 @@ export class ReturnPhase extends SwitchSummonPhase {
|
||||||
|
|
||||||
summon(): void { }
|
summon(): void { }
|
||||||
|
|
||||||
queuePostSummon() { }
|
onEnd(): void {
|
||||||
|
const pokemon = this.getPokemon();
|
||||||
|
|
||||||
|
pokemon.resetTurnData();
|
||||||
|
pokemon.resetSummonData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ToggleDoublePositionPhase extends BattlePhase {
|
export class ToggleDoublePositionPhase extends BattlePhase {
|
||||||
|
|
Loading…
Reference in New Issue