Fixed a bug where a yawned target in a semi-vulnerable state would be stuck in that state (#396)

pull/478/head
Ivan Perez 2024-05-04 22:35:47 -07:00 committed by GitHub
parent 7cdf07c050
commit 3a218eb92b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -1904,6 +1904,21 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
applyAbAttrs(ReduceStatusEffectDurationAbAttr, this, null, effect, statusCureTurn);
this.setFrameRate(4);
// If the user is invulnerable, lets remove their invulnerability when they fall asleep
const invulnerableTags = [
BattlerTagType.UNDERGROUND,
BattlerTagType.UNDERWATER,
BattlerTagType.HIDDEN,
BattlerTagType.FLYING
];
const tag = invulnerableTags.find((t) => this.getTag(t));
if (tag) {
this.removeTag(tag);
this.getMoveQueue().pop();
}
}
this.status = new Status(effect, 0, statusCureTurn?.value);