mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-27 09:16:03 +00:00
add Pokemon.isAllowed()
to check if pokemon is allowed even if it's fainted
This commit is contained in:
parent
d8fce8b245
commit
72c76c4d39
@ -276,7 +276,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
isAllowedInBattle(): boolean {
|
||||
const challengeAllowed = new Utils.BooleanHolder(true);
|
||||
applyChallenges(this.scene.gameMode, ChallengeType.POKEMON_IN_BATTLE, this, challengeAllowed);
|
||||
return !this.isFainted() && challengeAllowed.value;
|
||||
return !this.isFainted() && this.isAllowed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this pokemon is allowed (no challenge exclusion)
|
||||
* This is frequently a better alternative to {@link isFainted}
|
||||
* @returns {boolean} True if pokemon is allowed in battle
|
||||
*/
|
||||
isAllowed(): boolean {
|
||||
const challengeAllowed = new Utils.BooleanHolder(true);
|
||||
applyChallenges(this.scene.gameMode, ChallengeType.POKEMON_IN_BATTLE, this, challengeAllowed);
|
||||
return challengeAllowed.value;
|
||||
}
|
||||
|
||||
isActive(onField?: boolean): boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user