Fix logic to prevent the first battle being a double

This commit is contained in:
Flashfyre 2023-07-04 20:07:05 -04:00
parent 10b49b5dcb
commit 46b32976ff

View File

@ -514,13 +514,13 @@ export default class BattleScene extends Phaser.Scene {
let newWaveIndex = waveIndex || ((this.currentBattle?.waveIndex || (startingWave - 1)) + 1); let newWaveIndex = waveIndex || ((this.currentBattle?.waveIndex || (startingWave - 1)) + 1);
let newDouble: boolean; let newDouble: boolean;
if (double === undefined) { if (double === undefined && newWaveIndex > 1) {
const doubleChance = newWaveIndex > 1 && new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8); const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8);
this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance); this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance);
this.getPlayerField().forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance)); this.getPlayerField().forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance));
newDouble = !Utils.randInt(doubleChance.value); newDouble = !Utils.randInt(doubleChance.value);
} else } else
newDouble = double; newDouble = !!double;
const lastBattle = this.currentBattle; const lastBattle = this.currentBattle;