mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Force reset summon data and load assets prior to switch in
This commit is contained in:
parent
da6cdaf187
commit
be4efe5727
@ -125,6 +125,12 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
const switchedInPokemon: Pokemon | undefined = party[this.slotIndex];
|
const switchedInPokemon: Pokemon | undefined = party[this.slotIndex];
|
||||||
this.lastPokemon = this.getPokemon();
|
this.lastPokemon = this.getPokemon();
|
||||||
|
|
||||||
|
// Defensive programming: Overcome the bug where the summon data has somehow not been reset
|
||||||
|
// prior to switching in a new Pokemon.
|
||||||
|
// Force the switch to occur and load the assets for the new pokemon, ignoring override.
|
||||||
|
switchedInPokemon.resetSummonData();
|
||||||
|
switchedInPokemon.loadAssets(true);
|
||||||
|
|
||||||
applyPreSummonAbAttrs(PreSummonAbAttr, switchedInPokemon);
|
applyPreSummonAbAttrs(PreSummonAbAttr, switchedInPokemon);
|
||||||
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, this.lastPokemon);
|
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, this.lastPokemon);
|
||||||
if (!switchedInPokemon) {
|
if (!switchedInPokemon) {
|
||||||
@ -132,6 +138,8 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// await globalScene.time.delayedCall(2000 () => )
|
||||||
|
|
||||||
if (this.switchType === SwitchType.BATON_PASS) {
|
if (this.switchType === SwitchType.BATON_PASS) {
|
||||||
// If switching via baton pass, update opposing tags coming from the prior pokemon
|
// If switching via baton pass, update opposing tags coming from the prior pokemon
|
||||||
(this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) =>
|
(this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user