mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Reverts move condition relying on turns, moves bypass check to after healed/activated is decided
This commit is contained in:
parent
f02e87a80b
commit
b1c64638e7
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user