pokemon-showdown/mods/gen3/scripts.js

26 lines
807 B
JavaScript

'use strict';
exports.BattleScripts = {
inherit: 'gen4',
gen: 3,
init: function () {
for (let i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
let specialTypes = ['Fire', 'Water', 'Grass', 'Ice', 'Electric', 'Dark', 'Psychic', 'Dragon'];
let newCategory = '';
for (let i in this.data.Movedex) {
if (!this.data.Movedex[i]) console.log(i);
if (this.data.Movedex[i].category === 'Status') continue;
newCategory = specialTypes.includes(this.data.Movedex[i].type) ? 'Special' : 'Physical';
if (newCategory !== this.data.Movedex[i].category) {
this.modData('Movedex', i).category = newCategory;
}
}
},
calcRecoilDamage: function (damageDealt, move) {
return this.clampIntRange(Math.floor(damageDealt * move.recoil[0] / move.recoil[1]), 1);
},
};