Reverts move condition relying on turns, moves bypass check to after healed/activated is decided

This commit is contained in:
Christopher Schmidt 2025-05-31 09:38:31 -04:00
parent f02e87a80b
commit b1c64638e7
2 changed files with 11 additions and 5 deletions

View File

@ -7934,7 +7934,7 @@ const failIfDampCondition: MoveConditionFunc = (user, target, move) => {
return !cancelled.value; 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); const targetSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => target.status?.effect === StatusEffect.SLEEP || target.hasAbility(Abilities.COMATOSE);

View File

@ -236,7 +236,6 @@ export class MovePhase extends BattlePhase {
Overrides.STATUS_ACTIVATION_OVERRIDE !== false; Overrides.STATUS_ACTIVATION_OVERRIDE !== false;
break; break;
case StatusEffect.SLEEP: { case StatusEffect.SLEEP: {
applyMoveAttrs(BypassSleepAttr, this.pokemon, null, this.move.getMove());
const turnsRemaining = new NumberHolder(this.pokemon.status.sleepTurnsRemaining ?? 0); const turnsRemaining = new NumberHolder(this.pokemon.status.sleepTurnsRemaining ?? 0);
applyAbAttrs( applyAbAttrs(
ReduceStatusEffectDurationAbAttr, ReduceStatusEffectDurationAbAttr,
@ -248,7 +247,7 @@ export class MovePhase extends BattlePhase {
); );
this.pokemon.status.sleepTurnsRemaining = turnsRemaining.value; this.pokemon.status.sleepTurnsRemaining = turnsRemaining.value;
healed = this.pokemon.status.sleepTurnsRemaining <= 0; healed = this.pokemon.status.sleepTurnsRemaining <= 0;
activated = !healed && !this.pokemon.getTag(BattlerTagType.BYPASS_SLEEP); activated = !healed;
break; break;
} }
case StatusEffect.FREEZE: case StatusEffect.FREEZE:
@ -266,7 +265,14 @@ export class MovePhase extends BattlePhase {
} }
if (activated) { 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( globalScene.queueMessage(
getStatusEffectActivationText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon)), getStatusEffectActivationText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon)),
); );
@ -281,7 +287,7 @@ export class MovePhase extends BattlePhase {
globalScene.queueMessage( globalScene.queueMessage(
getStatusEffectHealText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon)), getStatusEffectHealText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon)),
); );
this.pokemon.resetStatus(); this.pokemon.resetStatus(true, false, false, false);
this.pokemon.updateInfo(); this.pokemon.updateInfo();
} }
} }