borderlands2
Version:
Borderlands 2 weapon damage and DPS calculation library
30 lines • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Skill = /** @class */ (function () {
function Skill(level) {
this.level = level;
}
Skill.prototype.getStat = function (statType, weapon, context) {
var stat = this.stats.find(function (stat) { return stat.type === statType; });
if (!stat)
return 0;
return stat.value * this.level * this.getEffectiveness(context);
};
Skill.prototype.getEffectiveness = function (context) {
var _this = this;
var _a;
if (!this.effectType)
return 1;
var effect = (_a = context.effects) === null || _a === void 0 ? void 0 : _a.find(function (effect) { return effect.getEffectType() === _this.effectType; });
if (effect) {
return effect.multiplier.getValue();
}
return 0;
};
Skill.prototype.getEffectType = function () {
return this.effectType;
};
return Skill;
}());
exports.Skill = Skill;
//# sourceMappingURL=skill.js.map