From ada0c53482edf1cf2bc0a3a95ef35682ddbb00e0 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Thu, 10 Apr 2025 10:42:35 -0500 Subject: [PATCH] Add isPartner method to trainer class --- src/data/moves/move.ts | 2 +- src/field/trainer.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index c2dd0ec31ca..c75d7c91a58 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -6297,7 +6297,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr { // Find indices of off-field Pokemon that are eligible to be switched into const eligibleNewIndices: number[] = []; globalScene.getEnemyParty().forEach((pokemon, index) => { - if (pokemon.isAllowedInBattle() && !pokemon.isOnField()) { + if (pokemon.isAllowedInBattle() && !pokemon.isOnField() && (pokemon as EnemyPokemon).trainerSlot === (switchOutTarget as EnemyPokemon).trainerSlot) { eligibleNewIndices.push(index); } }); diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 30cf43b54a1..1679e6f12e0 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -223,6 +223,13 @@ export default class Trainer extends Phaser.GameObjects.Container { return this.config.doubleOnly || this.variant === TrainerVariant.DOUBLE; } + /** + * Return whether the trainer is a duo, like Tate & Liza + */ + isPartner(): boolean { + return this.variant === TrainerVariant.DOUBLE; + } + getMixedBattleBgm(): string { return this.config.mixedBattleBgm; }