UNPKG

borderlands2

Version:

Borderlands 2 weapon damage and DPS calculation library

262 lines 9.2 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var skill_1 = require("../skill"); var stat_type_1 = require("../../value_object/stat_type"); var type_1 = require("../../../weapon/value_object/type"); var effect_1 = require("../../../effect"); // Geurilla var Ready = /** @class */ (function (_super) { __extends(Ready, _super); function Ready() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Ready'; _this.stats = [{ type: stat_type_1.StatType.ReloadSpeed, value: 0.08 }]; return _this; } return Ready; }(skill_1.Skill)); exports.Ready = Ready; var Onslaught = /** @class */ (function (_super) { __extends(Onslaught, _super); function Onslaught() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Onslaught'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.06 }]; _this.effectType = effect_1.EffectType.Onslaught; return _this; } return Onslaught; }(skill_1.Skill)); exports.Onslaught = Onslaught; var CrisisManagement = /** @class */ (function (_super) { __extends(CrisisManagement, _super); function CrisisManagement() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Crisis Management'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.07 }]; return _this; } return CrisisManagement; }(skill_1.Skill)); exports.CrisisManagement = CrisisManagement; // Gunpowder var Impact = /** @class */ (function (_super) { __extends(Impact, _super); function Impact() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Impact'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.04 }]; return _this; } return Impact; }(skill_1.Skill)); exports.Impact = Impact; var Overload = /** @class */ (function (_super) { __extends(Overload, _super); function Overload() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Overload'; _this.stats = [{ type: stat_type_1.StatType.MagazineSize, value: 0.1 }]; return _this; } Overload.prototype.getStat = function (statType, weapon, context) { if (weapon.type !== type_1.Type.AssaultRifle) return 0; return _super.prototype.getStat.call(this, statType, weapon, context); }; return Overload; }(skill_1.Skill)); exports.Overload = Overload; var MetalStorm = /** @class */ (function (_super) { __extends(MetalStorm, _super); function MetalStorm() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Metal Storm'; _this.stats = [{ type: stat_type_1.StatType.FireRate, value: 0.12 }]; _this.effectType = effect_1.EffectType.MetalStorm; return _this; } return MetalStorm; }(skill_1.Skill)); exports.MetalStorm = MetalStorm; var Steady = /** @class */ (function (_super) { __extends(Steady, _super); function Steady() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Steady'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.12 }, { type: stat_type_1.StatType.GrenadeDamage, value: 0.05 }]; return _this; } Steady.prototype.getStat = function (statType, weapon, context) { if (weapon.type !== type_1.Type.RocketLauncher && statType !== stat_type_1.StatType.GrenadeDamage) return 0; return _super.prototype.getStat.call(this, statType, weapon, context); }; return Steady; }(skill_1.Skill)); exports.Steady = Steady; var Battlefront = /** @class */ (function (_super) { __extends(Battlefront, _super); function Battlefront() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Battlefront'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.06 }]; _this.effectType = effect_1.EffectType.Battlefront; return _this; } return Battlefront; }(skill_1.Skill)); exports.Battlefront = Battlefront; var DutyCalls = /** @class */ (function (_super) { __extends(DutyCalls, _super); function DutyCalls() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Duty Calls'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.05 }, { type: stat_type_1.StatType.FireRate, value: 0.03 }]; return _this; } DutyCalls.prototype.getStat = function (statType, weapon, context) { if (weapon.elementalEffect !== undefined) return 0; return _super.prototype.getStat.call(this, statType, weapon, context); }; return DutyCalls; }(skill_1.Skill)); exports.DutyCalls = DutyCalls; var DoOrDie = /** @class */ (function (_super) { __extends(DoOrDie, _super); function DoOrDie() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Do or Die'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.1 }]; return _this; } DoOrDie.prototype.getStat = function (statType, weapon, context) { if (weapon.type !== type_1.Type.RocketLauncher) return 0; return _super.prototype.getStat.call(this, statType, weapon, context); }; return DoOrDie; }(skill_1.Skill)); exports.DoOrDie = DoOrDie; var Ranger = /** @class */ (function (_super) { __extends(Ranger, _super); function Ranger() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Ranger'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.01 }, { type: stat_type_1.StatType.CritHitDamage, value: 0.01 }, { type: stat_type_1.StatType.FireRate, value: 0.01 }, { type: stat_type_1.StatType.MagazineSize, value: 0.01 }, { type: stat_type_1.StatType.ReloadSpeed, value: 0.01 }]; return _this; } return Ranger; }(skill_1.Skill)); exports.Ranger = Ranger; // Survival var LastDitchEffort = /** @class */ (function (_super) { __extends(LastDitchEffort, _super); function LastDitchEffort() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Last Ditch Effort'; _this.stats = [{ type: stat_type_1.StatType.GunDamage, value: 0.08 }]; return _this; } LastDitchEffort.prototype.getEffectiveness = function (context) { if (!context.effects) return 0; var crippledEffect = context.getEffect(effect_1.EffectType.Crippled); return crippledEffect ? 1 : 0; }; return LastDitchEffort; }(skill_1.Skill)); exports.LastDitchEffort = LastDitchEffort; var Pressure = /** @class */ (function (_super) { __extends(Pressure, _super); function Pressure() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.name = 'Pressure'; _this.stats = [{ type: stat_type_1.StatType.ReloadSpeed, value: 0.14 }]; return _this; } Pressure.prototype.getEffectiveness = function (context) { if (!context.effects) return 0; var crippledEffect = context.getEffect(effect_1.EffectType.Crippled); if (crippledEffect) return 1; var healthEffect = context.getEffect(effect_1.EffectType.Health); var healthLost = healthEffect ? 1 - healthEffect.multiplier.getValue() : 0; return healthLost; }; return Pressure; }(skill_1.Skill)); exports.Pressure = Pressure; //# sourceMappingURL=commando.js.map