From 52cf46b8bd8908714084ba9096d5fdb2ae01eba3 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Wed, 6 Jan 2016 18:47:34 -0500 Subject: [PATCH] Fix move types in past gen tooltips/teambuilder Specifically, this affects Bite, Charm, Moonlight, and Sweet Kiss. --- js/client-battle-tooltips.js | 6 ++++++ js/search.js | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/client-battle-tooltips.js b/js/client-battle-tooltips.js index 690a730d5..df5502a44 100644 --- a/js/client-battle-tooltips.js +++ b/js/client-battle-tooltips.js @@ -448,6 +448,12 @@ var BattleTooltips = (function () { if (ability === 'Normalize') { moveType = 'Normal'; } + if (move.id === 'bite' && this.battle.gen <= 1) { + moveType = 'Normal'; + } + if ((move.id === 'charm' || move.id === 'moonlight' || move.id === 'sweetkiss') && this.battle.gen <= 5) { + moveType = 'Normal'; + } // Moves that require an item to change their type. if (!this.battle.hasPseudoWeather('Magic Room') && (!pokemon.volatiles || !pokemon.volatiles['embargo'])) { if (move.id === 'judgment') { diff --git a/js/search.js b/js/search.js index 0c04d048c..2f8ff022b 100644 --- a/js/search.js +++ b/js/search.js @@ -1159,10 +1159,13 @@ // type buf += ''; - buf += Tools.getTypeIcon(move.type); + var type = move.type; + if (this.gen <= 1 && id === 'bite') type = 'Normal'; + if (this.gen <= 5 && (id === 'charm' || id === 'moonlight' || id === 'sweetkiss')) type = 'Normal'; + buf += Tools.getTypeIcon(type); var category = move.category; if (this.gen <= 3 && move.category !== 'Status') { - category = (move.type in {Fire:1, Water:1, Grass:1, Electric:1, Ice:1, Psychic:1, Dark:1, Dragon:1} ? 'Special' : 'Physical'); + category = (type in {Fire:1, Water:1, Grass:1, Electric:1, Ice:1, Psychic:1, Dark:1, Dragon:1} ? 'Special' : 'Physical'); } buf += '' + category + ''; buf += ' ';