From 14a76f70cfe32bf150fc2e343345a6348caf71e2 Mon Sep 17 00:00:00 2001 From: urkerab Date: Fri, 18 Sep 2015 17:11:02 +0100 Subject: [PATCH] Only show item and ability when really known --- js/client-battle.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/client-battle.js b/js/client-battle.js index 6e9759532..4a98b4ab2 100644 --- a/js/client-battle.js +++ b/js/client-battle.js @@ -1009,7 +1009,7 @@ if (!pokemon) { pokemon = this.myPokemon[parseInt(thing)]; battlePokemon = this.battle.getPokemon('other: old: ' + pokemon.ident, pokemon.details); - } else if (pokemon.side === this.battle.mySide) { + } else if (this.controlsShown && pokemon.side === this.battle.mySide) { myPokemon = this.myPokemon[pokemon.slot]; } } @@ -1052,11 +1052,15 @@ if (pokemon.maxhp == 48 && isActive) exacthp = ' (' + pokemon.hp + '/' + pokemon.maxhp + ' pixels)'; text += '

HP: ' + pokemon.hpDisplay() + exacthp + (pokemon.status ? ' ' + pokemon.status.toUpperCase() + '' : '') + '

'; if (myPokemon) { - text += '

'; if (this.battle.gen > 2) { - text += 'Ability: ' + Tools.getAbility(pokemon.ability || myPokemon.baseAbility).name + ' / '; + text += '

Ability: ' + Tools.getAbility(myPokemon.baseAbility).name; + if (myPokemon.item) { + text += ' / Item: ' + Tools.getItem(myPokemon.item).name; + } + text += '

'; + } else if (myPokemon.item) { + text += '

/ Item: ' + Tools.getItem(myPokemon.item).name + '

'; } - text += 'Item: ' + Tools.getItem(myPokemon.item).name + '

'; text += '

' + myPokemon.stats['atk'] + ' Atk / ' + myPokemon.stats['def'] + ' Def / ' + myPokemon.stats['spa']; if (this.battle.gen === 1) { text += ' Spc / ';