Skip to content

Commit 4927f07

Browse files
committed
Max sustainable fuses breakdowns
1 parent fc67e22 commit 4927f07

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

src/Modules/CalcOffence.lua

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2434,16 +2434,41 @@ function calcs.offence(env, actor, activeSkill)
24342434
--Does not take into account mines or traps
24352435
if activeSkill.activeEffect.grantedEffect.name == "Explosive Arrow" and activeSkill.skillPart == 2 then
24362436
local hitRate = output.HitChance / 100 * globalOutput.Speed * globalOutput.ActionSpeedMod * skillData.dpsMultiplier
2437+
local initialHitRate = hitRate
2438+
local activeTotems = 1
24372439
if skillFlags.totem then
2438-
local activeTotems = env.modDB:Override(nil, "TotemsSummoned") or skillModList:Sum("BASE", skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit")
2440+
activeTotems = env.modDB:Override(nil, "TotemsSummoned") or skillModList:Sum("BASE", skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit")
24392441
hitRate = hitRate * activeTotems
24402442
end
24412443
local duration = calcSkillDuration(activeSkill.skillModList, activeSkill.skillCfg, activeSkill.skillData, env, enemyDB)
24422444
local skillMax = activeSkill.skillModList:Sum("BASE", env.player.mainSkill.skillCfg, "ExplosiveArrowMaxFuseCount")
24432445
local maximum = m_min(m_floor(hitRate * duration) + 1, skillMax)
2446+
local timeToMaximum = maximum / hitRate
24442447
skillModList:NewMod("Multiplier:ExplosiveArrowStage", "BASE", maximum, "Base")
24452448
skillModList:NewMod("Multiplier:ExplosiveArrowStageAfterFirst", "BASE", maximum - 1, "Base")
24462449
globalOutput.MaxExplosiveArrowFuseCalculated = maximum
2450+
globalOutput.ExplosionsPerSecond = 1 / timeToMaximum
2451+
if globalBreakdown then
2452+
globalBreakdown.MaxExplosiveArrowFuseCalculated = {}
2453+
if skillFlags.totem then
2454+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("%.2f ^8(attack rate)", initialHitRate))
2455+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("x %d ^8(active totems)", activeTotems))
2456+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("= %.2f ^8(hit rate)", hitRate))
2457+
else
2458+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("%.2f ^8(hit rate)", hitRate))
2459+
end
2460+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("x %.2f ^8(duration)", duration))
2461+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("+ 1 ^8(initial hit)"))
2462+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("= %.2f", (hitRate * duration) + 1))
2463+
t_insert(globalBreakdown.MaxExplosiveArrowFuseCalculated, s_format("= %d ^8(rounded down, capped at max)", maximum))
2464+
2465+
globalBreakdown.ExplosionsPerSecond = {}
2466+
t_insert(globalBreakdown.ExplosionsPerSecond, s_format("1 ^8(second)"))
2467+
t_insert(globalBreakdown.ExplosionsPerSecond, s_format(" / %d ^8(max fuses)", maximum))
2468+
t_insert(globalBreakdown.ExplosionsPerSecond, s_format(" / %.2f ^8(hit rate)", hitRate))
2469+
t_insert(globalBreakdown.ExplosionsPerSecond, s_format("= %.2f ^8(expl. per second)", globalOutput.ExplosionsPerSecond))
2470+
2471+
end
24472472
else
24482473
globalOutput.MaxExplosiveArrowFuseCalculated = nil
24492474
end

src/Modules/CalcSections.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,9 @@ return {
678678
{ label = "Attachment Range", flag = "brand", { format = "{0:output:BrandAttachmentRange}",
679679
{ breakdown = "BrandAttachmentRange" },
680680
{ modName = "BrandAttachmentRange", cfg = "skill"},
681-
}, },
682-
{ label = "Max Sust. Fuses", haveOutput = "MaxExplosiveArrowFuseCalculated", { format = "{0:output:MaxExplosiveArrowFuseCalculated} Fuses", }, },
681+
}, },
682+
{ label = "Max Sust. Fuses", haveOutput = "MaxExplosiveArrowFuseCalculated", { format = "{0:output:MaxExplosiveArrowFuseCalculated} Fuses", { breakdown = "MaxExplosiveArrowFuseCalculated" }, }, },
683+
{ label = "Explosions /s", haveOutput = "ExplosionsPerSecond", { format = "{2:output:ExplosionsPerSecond}", { breakdown = "ExplosionsPerSecond" }, }, },
683684
{ label = "Overlap Chance", haveOutput = "OverlapChance", { format = "{2:output:OverlapChance}%", { breakdown = "OverlapChance" }, }, },
684685
{ label = "Trap Cooldown", haveOutput = "TrapCooldown", { format = "{3:output:TrapCooldown}s",
685686
{ breakdown = "TrapCooldown" },

0 commit comments

Comments
 (0)