Fix issues with ending DamageAnimPhase during tests

This commit is contained in:
Michael Li 2025-01-10 17:16:23 -05:00 committed by Sirz Benjie
parent c66be1997e
commit 6154306f80
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
3 changed files with 15 additions and 9 deletions

View File

@ -2471,6 +2471,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.switchOutStatus = status;
}
/**
* Updates the Pokemon's battle info UI. This is purely a visual update.
* @param instant Whether or not the update should be instant.
*/
updateInfo(instant?: boolean): Promise<void> {
return this.battleInfo.updateInfo(this, instant);
}

View File

@ -33,15 +33,15 @@ export async function runMysteryEncounterToEnd(game: GameManager, optionNo: numb
}, () => game.isCurrentPhase(MysteryEncounterBattlePhase) || game.isCurrentPhase(MysteryEncounterRewardsPhase));
if (isBattle) {
game.onNextPrompt("DamageAnimPhase", Mode.MESSAGE, () => {
game.onNextPrompt(
"CheckSwitchPhase",
Mode.CONFIRM,
() => {
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase));
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase));
},
() => game.isCurrentPhase(CommandPhase),
);
game.onNextPrompt("CheckSwitchPhase", Mode.MESSAGE, () => {
game.setMode(Mode.MESSAGE);

View File

@ -186,6 +186,8 @@ export class GameWrapper {
this.scene.time = new MockClock(this.scene);
this.scene.remove = vi.fn(); // TODO: this should be stubbed differently
this.scene.eventManager = new MockTimedEventManager(); // Disable Timed Events
Pokemon.prototype.updateInfo = async () => {};
}
}