pokemon-showdown/mods/gen3/scripts.js
Ivo Julca 244f1700a0 Set old moves' categories on Gen 3 data load
This is only performed for Gen 3, as the data is passed down to older gens.
2014-02-14 18:47:20 -05:00

19 lines
588 B
JavaScript

exports.BattleScripts = {
inherit: 'gen5',
gen: 3,
init: function() {
for (var i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
var specialTypes = {Fire:1, Water:1, Grass:1, Ice:1, Electric:1, Dark:1, Psychic:1, Dragon:1};
var newCategory = '';
for (var i in this.data.Movedex) {
if (this.data.Movedex[i].category === 'Status') continue;
newCategory = specialTypes[this.data.Movedex[i].type]? 'Special' : 'Physical';
if (newCategory !== this.data.Movedex[i].category) {
this.modData('Movedex', i).category = newCategory;
}
}
}
};