From 516a10053dbd3e17f4bccbb50c0868445f707126 Mon Sep 17 00:00:00 2001 From: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:45:20 +0200 Subject: [PATCH] This should prevent gym leaders appear as doubles (marnie & piers) when they arent fixed battles (#2904) --- src/battle-scene.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c2c49971dd76..39442fc21dfa 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -67,6 +67,7 @@ import { Species } from "#enums/species"; import { UiTheme } from "#enums/ui-theme"; import { TimedEventManager } from "#app/timed-event-manager.js"; import i18next from "i18next"; +import {TrainerType} from "#enums/trainer-type"; export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1"; @@ -1046,6 +1047,10 @@ export default class BattleScene extends SceneBase { this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance); playerField.forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance)); doubleTrainer = !Utils.randSeedInt(doubleChance.value); + // 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 === TrainerType.TATE || trainerType === TrainerType.LIZA)) { + doubleTrainer = false; + } } newTrainer = trainerData !== undefined ? trainerData.toTrainer(this) : new Trainer(this, trainerType, doubleTrainer ? TrainerVariant.DOUBLE : Utils.randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT); this.field.add(newTrainer);