Fix move types in past gen tooltips/teambuilder

Specifically, this affects Bite, Charm, Moonlight, and Sweet Kiss.
This commit is contained in:
Guangcong Luo 2016-01-06 18:47:34 -05:00
parent f17ae9a437
commit 52cf46b8bd
2 changed files with 11 additions and 2 deletions

View File

@ -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') {

View File

@ -1159,10 +1159,13 @@
// type
buf += '<span class="col typecol">';
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 += '<img src="' + Tools.resourcePrefix + 'sprites/categories/' + category + '.png" alt="' + category + '" height="14" width="32" />';
buf += '</span> ';