Rest fails at full HP

pull/18/head
Flashfyre 2024-03-26 13:11:59 -04:00
parent aee5f32bc3
commit c5f52692f6
1 changed files with 2 additions and 2 deletions

View File

@ -819,7 +819,7 @@ export class StatusEffectAttr extends MoveEffectAttr {
return false; return false;
} }
if (!pokemon.status || (pokemon.status.effect === this.effect && move.chance < 0)) if (!pokemon.status || (pokemon.status.effect === this.effect && move.chance < 0))
return pokemon.trySetStatus(this.effect, true); return pokemon.trySetStatus(this.effect, true, this.cureTurn);
} }
return false; return false;
} }
@ -2995,7 +2995,7 @@ export function initMoves() {
new SelfStatusMove(Moves.REST, "Rest", Type.PSYCHIC, -1, 5, "The user goes to sleep for two turns. This fully restores the user's HP and heals any status conditions.", -1, 0, 1) new SelfStatusMove(Moves.REST, "Rest", Type.PSYCHIC, -1, 5, "The user goes to sleep for two turns. This fully restores the user's HP and heals any status conditions.", -1, 0, 1)
.attr(StatusEffectAttr, StatusEffect.SLEEP, true, 3, true) .attr(StatusEffectAttr, StatusEffect.SLEEP, true, 3, true)
.attr(HealAttr, 1, true) .attr(HealAttr, 1, true)
.condition((user, target, move) => user.status?.effect !== StatusEffect.SLEEP), .condition((user, target, move) => user.status?.effect !== StatusEffect.SLEEP && user.getHpRatio() < 1),
new AttackMove(Moves.ROCK_SLIDE, "Rock Slide", Type.ROCK, MoveCategory.PHYSICAL, 75, 90, 10, "Large boulders are hurled at opposing Pokémon to inflict damage. This may also make the opposing Pokémon flinch.", 30, 0, 1) new AttackMove(Moves.ROCK_SLIDE, "Rock Slide", Type.ROCK, MoveCategory.PHYSICAL, 75, 90, 10, "Large boulders are hurled at opposing Pokémon to inflict damage. This may also make the opposing Pokémon flinch.", 30, 0, 1)
.attr(FlinchAttr) .attr(FlinchAttr)
.makesContact(false) .makesContact(false)