@ffxiv-teamcraft/simulator
Version:
A FINAL FANTASY XIV crafting simulator
61 lines • 2.84 kB
JavaScript
;
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.ProgressAction = void 0;
var general_action_1 = require("./general-action");
var action_type_1 = require("./action-type");
var buff_enum_1 = require("../buff.enum");
var step_state_1 = require("../step-state");
var ProgressAction = /** @class */ (function (_super) {
__extends(ProgressAction, _super);
function ProgressAction() {
return _super !== null && _super.apply(this, arguments) || this;
}
ProgressAction.prototype.getType = function () {
return action_type_1.ActionType.PROGRESSION;
};
ProgressAction.prototype.execute = function (simulation) {
var buffMod = this.getBaseBonus(simulation);
var conditionMod = this.getBaseCondition(simulation);
var potency = this.getPotency(simulation);
var progressionIncrease = Math.floor(this.getBaseProgression(simulation));
switch (simulation.state) {
case step_state_1.StepState.MALLEABLE:
conditionMod *= 1.5;
break;
default:
break;
}
if (simulation.hasBuff(buff_enum_1.Buff.MUSCLE_MEMORY)) {
buffMod += 1;
simulation.removeBuff(buff_enum_1.Buff.MUSCLE_MEMORY);
}
if (simulation.hasBuff(buff_enum_1.Buff.VENERATION)) {
buffMod += 0.5;
}
var efficiency = potency * buffMod;
simulation.progression += Math.floor((progressionIncrease * conditionMod * efficiency) / 100);
if (simulation.hasBuff(buff_enum_1.Buff.FINAL_APPRAISAL) &&
simulation.progression >= simulation.recipe.progress) {
simulation.progression = Math.min(simulation.progression, simulation.recipe.progress - 1);
simulation.removeBuff(buff_enum_1.Buff.FINAL_APPRAISAL);
}
};
return ProgressAction;
}(general_action_1.GeneralAction));
exports.ProgressAction = ProgressAction;
//# sourceMappingURL=progress-action.js.map