From f428fd114c9daa6a688b8e6258f70dbbb1ca786d Mon Sep 17 00:00:00 2001 From: snoozbuster Date: Fri, 2 Aug 2024 19:06:40 -0700 Subject: [PATCH] add override for forcing switches --- src/field/trainer.ts | 5 +++++ src/overrides.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 1348749d964..4147cd3af24 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -21,6 +21,7 @@ import i18next from "i18next"; import { PartyMemberStrength } from "#enums/party-member-strength"; import { Species } from "#enums/species"; import { TrainerType } from "#enums/trainer-type"; +import Overrides from "#app/overrides"; export enum TrainerVariant { DEFAULT, @@ -429,6 +430,10 @@ export default class Trainer extends Phaser.GameObjects.Container { } getPartyMemberMatchupScores(trainerSlot: TrainerSlot = TrainerSlot.NONE, forSwitch: boolean = false): [integer, integer][] { + if (Overrides.TRAINER_ALWAYS_SWITCHES) { + return [[1, 100], [1, 100]]; + } + if (trainerSlot && !this.isDouble()) { trainerSlot = TrainerSlot.NONE; } diff --git a/src/overrides.ts b/src/overrides.ts index 8b3d628e05e..c100c7b3892 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -116,6 +116,11 @@ class DefaultOverrides { readonly OPP_VARIANT_OVERRIDE: Variant = 0; readonly OPP_IVS_OVERRIDE: integer | integer[] = []; + // -------------------------- + // TRAINER/AI OVERRIDES + // -------------------------- + readonly TRAINER_ALWAYS_SWITCHES: boolean = false; + // ------------- // EGG OVERRIDES // -------------