- Only enabled retries if enableRetries is enabled.

- Only enabled retries if enableRetries is enabled.
This commit is contained in:
Burai Mu 2025-09-10 16:17:16 +08:00
parent 7f02a04f0b
commit b6748519c6

View File

@ -201,44 +201,46 @@ export class CommandUiHandler extends UiHandler {
}
break;
case Button.CYCLE_ABILITY:
globalScene.ui.setMode(UiMode.MESSAGE)
globalScene.ui.showText(i18next.t("battle:retryBattle"), null, () => {
globalScene.ui.setMode(
UiMode.CONFIRM,
() => {
globalScene.ui.fadeOut(1250).then(() => {
globalScene.reset();
globalScene.phaseManager.clearPhaseQueue();
globalScene.gameData.loadSession(globalScene.sessionSlotId).then(() => {
globalScene.phaseManager.pushNew("EncounterPhase", true);
if (globalScene.enableRetries){
globalScene.ui.setMode(UiMode.MESSAGE)
globalScene.ui.showText(i18next.t("battle:retryBattle"), null, () => {
globalScene.ui.setMode(
UiMode.CONFIRM,
() => {
globalScene.ui.fadeOut(1250).then(() => {
globalScene.reset();
globalScene.phaseManager.clearPhaseQueue();
globalScene.gameData.loadSession(globalScene.sessionSlotId).then(() => {
globalScene.phaseManager.pushNew("EncounterPhase", true);
const availablePartyMembers = globalScene.getPokemonAllowedInBattle().length;
const availablePartyMembers = globalScene.getPokemonAllowedInBattle().length;
globalScene.phaseManager.pushNew("SummonPhase", 0);
if (globalScene.currentBattle.double && availablePartyMembers > 1) {
globalScene.phaseManager.pushNew("SummonPhase", 1);
}
if (
globalScene.currentBattle.waveIndex > 1 &&
globalScene.currentBattle.battleType !== BattleType.TRAINER
) {
globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double);
globalScene.phaseManager.pushNew("SummonPhase", 0);
if (globalScene.currentBattle.double && availablePartyMembers > 1) {
globalScene.phaseManager.pushNew("CheckSwitchPhase", 1, globalScene.currentBattle.double);
globalScene.phaseManager.pushNew("SummonPhase", 1);
}
}
globalScene.ui.fadeIn(1250);
globalScene.phaseManager.shiftPhase();
if (
globalScene.currentBattle.waveIndex > 1 &&
globalScene.currentBattle.battleType !== BattleType.TRAINER
) {
globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double);
if (globalScene.currentBattle.double && availablePartyMembers > 1) {
globalScene.phaseManager.pushNew("CheckSwitchPhase", 1, globalScene.currentBattle.double);
}
}
globalScene.ui.fadeIn(1250);
globalScene.phaseManager.shiftPhase();
});
});
});
},
() => { globalScene.ui.setMode(UiMode.COMMAND)},
false,
0,
0,
1000,
);
});
},
() => { globalScene.ui.setMode(UiMode.COMMAND)},
false,
0,
0,
1000,
);
});
}
break;
}
}