Skip to content

Commit

Permalink
Gen I: Add HP hint for Rest (smogon#6701)
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilaBorowska authored May 16, 2020
1 parent 78a2965 commit b0f0cb2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions data/mods/gen1/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b0f0cb2

Please sign in to comment.