UNPKG

@ffxiv-teamcraft/simulator

Version:
52 lines 2.26 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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.GeneralAction = void 0; var crafting_action_1 = require("./crafting-action"); var buff_enum_1 = require("../buff.enum"); var step_state_1 = require("../step-state"); /** * This is for every progress and quality actions */ var GeneralAction = /** @class */ (function (_super) { __extends(GeneralAction, _super); function GeneralAction() { return _super !== null && _super.apply(this, arguments) || this; } GeneralAction.prototype.getDurabilityCost = function (simulationState) { var divider = 1; if (simulationState.hasBuff(buff_enum_1.Buff.WASTE_NOT) || simulationState.hasBuff(buff_enum_1.Buff.WASTE_NOT_II)) { divider *= 2; } if (simulationState.state === step_state_1.StepState.STURDY) { divider *= 2; } return Math.ceil(this.getBaseDurabilityCost(simulationState) / divider); }; GeneralAction.prototype._getSuccessRate = function (simulationState) { return this.getBaseSuccessRate(simulationState); }; GeneralAction.prototype.getBaseBonus = function (simulation) { return 1; }; GeneralAction.prototype.getBaseCondition = function (simulation) { return 1; }; return GeneralAction; }(crafting_action_1.CraftingAction)); exports.GeneralAction = GeneralAction; //# sourceMappingURL=general-action.js.map