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
This commit is contained in:
RedstonewolfX 2024-08-03 12:14:51 -04:00
parent f4ca84944f
commit 4124bb67ce

View File

@ -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()) {