Skip to content

Commit

Permalink
fix spell calc for spells that are static
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 16, 2024
1 parent b8d56da commit 34ae332
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/app/services/analysis.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,17 +825,24 @@ export class AnalysisService {
.filter((m) => m[0] <= skill)
.reverse()[0][1];

const isStatic = spell.spellMeta?.staticPotency;
const potencyMultiplier = spell.potencyMultiplier ?? 1;

if (spell.spellMeta?.useSkillAsPotency)
if (spell.spellMeta?.useSkillAsPotency) {
return {
min: calcSkill * potencyMultiplier,
max: calcSkill * potencyMultiplier,
};
}

if (spell.spellMeta?.staticPotency) {
return {
min: Math.floor(calcSkill * stat * maxMult * potencyMultiplier),
max: Math.floor(calcSkill * stat * maxMult * potencyMultiplier),
};
}

const bonusRollsMin = isStatic ? 0 : spell.bonusRollsMin ?? 0;
const bonusRollsMax = isStatic ? 0 : spell.bonusRollsMax ?? 0;
const bonusRollsMin = spell.bonusRollsMin ?? 0;
const bonusRollsMax = spell.bonusRollsMax ?? 0;

// base rolls
const baseRollsMin = calcSkill + bonusRollsMin;
Expand Down

0 comments on commit 34ae332

Please sign in to comment.