From b1c64638e798dec54d53d04dd7ed31b7e0a62d04 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Sat, 31 May 2025 09:38:31 -0400 Subject: [PATCH] Reverts move condition relying on turns, moves bypass check to after healed/activated is decided --- src/data/moves/move.ts | 2 +- src/phases/move-phase.ts | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 7b948225d0b..fb45809cd41 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -7934,7 +7934,7 @@ const failIfDampCondition: MoveConditionFunc = (user, target, move) => { return !cancelled.value; }; -const userSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => (user.status?.effect === StatusEffect.SLEEP && (user.status.sleepTurnsRemaining ?? 0) > 0) || user.hasAbility(Abilities.COMATOSE); +const userSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => user.status?.effect === StatusEffect.SLEEP || user.hasAbility(Abilities.COMATOSE); const targetSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => target.status?.effect === StatusEffect.SLEEP || target.hasAbility(Abilities.COMATOSE); diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index d7cbf1b9a6f..472c393d562 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -236,7 +236,6 @@ export class MovePhase extends BattlePhase { Overrides.STATUS_ACTIVATION_OVERRIDE !== false; break; case StatusEffect.SLEEP: { - applyMoveAttrs(BypassSleepAttr, this.pokemon, null, this.move.getMove()); const turnsRemaining = new NumberHolder(this.pokemon.status.sleepTurnsRemaining ?? 0); applyAbAttrs( ReduceStatusEffectDurationAbAttr, @@ -248,7 +247,7 @@ export class MovePhase extends BattlePhase { ); this.pokemon.status.sleepTurnsRemaining = turnsRemaining.value; healed = this.pokemon.status.sleepTurnsRemaining <= 0; - activated = !healed && !this.pokemon.getTag(BattlerTagType.BYPASS_SLEEP); + activated = !healed; break; } case StatusEffect.FREEZE: @@ -266,7 +265,14 @@ export class MovePhase extends BattlePhase { } if (activated) { - this.cancel(); + if (this.pokemon.status.effect === StatusEffect.SLEEP) { + applyMoveAttrs(BypassSleepAttr, this.pokemon, null, this.move.getMove()); + if (!this.pokemon.getTag(BattlerTagType.BYPASS_SLEEP)) { + this.cancel(); + } + } else { + this.cancel(); + } globalScene.queueMessage( getStatusEffectActivationText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon)), ); @@ -281,7 +287,7 @@ export class MovePhase extends BattlePhase { globalScene.queueMessage( getStatusEffectHealText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon)), ); - this.pokemon.resetStatus(); + this.pokemon.resetStatus(true, false, false, false); this.pokemon.updateInfo(); } }