Merge pull request #549 from urkerab/tooltip-pokemon-fainted

Fix HP display for fainted Pokemon
This commit is contained in:
Guangcong Luo
2015-11-13 21:50:36 +00:00

View File

@@ -1122,10 +1122,14 @@
text += 'Types unknown';
}
text += '</h2>';
var exacthp = '';
if (pokemon.maxhp != 100 && pokemon.maxhp != 1000 && pokemon.maxhp != 48) exacthp = ' (' + pokemon.hp + '/' + pokemon.maxhp + ')';
if (pokemon.maxhp == 48 && isActive) exacthp = ' <small>(' + pokemon.hp + '/' + pokemon.maxhp + ' pixels)</small>';
text += '<p>HP: ' + pokemon.hpDisplay() + exacthp + (pokemon.status ? ' <span class="status ' + pokemon.status + '">' + pokemon.status.toUpperCase() + '</span>' : '') + '</p>';
if (pokemon.fainted) {
text += '<p>HP: (fainted)</p>';
} else {
var exacthp = '';
if (pokemon.maxhp != 100 && pokemon.maxhp != 1000 && pokemon.maxhp != 48) exacthp = ' (' + pokemon.hp + '/' + pokemon.maxhp + ')';
if (pokemon.maxhp == 48 && isActive) exacthp = ' <small>(' + pokemon.hp + '/' + pokemon.maxhp + ' pixels)</small>';
text += '<p>HP: ' + pokemon.hpDisplay() + exacthp + (pokemon.status ? ' <span class="status ' + pokemon.status + '">' + pokemon.status.toUpperCase() + '</span>' : '') + '</p>';
}
if (myPokemon) {
if (this.battle.gen > 2) {
text += '<p>Ability: ' + Tools.getAbility(myPokemon.baseAbility).name;