pokemon-showdown/mods/gen3/scripts.js
mizdra f262d02c42 Fix recoil in Gen 3-4 (#2461)
* Fix the 1/3 recoil moves in Gen 3-4
* Fix rounding recoil in Gen 3-4
2016-04-18 16:26:54 -04:00

25 lines
752 B
JavaScript

'use strict';
exports.BattleScripts = {
inherit: 'gen5',
gen: 3,
init: function () {
for (let i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
let specialTypes = {Fire:1, Water:1, Grass:1, Ice:1, Electric:1, Dark:1, Psychic:1, Dragon:1};
let newCategory = '';
for (let 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;
}
}
},
calcRecoilDamage: function (damageDealt, move) {
return this.clampIntRange(Math.floor(damageDealt * move.recoil[0] / move.recoil[1]), 1);
},
};