borderlands2
Version:
Borderlands 2 weapon damage and DPS calculation library
30 lines • 960 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var uuid_1 = require("uuid");
var stat_1 = require("../../build/interface/stat");
/**
* Represents COMs, Relics, and any other gear that contains stats
*
* Gear will have certain limitations, like the type of weapon that is affected
*/
var Gear = /** @class */ (function () {
function Gear(type, stats, decorator, redText) {
this.id = uuid_1.v4();
this.type = type;
this.stats = stats;
this.decorator = decorator;
this.redText = redText;
}
Gear.prototype.getStat = function (statType, weapon, context) {
if (this.decorator && !this.decorator(weapon, context)) {
return 0;
}
var stat = stat_1.getStat(statType, this.stats, weapon, context);
if (!stat)
return 0;
return stat.value;
};
return Gear;
}());
exports.Gear = Gear;
//# sourceMappingURL=gear.js.map
;