diff --git a/play.pokemonshowdown.com/src/battle-animations.ts b/play.pokemonshowdown.com/src/battle-animations.ts index 7d5b959317..d7d340bbec 100644 --- a/play.pokemonshowdown.com/src/battle-animations.ts +++ b/play.pokemonshowdown.com/src/battle-animations.ts @@ -2862,7 +2862,7 @@ export class PokemonSprite extends Sprite { if (pokemon.maxhp === 48 || this.scene.battle.hardcoreMode && pokemon.maxhp === 100) { $hptext.hide(); $hptextborder.hide(); - } else if (this.scene.battle.hardcoreMode) { + } else if (this.scene.battle.hardcoreMode || this.scene.battle.reportExactHP) { $hptext.html(pokemon.hp + '/'); $hptext.show(); $hptextborder.show(); diff --git a/play.pokemonshowdown.com/src/battle-tooltips.ts b/play.pokemonshowdown.com/src/battle-tooltips.ts index ebeb171361..814a500751 100644 --- a/play.pokemonshowdown.com/src/battle-tooltips.ts +++ b/play.pokemonshowdown.com/src/battle-tooltips.ts @@ -843,7 +843,7 @@ class BattleTooltips { } else if (pokemon.maxhp === 48) { exacthp = ' (' + pokemon.hp + '/' + pokemon.maxhp + ' pixels)'; } - text += '
HP: ' + Pokemon.getHPText(pokemon) + exacthp + (pokemon.status ? ' ' + pokemon.status.toUpperCase() + '' : ''); + text += '
HP: ' + Pokemon.getHPText(pokemon, this.battle.reportExactHP) + exacthp + (pokemon.status ? ' ' + pokemon.status.toUpperCase() + '' : ''); if (clientPokemon) { if (pokemon.status === 'tox') { if (pokemon.ability === 'Poison Heal' || pokemon.ability === 'Magic Guard') { diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index a5595832f1..0195b31eeb 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -582,9 +582,10 @@ export class Pokemon implements PokemonDetails, PokemonHealth { return percentage * maxWidth / 100; } getHPText(precision = 1) { - return Pokemon.getHPText(this, precision); + return Pokemon.getHPText(this, this.side.battle.reportExactHP, precision); } - static getHPText(pokemon: PokemonHealth, precision = 1) { + static getHPText(pokemon: PokemonHealth, exactHP: boolean, precision = 1) { + if (exactHP) return pokemon.hp + '/' + pokemon.maxhp; if (pokemon.maxhp === 100) return pokemon.hp + '%'; if (pokemon.maxhp !== 48) return (100 * pokemon.hp / pokemon.maxhp).toFixed(precision) + '%'; let range = Pokemon.getPixelRange(pokemon.hp, pokemon.hpcolor); @@ -1097,6 +1098,7 @@ export class Battle { rated: string | boolean = false; rules: {[ruleName: string]: 1 | 0} = {}; isBlitz = false; + reportExactHP = false; endLastTurnPending = false; totalTimeLeft = 0; graceTimeLeft = 0; @@ -3442,6 +3444,7 @@ export class Battle { this.messageFadeTime = 40; this.isBlitz = true; } + if (ruleName === 'Exact HP Mod') this.reportExactHP = true; this.rules[ruleName] = 1; this.log(args); break;