Maybe fixed a few bugs

This commit is contained in:
Bertie690 2025-08-02 13:31:34 -04:00
parent 3114c1743f
commit d10b1b0a13
5 changed files with 6 additions and 3 deletions

View File

@ -547,7 +547,7 @@ describe("Abilities - Wimp Out", () => {
await game.move.selectEnemyMove(MoveId.SPLASH); await game.move.selectEnemyMove(MoveId.SPLASH);
await game.move.selectEnemyMove(MoveId.ENDURE); await game.move.selectEnemyMove(MoveId.ENDURE);
await game.toNextWave(); await game.phaseInterceptor.to("SelectModifierPhase");
expect(game.scene.currentBattle.waveIndex).toBe(wave + 1); expect(game.scene.currentBattle.waveIndex).toBe(wave + 1);
}); });
}); });

View File

@ -146,6 +146,6 @@ describe("Moves - Metronome", () => {
const hasFled = enemyPokemon.switchOutStatus; const hasFled = enemyPokemon.switchOutStatus;
expect(!isVisible && hasFled).toBe(true); expect(!isVisible && hasFled).toBe(true);
await game.toNextWave(); await game.toNextTurn();
}); });
}); });

View File

@ -104,6 +104,7 @@ export class GameManager {
(this.scene.ui.handlers[UiMode.STARTER_SELECT] as StarterSelectUiHandler).clearStarterPreferences(); (this.scene.ui.handlers[UiMode.STARTER_SELECT] as StarterSelectUiHandler).clearStarterPreferences();
// Must be run after phase interceptor has been initialized. // Must be run after phase interceptor has been initialized.
this.gameWrapper.scene = this.scene;
this.scene.phaseManager.toTitleScreen(true); this.scene.phaseManager.toTitleScreen(true);
this.scene.phaseManager.shiftPhase(); this.scene.phaseManager.shiftPhase();
} }
@ -148,7 +149,7 @@ export class GameManager {
/** /**
* Ends the current phase immediately. * Ends the current phase immediately.
* @see {@linkcode PhaseManager.shiftPhase} Function to skip the next upcoming phase * @see {@linkcode PhaseInterceptor.shiftPhase} Function to skip the next upcoming phase
*/ */
endPhase() { endPhase() {
this.scene.phaseManager.getCurrentPhase()?.end(); this.scene.phaseManager.getCurrentPhase()?.end();

View File

@ -30,6 +30,7 @@ interface UIPrompt {
* Array of phases that hang whiile waiting for player input. * Array of phases that hang whiile waiting for player input.
* Changing UI modes during these phases will halt the phase interceptor. * Changing UI modes during these phases will halt the phase interceptor.
* @todo This is an extremely unintuitive solution that only works on a select few phases * @todo This is an extremely unintuitive solution that only works on a select few phases
* and does not account for UI handlers not accepting input
*/ */
const endBySetMode: ReadonlyArray<PhaseString> = [ const endBySetMode: ReadonlyArray<PhaseString> = [
"CommandPhase", "CommandPhase",

View File

@ -57,6 +57,7 @@ export class ReloadHelper extends GameManagerHelper {
this.game.scene.modifiers = []; this.game.scene.modifiers = [];
} }
titlePhase.loadSaveSlot(-1); // Load the desired session data titlePhase.loadSaveSlot(-1); // Load the desired session data
console.log(this.game.scene.phaseManager.getCurrentPhase()?.phaseName);
this.game.scene.phaseManager.shiftPhase(); // Loading the save slot also ended TitlePhase, clean it up this.game.scene.phaseManager.shiftPhase(); // Loading the save slot also ended TitlePhase, clean it up
// Run through prompts for switching Pokemon, copied from classicModeHelper.ts // Run through prompts for switching Pokemon, copied from classicModeHelper.ts