mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 23:42:18 +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];
|
||||
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);
|
||||
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, this.lastPokemon);
|
||||
if (!switchedInPokemon) {
|
||||
@ -132,6 +138,8 @@ export class SwitchSummonPhase extends SummonPhase {
|
||||
return;
|
||||
}
|
||||
|
||||
// await globalScene.time.delayedCall(2000 () => )
|
||||
|
||||
if (this.switchType === SwitchType.BATON_PASS) {
|
||||
// If switching via baton pass, update opposing tags coming from the prior pokemon
|
||||
(this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) =>
|
||||
|
Loading…
Reference in New Issue
Block a user