alter-egoism/js/plugins/CBR_battleSystem.js
2025-11-01 14:17:42 -05:00

16 lines
534 B
JavaScript

(function () {
Game_Action.prototype.evalDamageFormula = function (target) {
try {
const item = this.item();
const a = this.subject(); // eslint-disable-line no-unused-vars
const b = target; // eslint-disable-line no-unused-vars
const v = $gameVariables._data; // eslint-disable-line no-unused-vars
const sign = [3, 4].includes(item.damage.type) ? -1 : 1;
const value = Math.max(eval(item.damage.formula), 0) * sign;
return isNaN(value) ? 0 : value;
} catch (e) {
return 0;
}
};
})();