Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2883,6 +2883,10 @@ function calcs.offence(env, actor, activeSkill)
local rateMod = calcLib.mod(skillModList, cfg, "BleedFaster") + enemyDB:Sum("INC", nil, "SelfBleedFaster") / 100
globalOutput.BleedDuration = durationBase * durationMod / rateMod * debuffDurationMult
local bleedStacks = (output.HitChance / 100) * (globalOutput.BleedDuration / output.Time) / maxStacks
local activeTotems = env.modDB:Override(nil, "TotemsSummoned") or skillModList:Sum("BASE", skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit")
if skillFlags.totem then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if is not really necessary given that local activeTotems will be 1 when no totems, or a valid value if totems.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense when reading the code, but in practice if a totem build had other sources of maximum totems, they'll still apply to skills that aren't supported by totems without it

bleedStacks = (output.HitChance / 100) * (globalOutput.BleedDuration / output.Time) * activeTotems / maxStacks
end
bleedStacks = configStacks > 0 and m_min(bleedStacks, configStacks / maxStacks) or bleedStacks
globalOutput.BleedStackPotential = bleedStacks
if globalBreakdown then
Expand All @@ -2891,9 +2895,12 @@ function calcs.offence(env, actor, activeSkill)
s_format(""),
s_format("%.2f ^8(chance to hit)", output.HitChance / 100),
s_format("* (%.2f / %.2f) ^8(BleedDuration / Attack Time)", globalOutput.BleedDuration, output.Time),
s_format("/ %d ^8(max number of stacks)", maxStacks),
s_format("= %.2f", globalOutput.BleedStackPotential),
}
if skillFlags.totem then
t_insert(globalBreakdown.BleedStackPotential, s_format("* %d ^8(active number of totems)", activeTotems))
end
t_insert(globalBreakdown.BleedStackPotential,s_format("/ %d ^8(max number of stacks)", maxStacks))
t_insert(globalBreakdown.BleedStackPotential,s_format("= %.2f", globalOutput.BleedStackPotential))
end

for sub_pass = 1, 2 do
Expand Down Expand Up @@ -2961,6 +2968,9 @@ function calcs.offence(env, actor, activeSkill)
local effectMod = calcLib.mod(skillModList, dotCfg, "AilmentEffect")
output.BaseBleedDPS = baseVal * effectMod * rateMod * effMult
bleedStacks = m_min(maxStacks, (output.HitChance / 100) * globalOutput.BleedDuration / output.Time)
if skillFlags.totem then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if is not really necessary given that local activeTotems will be 1 when no totems, or a valid value if totems.

There is an extra space near the multiplication of output.Time * activeTotems

bleedStacks = m_min(maxStacks, (output.HitChance / 100) * globalOutput.BleedDuration / output.Time * activeTotems)
end
local chanceToHitInOneSecInterval = 1 - m_pow(1 - (output.HitChance / 100), output.Speed)
output.BleedDPS = (baseVal * effectMod * rateMod * effMult) * bleedStacks * chanceToHitInOneSecInterval
-- reset bleed stacks to actual number doing damage after weighted avg DPS calculation is done
Expand Down