Add isPartner method to trainer class

This commit is contained in:
Sirz Benjie 2025-04-10 10:42:35 -05:00
parent eef8367caf
commit ada0c53482
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
2 changed files with 8 additions and 1 deletions

View File

@ -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);
}
});

View File

@ -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;
}