From 4124bb67ce080043195288d2c13e69a916d53144 Mon Sep 17 00:00:00 2001 From: RedstonewolfX <108761527+RedstonewolfX@users.noreply.github.com> Date: Sat, 3 Aug 2024 12:14:51 -0400 Subject: [PATCH] Fix bug with dragon tail Using moves that force an opponent to flee in a double battle freezes the game, as it still tries to pick an action for the Pokemon that doesn't exist anymore Makes the "Import Session" shortcut accessible even if you don't have Endless unlocked Moves the "Import Session" shortcut to be below Endless Spliced --- src/phases.ts | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index 058e6b079e0..5163825147d 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -839,14 +839,6 @@ export class TitlePhase extends Phase { } } ]; - options.push({ - label: i18next.t("menuUiHandler:importSession"), - handler: () => { - this.confirmSlot(i18next.t("menuUiHandler:importSlotSelect"), () => true, slotId => this.scene.gameData.importData(GameDataType.SESSION, slotId)); - return true; - }, - keepOpen: true - }) if (this.scene.gameData.unlocks[Unlockables.SPLICED_ENDLESS_MODE]) { options.push({ label: GameMode.getModeName(GameModes.SPLICED_ENDLESS), @@ -856,6 +848,14 @@ export class TitlePhase extends Phase { } }); } + options.push({ + label: i18next.t("menuUiHandler:importSession"), + handler: () => { + this.confirmSlot(i18next.t("menuUiHandler:importSlotSelect"), () => true, slotId => this.scene.gameData.importData(GameDataType.SESSION, slotId)); + return true; + }, + keepOpen: true + }) options.push({ label: i18next.t("menu:cancel"), handler: () => { @@ -867,10 +867,33 @@ export class TitlePhase extends Phase { }); this.scene.ui.showText(i18next.t("menu:selectGameMode"), null, () => this.scene.ui.setOverlayMode(Mode.OPTION_SELECT, { options: options })); } else { - this.gameMode = GameModes.CLASSIC; - this.scene.ui.setMode(Mode.MESSAGE); - this.scene.ui.clearText(); - this.end(); + const options: OptionSelectItem[] = [ + { + label: GameMode.getModeName(GameModes.CLASSIC), + handler: () => { + setModeAndEnd(GameModes.CLASSIC); + return true; + } + } + ]; + options.push({ + label: i18next.t("menuUiHandler:importSession"), + handler: () => { + this.confirmSlot(i18next.t("menuUiHandler:importSlotSelect"), () => true, slotId => this.scene.gameData.importData(GameDataType.SESSION, slotId)); + return true; + }, + keepOpen: true + }) + options.push({ + label: i18next.t("menu:cancel"), + handler: () => { + this.scene.clearPhaseQueue(); + this.scene.pushPhase(new TitlePhase(this.scene)); + super.end(); + return true; + } + }); + this.scene.ui.showText(i18next.t("menu:selectGameMode"), null, () => this.scene.ui.setOverlayMode(Mode.OPTION_SELECT, { options: options })); } return true; } @@ -2910,7 +2933,7 @@ export class TurnInitPhase extends FieldPhase { } } Pt.forEach((pokemon, i) => { - if (pokemon != undefined) + if (pokemon != undefined && pokemon.hp > 0 && pokemon.isActive()) if (pokemon.hasTrainer() || true) { console.log(i) if (pokemon.getFieldIndex() == 1 && pokemon.isOnField()) {