UNPKG

borderlands2

Version:

Borderlands 2 weapon damage and DPS calculation library

187 lines 6.89 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 EffectType; (function (EffectType) { EffectType["Pimpernel"] = "Pimpernel"; EffectType["ActionSkill"] = "ActionSkill"; EffectType["Crippled"] = "Crippled"; EffectType["ShieldDepleted"] = "ShieldDepleted"; EffectType["Health"] = "Health"; EffectType["MetalStorm"] = "MetalStorm"; EffectType["Onslaught"] = "Onslaught"; EffectType["Battlefront"] = "Battlefront"; EffectType["Ambush"] = "Ambush"; EffectType["RisingSh0t"] = "RisingSh0t"; EffectType["DeathMark"] = "DeathMark"; })(EffectType = exports.EffectType || (exports.EffectType = {})); // This would treat effects a binary states...but effects could vary // health can be a %, pimpernel can stack crit shots var Multiplier = /** @class */ (function () { function Multiplier() { this.value = 1; } Multiplier.prototype.getValue = function () { return this.value; }; Multiplier.prototype.setValue = function (value) { this.value = value; }; return Multiplier; }()); var PercentageMultiplier = /** @class */ (function (_super) { __extends(PercentageMultiplier, _super); function PercentageMultiplier() { return _super !== null && _super.apply(this, arguments) || this; } return PercentageMultiplier; }(Multiplier)); var RangeMultiplier = /** @class */ (function (_super) { __extends(RangeMultiplier, _super); function RangeMultiplier(max, step) { if (step === void 0) { step = 1; } var _this = _super.call(this) || this; _this.max = max; _this.step = step; return _this; } return RangeMultiplier; }(Multiplier)); var Effect = /** @class */ (function () { function Effect() { this.multiplier = new Multiplier(); } Effect.prototype.getEffectType = function () { return this.effectType; }; return Effect; }()); exports.Effect = Effect; var PimpernelEffect = /** @class */ (function (_super) { __extends(PimpernelEffect, _super); function PimpernelEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.Pimpernel; _this.multiplier = new RangeMultiplier(7); return _this; } return PimpernelEffect; }(Effect)); exports.PimpernelEffect = PimpernelEffect; var ShieldDepletedEffect = /** @class */ (function (_super) { __extends(ShieldDepletedEffect, _super); function ShieldDepletedEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.ShieldDepleted; return _this; } return ShieldDepletedEffect; }(Effect)); exports.ShieldDepletedEffect = ShieldDepletedEffect; var ActionSkillEffect = /** @class */ (function (_super) { __extends(ActionSkillEffect, _super); function ActionSkillEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.ActionSkill; return _this; } return ActionSkillEffect; }(Effect)); exports.ActionSkillEffect = ActionSkillEffect; var CrippledEffect = /** @class */ (function (_super) { __extends(CrippledEffect, _super); function CrippledEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.Crippled; return _this; } return CrippledEffect; }(Effect)); exports.CrippledEffect = CrippledEffect; var HealthEffect = /** @class */ (function (_super) { __extends(HealthEffect, _super); function HealthEffect(health) { var _this = _super.call(this) || this; _this.effectType = EffectType.Health; _this.multiplier = new PercentageMultiplier(); if (health != undefined) _this.multiplier.setValue(health); return _this; } return HealthEffect; }(Effect)); exports.HealthEffect = HealthEffect; var MetalStormEffect = /** @class */ (function (_super) { __extends(MetalStormEffect, _super); function MetalStormEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.MetalStorm; return _this; } return MetalStormEffect; }(Effect)); exports.MetalStormEffect = MetalStormEffect; var OnslaughtEffect = /** @class */ (function (_super) { __extends(OnslaughtEffect, _super); function OnslaughtEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.Onslaught; return _this; } return OnslaughtEffect; }(Effect)); exports.OnslaughtEffect = OnslaughtEffect; var BattlefrontEffect = /** @class */ (function (_super) { __extends(BattlefrontEffect, _super); function BattlefrontEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.Battlefront; return _this; } return BattlefrontEffect; }(Effect)); exports.BattlefrontEffect = BattlefrontEffect; var AmbushEffect = /** @class */ (function (_super) { __extends(AmbushEffect, _super); function AmbushEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.Ambush; return _this; } return AmbushEffect; }(Effect)); exports.AmbushEffect = AmbushEffect; var RisingSh0tEffect = /** @class */ (function (_super) { __extends(RisingSh0tEffect, _super); function RisingSh0tEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.RisingSh0t; _this.multiplier = new RangeMultiplier(5); return _this; } return RisingSh0tEffect; }(Effect)); exports.RisingSh0tEffect = RisingSh0tEffect; var DeathMarkEffect = /** @class */ (function (_super) { __extends(DeathMarkEffect, _super); function DeathMarkEffect() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.effectType = EffectType.DeathMark; return _this; } return DeathMarkEffect; }(Effect)); exports.DeathMarkEffect = DeathMarkEffect; //# sourceMappingURL=effect.js.map