UNPKG

@ffxiv-teamcraft/simulator

Version:
73 lines 3.24 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.TricksOfTheTrade = void 0; var crafting_action_1 = require("../crafting-action"); var action_type_1 = require("../action-type"); var crafting_job_enum_1 = require("../../crafting-job.enum"); var step_state_1 = require("../../step-state"); var buff_enum_1 = require("../../buff.enum"); var TricksOfTheTrade = /** @class */ (function (_super) { __extends(TricksOfTheTrade, _super); function TricksOfTheTrade() { return _super !== null && _super.apply(this, arguments) || this; } TricksOfTheTrade.prototype.getLevelRequirement = function () { return { job: crafting_job_enum_1.CraftingJob.ANY, level: 13 }; }; TricksOfTheTrade.prototype.getType = function () { return action_type_1.ActionType.CP_RECOVERY; }; TricksOfTheTrade.prototype._canBeUsed = function (simulationState, linear) { if (linear === void 0) { linear = false; } if (linear) { return true; } if (simulationState.safe) { return false; } return (simulationState.state === step_state_1.StepState.GOOD || simulationState.state === step_state_1.StepState.EXCELLENT); }; TricksOfTheTrade.prototype.execute = function (simulation, safe) { if (simulation.hasBuff(buff_enum_1.Buff.HEART_AND_SOUL) || simulation.state === step_state_1.StepState.GOOD || simulation.state === step_state_1.StepState.EXCELLENT) { simulation.availableCP += 20; if (simulation.availableCP > simulation.maxCP) { simulation.availableCP = simulation.maxCP; } } }; TricksOfTheTrade.prototype.getBaseCPCost = function (simulationState) { return 0; }; TricksOfTheTrade.prototype.getIds = function () { return [100371, 100372, 100373, 100374, 100375, 100376, 100377, 100378]; }; TricksOfTheTrade.prototype._getSuccessRate = function (simulationState) { return 100; }; TricksOfTheTrade.prototype.getDurabilityCost = function (simulationState) { return 0; }; TricksOfTheTrade.prototype.skipOnFail = function () { return true; }; return TricksOfTheTrade; }(crafting_action_1.CraftingAction)); exports.TricksOfTheTrade = TricksOfTheTrade; //# sourceMappingURL=tricks-of-the-trade.js.map