Remove endless 5850 crash bug (#1463)
This commit is contained in:
parent
f64e9e4a0d
commit
970e335fab
|
@ -2316,6 +2316,8 @@ export const PGMmiscDialogue: SimpleTranslationEntries = {
|
|||
$@c{smile_wave_wink}Just kidding!@d{64} @c{smile}I'd never forget.@d{32}\nYour legend will live on in our hearts.
|
||||
$@c{smile_wave}Anyway,@d{64} it's getting late…@d{96} I think?\nIt's hard to tell in this place.
|
||||
$Let's go home. @c{smile_wave_wink}Maybe tomorrow, we can have another battle, for old time's sake?`,
|
||||
"ending_endless": "Congratulations on reaching the current end!\nMore content is coming soon.",
|
||||
"ending_name": "Devs"
|
||||
};
|
||||
// Dialogue that does not fit into any other category (e.g. tutorial messages, or the end of the game). For when the player character is female. For languages that do not have gendered pronouns, this can be set to PGMmiscDialogue.
|
||||
export const PGFmiscDialogue: SimpleTranslationEntries = PGMmiscDialogue;
|
||||
|
|
|
@ -2315,6 +2315,12 @@ export class BattleEndPhase extends BattlePhase {
|
|||
this.scene.gameData.gameStats.highestEndlessWave = this.scene.currentBattle.waveIndex + 1;
|
||||
}
|
||||
|
||||
// Endless graceful end
|
||||
if (this.scene.gameMode.isEndless && this.scene.currentBattle.waveIndex >= 5850) {
|
||||
this.scene.clearPhaseQueue();
|
||||
this.scene.unshiftPhase(new GameOverPhase(this.scene, true));
|
||||
}
|
||||
|
||||
for (const pokemon of this.scene.getField()) {
|
||||
if (pokemon) {
|
||||
pokemon.resetBattleSummonData();
|
||||
|
@ -3887,7 +3893,9 @@ export class GameOverPhase extends BattlePhase {
|
|||
this.victory = true;
|
||||
}
|
||||
|
||||
if (this.victory || !this.scene.enableRetries) {
|
||||
if (this.scene.gameMode.isEndless) {
|
||||
this.scene.ui.showDialogue(i18next.t("PGMmiscDialogue:ending_endless"), i18next.t("PGMmiscDialogue:ending_name"), 0, () => this.handleGameOver());
|
||||
} else if (this.victory || !this.scene.enableRetries) {
|
||||
this.handleGameOver();
|
||||
} else {
|
||||
this.scene.ui.showText("Would you like to retry from the start of the battle?", null, () => {
|
||||
|
|
Loading…
Reference in New Issue