From c84a19d6d4c54beb33d0be630b632672797a7abe Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:43:10 -0800 Subject: [PATCH] Moves `highestEndlessWave` and `battles` stats outside of victory condition --- src/phases/battle-end-phase.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/phases/battle-end-phase.ts b/src/phases/battle-end-phase.ts index eb6a112960e..8926a2211e0 100644 --- a/src/phases/battle-end-phase.ts +++ b/src/phases/battle-end-phase.ts @@ -17,16 +17,17 @@ export class BattleEndPhase extends BattlePhase { start() { super.start(); + this.scene.gameData.gameStats.battles++; + if (this.scene.gameMode.isEndless && this.scene.currentBattle.waveIndex + 1 > this.scene.gameData.gameStats.highestEndlessWave) { + this.scene.gameData.gameStats.highestEndlessWave = this.scene.currentBattle.waveIndex + 1; + } + if (this.isVictory) { this.scene.currentBattle.addBattleScore(this.scene); - this.scene.gameData.gameStats.battles++; if (this.scene.currentBattle.trainer) { this.scene.gameData.gameStats.trainersDefeated++; } - if (this.scene.gameMode.isEndless && this.scene.currentBattle.waveIndex + 1 > this.scene.gameData.gameStats.highestEndlessWave) { - this.scene.gameData.gameStats.highestEndlessWave = this.scene.currentBattle.waveIndex + 1; - } } // Endless graceful end