[Bug] Fix multi-hit moves persisting after sleep/freeze (#2712)

This commit is contained in:
innerthunder 2024-06-29 14:30:10 -07:00 committed by GitHub
parent 6cba5acfd0
commit d278df8fef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2545,6 +2545,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return false; return false;
} }
/**
* If this Pokemon falls asleep or freezes in the middle of a multi-hit attack,
* cancel the attack's subsequent hits.
*/
if (effect === StatusEffect.SLEEP || effect === StatusEffect.FREEZE) {
this.stopMultiHit();
}
if (asPhase) { if (asPhase) {
this.scene.unshiftPhase(new ObtainStatusEffectPhase(this.scene, this.getBattlerIndex(), effect, cureTurn, sourceText, sourcePokemon)); this.scene.unshiftPhase(new ObtainStatusEffectPhase(this.scene, this.getBattlerIndex(), effect, cureTurn, sourceText, sourcePokemon));
return true; return true;