From b8bc8c43fa94661ea4e398b58a24ff8c0acbc2cf Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 21 Dec 2024 16:42:09 +0100 Subject: [PATCH] Adding a new key determining whether the command cursor resets at the beginning of each new battle. --- src/battle-scene.ts | 1 + src/phases/command-phase.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c430a12ae3e..7bc54e9ae59 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -147,6 +147,7 @@ export default class BattleScene extends SceneBase { public damageNumbersMode: integer = 0; public reroll: boolean = false; public shopCursorTarget: number = ShopCursorTarget.REWARDS; + public commandCursorReset: boolean = true; public showMovesetFlyout: boolean = true; public showArenaFlyout: boolean = true; public showTimeOfDayWidget: boolean = true; diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index eab76282908..29c53ad2780 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -35,8 +35,14 @@ export class CommandPhase extends FieldPhase { this.scene.updateGameInfo(); const commandUiHandler = this.scene.ui.handlers[Mode.COMMAND]; + + // If one of these conditions is true, we always reset the cursor to Command.FIGHT + const cursorResetBattle = this.scene.currentBattle.battleType === BattleType.MYSTERY_ENCOUNTER || + this.scene.currentBattle.battleType === BattleType.TRAINER || + this.scene.arena.biomeType === Biome.END; + if (commandUiHandler) { - if (this.scene.currentBattle.turn === 1 || commandUiHandler.getCursor() === Command.POKEMON) { + if ((this.scene.currentBattle.turn === 1 && (this.scene.commandCursorReset || cursorResetBattle)) || commandUiHandler.getCursor() === Command.POKEMON) { commandUiHandler.setCursor(Command.FIGHT); } else { commandUiHandler.setCursor(commandUiHandler.getCursor());