mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 05:12:19 +02:00
Add isPartner method to trainer class
This commit is contained in:
parent
eef8367caf
commit
ada0c53482
@ -6297,7 +6297,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||||||
// Find indices of off-field Pokemon that are eligible to be switched into
|
// Find indices of off-field Pokemon that are eligible to be switched into
|
||||||
const eligibleNewIndices: number[] = [];
|
const eligibleNewIndices: number[] = [];
|
||||||
globalScene.getEnemyParty().forEach((pokemon, index) => {
|
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);
|
eligibleNewIndices.push(index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -223,6 +223,13 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
|||||||
return this.config.doubleOnly || this.variant === TrainerVariant.DOUBLE;
|
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 {
|
getMixedBattleBgm(): string {
|
||||||
return this.config.mixedBattleBgm;
|
return this.config.mixedBattleBgm;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user