Skip to content

Commit 1e52922

Browse files
committed
Tooltips: Add RBY Recover failure indicator
1 parent d4e9642 commit 1e52922

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/battle-tooltips.ts

+17
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,23 @@ class BattleTooltips {
742742
if (move.flags.bullet) {
743743
text += `<p class="movetag">&#x2713; Bullet-like <small>(doesn't affect Bulletproof pokemon)</small></p>`;
744744
}
745+
746+
// RBY healing move glitch
747+
if (this.battle.gen === 1 && !toID(this.battle.tier).includes('stadium') &&
748+
['recover', 'softboiled', 'rest'].includes(move.id)) {
749+
const hpValues = [];
750+
let hp = serverPokemon.maxhp - 255;
751+
while (hp > 0) {
752+
hpValues.push(hp);
753+
if (hpValues.length >= 5) {
754+
// Reasonable cutoff for custom games
755+
hpValues.push('...');
756+
break;
757+
}
758+
hp -= 256;
759+
}
760+
text += `<p>Will fail if HP is ${hpValues.join(', ')}</p>`;
761+
}
745762
}
746763
return text;
747764
}

0 commit comments

Comments
 (0)