From bc64f26b58cc23992cc15132af0bcd03b9dc14f7 Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Mon, 7 Apr 2025 19:24:19 -0400 Subject: [PATCH] Simplify to switch case Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/phases/victory-phase.ts | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index ccd7a28e0ac..9f4412fe270 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -55,21 +55,18 @@ export class VictoryPhase extends PokemonPhase { if (globalScene.gameMode.isEndless || !globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)) { globalScene.pushPhase(new EggLapsePhase()); if (globalScene.gameMode.isClassic) { - if (globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.RIVAL_1) { - // Get event modifiers for this wave - timedEventManager - .getFixedBattleEventRewards(ClassicFixedBossWaves.RIVAL_1) - .map(r => globalScene.pushPhase(new ModifierRewardPhase(modifierTypes[r]))); - } - if (globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.RIVAL_2) { - // Get event modifiers for this wave - timedEventManager - .getFixedBattleEventRewards(ClassicFixedBossWaves.RIVAL_2) - .map(r => globalScene.pushPhase(new ModifierRewardPhase(modifierTypes[r]))); - } - if (globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.EVIL_BOSS_2) { - // Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop - globalScene.pushPhase(new ModifierRewardPhase(modifierTypes.LOCK_CAPSULE)); + switch (globalScene.currentBattle.waveIndex) { + case ClassicFixedBossWaves.RIVAL_1: + case ClassicFixedBossWaves.RIVAL_2: + // Get event modifiers for this wave + timedEventManager + .getFixedBattleEventRewards(globalScene.currentBattle.waveIndex) + .map(r => globalScene.pushPhase(new ModifierRewardPhase(modifierTypes[r]))); + break; + case ClassicFixedBossWaves.EVIL_BOSS_2: + // Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop + globalScene.pushPhase(new ModifierRewardPhase(modifierTypes.LOCK_CAPSULE)); + break; } } if (globalScene.currentBattle.waveIndex % 10) {