showdown-calc-cli
Version:
Quick and easy pokemon damage calulations in your terminal
21 lines (20 loc) • 770 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.calcDamage = void 0;
const calc_1 = require("@smogon/calc");
const calcDamage = (attacker, defender, gen, battleCondition) => {
return (0, calc_1.calculate)(gen, new calc_1.Pokemon(gen, attacker.name, {
nature: attacker.nature,
item: attacker.item,
ability: attacker.ability,
evs: attacker.evs,
boosts: attacker.boosts
}), new calc_1.Pokemon(gen, defender.name, {
nature: defender.nature,
item: defender.item,
ability: defender.ability,
evs: defender.evs,
boosts: defender.boosts
}), new calc_1.Move(gen, attacker.move), new calc_1.Field(battleCondition));
};
exports.calcDamage = calcDamage;