From c5f52692f662ac6a02c055d1a6d438de8dbd76e0 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 26 Mar 2024 13:11:59 -0400 Subject: [PATCH] Rest fails at full HP --- src/data/move.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 5fa6afd6c6a..8ba9ba946a5 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -819,7 +819,7 @@ export class StatusEffectAttr extends MoveEffectAttr { return false; } 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; } @@ -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) .attr(StatusEffectAttr, StatusEffect.SLEEP, true, 3, 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) .attr(FlinchAttr) .makesContact(false)