Force reset summon data and load assets prior to switch in

This commit is contained in:
Sirz Benjie 2025-05-22 12:13:15 -05:00
parent da6cdaf187
commit be4efe5727
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -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) =>