@ffxiv-teamcraft/simulator
Version:
A FINAL FANTASY XIV crafting simulator
124 lines • 5.66 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.DelicateSynthesis = void 0;
var general_action_1 = require("../general-action");
var action_type_1 = require("../action-type");
var buff_enum_1 = require("../../buff.enum");
var crafting_job_enum_1 = require("../../crafting-job.enum");
var step_state_1 = require("../../step-state");
var DelicateSynthesis = /** @class */ (function (_super) {
__extends(DelicateSynthesis, _super);
function DelicateSynthesis() {
return _super !== null && _super.apply(this, arguments) || this;
}
DelicateSynthesis.prototype.getLevelRequirement = function () {
return { job: crafting_job_enum_1.CraftingJob.ANY, level: 76 };
};
DelicateSynthesis.prototype._canBeUsed = function (simulation, linear) {
return true;
};
DelicateSynthesis.prototype.execute = function (simulation) {
// Progress
var progressionIncrease = Math.floor(this.getBaseProgression(simulation));
var progressPotency = this.getPotency(simulation, 'progress');
var progressBuffMod = this.getBaseBonus(simulation);
var progressConditionMod = this.getBaseCondition(simulation);
switch (simulation.state) {
case step_state_1.StepState.MALLEABLE:
progressConditionMod *= 1.5;
break;
default:
break;
}
if (simulation.hasBuff(buff_enum_1.Buff.MUSCLE_MEMORY)) {
progressBuffMod += 1;
simulation.removeBuff(buff_enum_1.Buff.MUSCLE_MEMORY);
}
if (simulation.hasBuff(buff_enum_1.Buff.VENERATION)) {
progressBuffMod += 0.5;
}
var progressEfficiency = progressPotency * progressBuffMod;
simulation.progression += Math.floor((progressionIncrease * progressConditionMod * progressEfficiency) / 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);
}
// Quality
this.executeQuality(simulation);
};
DelicateSynthesis.prototype.executeQuality = function (simulation) {
var _a;
var buffMod = this.getBaseBonus(simulation);
var conditionMod = this.getBaseCondition(simulation);
var potency = this.getPotency(simulation);
var qualityIncrease = Math.floor(this.getBaseQuality(simulation));
switch (simulation.state) {
case step_state_1.StepState.EXCELLENT:
conditionMod *= 4;
break;
case step_state_1.StepState.POOR:
conditionMod *= 0.5;
break;
case step_state_1.StepState.GOOD:
conditionMod *= simulation.crafterStats.splendorous ? 1.75 : 1.5;
break;
default:
break;
}
var iqMod = ((_a = simulation.getBuff(buff_enum_1.Buff.INNER_QUIET)) === null || _a === void 0 ? void 0 : _a.stacks) || 0;
var buffMult = 1;
if (simulation.hasBuff(buff_enum_1.Buff.GREAT_STRIDES)) {
buffMult += 1;
simulation.removeBuff(buff_enum_1.Buff.GREAT_STRIDES);
}
if (simulation.hasBuff(buff_enum_1.Buff.INNOVATION)) {
buffMult += 0.5;
}
buffMod = (buffMod * buffMult * (100 + iqMod * 10)) / 100;
var efficiency = Math.fround(potency * buffMod);
simulation.quality += Math.floor((qualityIncrease * conditionMod * efficiency) / 100);
if (simulation.crafterStats.level >= 11) {
simulation.addInnerQuietStacks(1);
}
};
DelicateSynthesis.prototype.getBaseCPCost = function (simulationState) {
return 32;
};
DelicateSynthesis.prototype.getBaseDurabilityCost = function (simulationState) {
return 10;
};
DelicateSynthesis.prototype.getBaseSuccessRate = function (simulationState) {
return 100;
};
DelicateSynthesis.prototype.getIds = function () {
return [100323, 100324, 100325, 100326, 100327, 100328, 100329, 100330];
};
DelicateSynthesis.prototype.getPotency = function (simulation, target) {
if (target === 'progress') {
return simulation.crafterStats.level >= 94 ? 150 : 100;
}
return 100;
};
DelicateSynthesis.prototype.getType = function () {
return action_type_1.ActionType.OTHER;
};
return DelicateSynthesis;
}(general_action_1.GeneralAction));
exports.DelicateSynthesis = DelicateSynthesis;
//# sourceMappingURL=delicate-synthesis.js.map