Added condition to require that mon is on field in order to apply ability, accounting for exceptions

This commit is contained in:
Wlowscha 2024-12-27 11:37:13 +01:00
parent 796886790e
commit 851bb7e544
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
1 changed files with 1 additions and 1 deletions

View File

@ -1479,7 +1479,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return false;
}
}
return (this.hp > 0 || ability.isBypassFaint) && !ability.conditions.find(condition => !condition(this));
return (((this.isOnField() || ability.isBypassOnField) && this.hp > 0) || ability.isBypassFaint) && !ability.conditions.find(condition => !condition(this));
}
/**