pokemon-showdown/mods/gen5/scripts.js
Joimer c2eefe12b9 Gen 5: Add init script
The init script will set the battle generation to 5 and delete mod the
Learnsets so no moves from gen 6 are used.
2013-10-11 09:59:27 +02:00

17 lines
477 B
JavaScript

exports.BattleScripts = {
gen: 5,
init: function () {
for (var i in this.data.Learnsets) {
this.modData('Learnsets', i);
var learnset = this.data.Learnsets[i].learnset;
for (var moveid in learnset) {
if (typeof learnset[moveid] === 'string') learnset[moveid] = [learnset[moveid]];
learnset[moveid] = learnset[moveid].filter(function(source) {
return source[0] !== '6';
});
if (!learnset[moveid].length) delete learnset[moveid];
}
}
}
};