Skip to content

Commit

Permalink
Merge pull request xiv-gear-planner#180 from nikroulah/master
Browse files Browse the repository at this point in the history
Add PLD usage sim
  • Loading branch information
xpdota authored Jul 3, 2024
2 parents a88d37e + b67e438 commit 77fcf88
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 221 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/scripts/sims/default_sims.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {pldSheetSpec} from "./tank/pld_sheet_sim"
import {pldUsageSimSpec} from "./tank/pld/pld_usage_sim_no_sks"
import {whmSheetSpec} from "./healer/whm_sheet_sim";
import {sgeSheetSpec} from "./healer/sge_sheet_sim";
import {sgeNewSheetSpec} from "./healer/sge_sheet_sim_mk2";
Expand All @@ -19,7 +19,7 @@ import {dncDtSheetSpec} from "./ranged/dnc_sim";

export function registerDefaultSims() {
registerSim(potRatioSimSpec);
registerSim(pldSheetSpec);
registerSim(pldUsageSimSpec);
registerSim(whmSheetSpec);
registerSim(sgeSheetSpec);
registerSim(sgeNewSheetSpec);
Expand Down
16 changes: 11 additions & 5 deletions packages/frontend/src/scripts/sims/processors/count_sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@xivgear/core/sims/sim_types";
import {BuffSettingsExport, BuffSettingsManager} from "@xivgear/core/sims/common/party_comp_settings";
import {defaultResultSettings, ResultSettings} from "@xivgear/core/sims/cycle_sim";
import {addValues, applyStdDev, multiplyFixed, ValueWithDev} from "@xivgear/xivmath/deviation";
import {addValues, applyStdDev, multiplyFixed, multiplyIndependent, ValueWithDev} from "@xivgear/xivmath/deviation";
import {JobName} from "@xivgear/xivmath/xivconstants";
import {NamedSection} from "../../components/section";
import {BuffSettingsArea} from "../party_comp_settings";
Expand Down Expand Up @@ -166,14 +166,20 @@ export abstract class BaseUsageCountSim<ResultType extends CountSimResult, Inter
const skill = sc[0];
const count = sc[1];
totalPotency += skill.potency * count;
// TODO: how will this handle DoTs?
const dmg = abilityToDamageNew(set.computedStats, skill, buffEffects);
const result = [];
if (dmg.directDamage) {
const valueWithDev = multiplyFixed(dmg.directDamage, count);
const valueWithDev = multiplyIndependent(dmg.directDamage, count);
console.trace(`Skill ${skill.name}, count ${count}, duration ${bucket.maxDuration}, total ${valueWithDev.expected}`);
return [valueWithDev];
result.push(valueWithDev);
}
return [];
// TODO handle indefinite dots? only one I can think of is blu so maybe not worth
if (dmg.dot && dmg.dot.fullDurationTicks !== 'indefinite') {
const valueWithDev = multiplyIndependent(dmg.dot.damagePerTick, dmg.dot.fullDurationTicks * count);
console.trace(`Skill ${skill.name}, count ${count}, duration ${bucket.maxDuration}, total ${valueWithDev.expected}`);
result.push(valueWithDev);
}
return result;
}));
});
const totalDamage: ValueWithDev = addValues(
Expand Down
218 changes: 218 additions & 0 deletions packages/frontend/src/scripts/sims/tank/pld/pld_actions_no_sks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
import {AutoAttack, GcdAbility, OgcdAbility, DamagingAbility, Ability} from "@xivgear/core/sims/sim_types";

export const fast: GcdAbility = {
id: 9,
type: 'gcd',
name: "Fast Blade",
potency: 220,
attackType: "Weaponskill",
gcd: 2.5,
fixedGcd: true
}

export const riot: GcdAbility = {
id: 15,
type: 'gcd',
name: "Riot Blade",
potency: 330,
attackType: "Weaponskill",
gcd: 2.5,
fixedGcd: true
}

export const royal: GcdAbility = {
id: 3539,
type: 'gcd',
name: "Royal Authority",
potency: 440,
attackType: "Weaponskill",
gcd: 2.5,
fixedGcd: true
}

export const atone: GcdAbility = {
id: 16460,
type: 'gcd',
name: "Atonement",
potency: 440,
attackType: "Weaponskill",
gcd: 2.5,
fixedGcd: true
}

export const supp: GcdAbility = {
id: 36918,
type: 'gcd',
name: "Supplication",
potency: 460,
attackType: "Weaponskill",
gcd: 2.5,
fixedGcd: true
}

export const sep: GcdAbility = {
id: 36919,
type: 'gcd',
name: "Sepulchre",
potency: 480,
attackType: "Weaponskill",
gcd: 2.5,
fixedGcd: true
}

export const hs: GcdAbility = {
id: 7384,
type: 'gcd',
name: "Holy Spirit",
potency: 470,
attackType: "Spell",
gcd: 2.5,
fixedGcd: true
}

export const goring: GcdAbility = {
id: 3538,
type: 'gcd',
name: "Goring Blade",
potency: 700,
attackType: "Weaponskill",
gcd: 2.5,
fixedGcd: true
}

export const conf: GcdAbility = {
id: 16459,
type: 'gcd',
name: "Confiteor",
potency: 940,
attackType: "Spell",
gcd: 2.5,
fixedGcd: true
}

export const faith: GcdAbility = {
id: 25748,
type: 'gcd',
name: "Blade of Faith",
potency: 740,
attackType: "Spell",
gcd: 2.5,
fixedGcd: true
}

export const truth: GcdAbility = {
id: 25749,
type: 'gcd',
name: "Blade of Truth",
potency: 840,
attackType: "Spell",
gcd: 2.5,
fixedGcd: true
}

export const valor: GcdAbility = {
id: 25750,
type: 'gcd',
name: "Blade of Valor",
potency: 940,
attackType: "Spell",
gcd: 2.5,
fixedGcd: true
}

export const cos: OgcdAbility = {
id: 23,
type: 'ogcd',
name: "Circle of Scorn",
potency: 140,
dot: {
id: 248,
duration: 15,
tickPotency: 30
},
attackType: "Ability"
}

export const exp: OgcdAbility = {
id: 25747,
type: 'ogcd',
name: "Expiacion",
potency: 450,
attackType: "Ability"
}

export const int: OgcdAbility = {
id: 16461,
type: 'ogcd',
name: "Intervene",
potency: 150,
attackType: "Ability"
}

export const imp: OgcdAbility = {
id: 36921,
type: 'ogcd',
name: "Imperator",
potency: 580,
attackType: "Ability"
}

export const honor: OgcdAbility = {
id: 36922,
type: 'ogcd',
name: "Blade of Honor",
potency: 1000,
attackType: "Ability"
}

export const auto: AutoAttack = {
name: 'Auto Attack',
type: 'autoattack',
potency: 90,
attackType: 'Auto-attack',
id: 7
}

export const fof: OgcdAbility = {
id: 20,
type: 'ogcd',
name: "Fight or Flight",
potency: null,
attackType: "Ability",
activatesBuffs: [
{
statusId: 76,
name: "Fight or Flight",
selfOnly: true,
duration: 20,
effects: {
dmgIncrease: 0.25
}
}
]
}

export function buffed(ability: Ability & Partial<DamagingAbility>): Ability {
if (!ability.dot) {
return {
...ability,
name: `${ability.name} (FoF)`,
potency: ability.potency * 1.25,
id: -ability.id,
};
}

const {dot: d, ...rest} = ability;

return {
...rest,
name: `${ability.name} (FoF)`,
potency: ability.potency * 1.25,
id: -ability.id,
dot: {
...d,
id: -d.id,
tickPotency: d.tickPotency * 1.25,
}
};
}
Loading

0 comments on commit 77fcf88

Please sign in to comment.