diff --git a/js/client-battle.js b/js/client-battle.js index 7a71fb52e..13cd64573 100644 --- a/js/client-battle.js +++ b/js/client-battle.js @@ -304,7 +304,6 @@ var myActive = this.battle.mySide.active; var yourActive = this.battle.yourSide.active; var yourSlot = yourActive.length-1-pos; - var anyValidTarget = false; for (var i = yourActive.length-1; i >= 0; i--) { var pokemon = yourActive[i]; @@ -315,13 +314,11 @@ if (Math.abs(yourSlot-i) > 1) disabled = true; } - if (!pokemon) { - controls += ' '; - } else if (disabled || pokemon.zerohp) { - controls += ' '; + if (disabled) { + controls += ' '; + } else if (!pokemon || pokemon.zerohp) { + controls += ' '; } else { - anyValidTarget = true; - var posString = ''; controls += ' '; } } @@ -337,19 +334,14 @@ } if (moveTarget !== 'adjacentAllyOrSelf' && pos == i) disabled = true; - if (!pokemon) { - controls += ' '; - } else if (disabled || pokemon.zerohp) { - controls += ' '; + if (disabled) { + controls += ' '; + } else if (!pokemon || pokemon.zerohp) { + controls += ' '; } else { - anyValidTarget = true; controls += ' '; } } - if (!anyValidTarget) { - controls += '
'; - controls += ''; - } controls += '
'; controls += ''; this.$controls.html(controls); @@ -455,7 +447,7 @@ var pos = this.choice.choices.length - (type === 'movetarget'?1:0); // TODO? hpbar - controls += 'Which pokemon will it switch in for?'; + controls += 'Which Pokémon will it switch in for?'; controls += '
'; var myActive = this.battle.mySide.active; @@ -468,7 +460,6 @@ } else if (!pokemon) { controls += ' '; } else { - var posString = ''; controls += ' '; } } @@ -478,7 +469,7 @@ break; } if (this.choice.freedomDegrees >= 1) { - controls += 'Choose a Pokémon to sent to battle!
'; + controls += 'Choose a Pokémon to send to battle!'; } else { controls += 'Switch '+Tools.escapeHTML(switchables[pos].name)+' to:'; } @@ -527,7 +518,7 @@ controls += ''; } else { controls += ' What about the rest of your team?'; - controls += '
'; + controls += '
'; for (var i = 0; i < switchables.length; i++) { var pokemon = switchables[this.choice.teamPreview[i]-1]; if (i >= 6) { diff --git a/style/client.css b/style/client.css index 1a614d0f0..c449ad385 100644 --- a/style/client.css +++ b/style/client.css @@ -1585,6 +1585,7 @@ div[class^='tournament-message-'], div[class*=' tournament-message-'] { background: linear-gradient(top, #cfcfcf, #f2f2f2); } +.switchmenu button .disabled, .switchmenu button:disabled, .movemenu button:disabled { cursor: default;