From 8c5f61ff38c1fa4941ae8fb52940f3a52e48bf96 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:45:34 -0700 Subject: [PATCH] Replace duplicate code with `getDoubleBattleChance()` --- src/battle-scene.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c6fff1e209a..c9aae1ac9d0 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1191,10 +1191,7 @@ export default class BattleScene extends SceneBase { if (trainerConfigs[trainerType].doubleOnly) { doubleTrainer = true; } else if (trainerConfigs[trainerType].hasDouble) { - const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8); - this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance); - playerField.forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, false, doubleChance)); - doubleTrainer = !Utils.randSeedInt(doubleChance.value); + doubleTrainer = !Utils.randSeedInt(this.getDoubleBattleChance(newWaveIndex, playerField)); // Add a check that special trainers can't be double except for tate and liza - they should use the normal double chance if (trainerConfigs[trainerType].trainerTypeDouble && ![ TrainerType.TATE, TrainerType.LIZA ].includes(trainerType)) { doubleTrainer = false;