From b0f0cb28a8a4a9c3c87bcf8ef292e460b742a077 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sat, 16 May 2020 17:34:22 +0200 Subject: [PATCH] Gen I: Add HP hint for Rest (#6701) --- data/mods/gen1/moves.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/data/mods/gen1/moves.ts b/data/mods/gen1/moves.ts index c5996e121442..964b5b0e3961 100644 --- a/data/mods/gen1/moves.ts +++ b/data/mods/gen1/moves.ts @@ -769,11 +769,12 @@ export const BattleMovedex: {[k: string]: ModdedMoveData} = { desc: "The user falls asleep for the next two turns and restores all of its HP, curing itself of any major status condition in the process. This does not remove the user's stat penalty for burn or paralysis. Fails if the user has full HP.", onTryMove() {}, onHit(target, source, move) { - // Fails if the difference between - // max HP and current HP is 0, 255, or 511 - if (target.hp >= target.maxhp || - target.hp === (target.maxhp - 255) || - target.hp === (target.maxhp - 511)) return false; + if (target.hp === target.maxhp) return false; + // Fail when health is 255 or 511 less than max + if (target.hp === (target.maxhp - 255) || target.hp === (target.maxhp - 511)) { + this.hint("In Gen 1, recovery moves fail if (user's maximum HP - user's current HP + 1) is divisible by 256."); + return false; + } if (!target.setStatus('slp', source, move)) return false; target.statusData.time = 2; target.statusData.startTime = 2;