From 4f9eebda13fd0be4bec1f454b9931958d85ce7df Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 26 Mar 2024 21:40:10 -0400 Subject: [PATCH] Fix daily level cap changing mid biome --- src/battle-scene.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index d47f4537b..e5bb31e38 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1193,8 +1193,9 @@ export default class BattleScene extends Phaser.Scene { getMaxExpLevel(ignoreLevelCap?: boolean): integer { if (ignoreLevelCap) return Number.MAX_SAFE_INTEGER; - const lastWaveIndex = Math.ceil((this.gameMode.getWaveForDifficulty(this.currentBattle?.waveIndex || 1)) / 10) * 10; - const baseLevel = (1 + lastWaveIndex / 2 + Math.pow(lastWaveIndex / 25, 2)) * 1.2; + const waveIndex = Math.ceil((this.currentBattle?.waveIndex || 1) / 10) * 10; + const difficultyWaveIndex = this.gameMode.getWaveForDifficulty(waveIndex); + const baseLevel = (1 + difficultyWaveIndex / 2 + Math.pow(difficultyWaveIndex / 25, 2)) * 1.2; return Math.ceil(baseLevel / 2) * 2 + 2; }