Skip to content

Commit a90a577

Browse files
authored
Fixed KF DPS and attack speed breakpoint calcs (#9452)
* fix: fixed KF damage calcs * feat: gave attack speed indicators to reach the breakpoints
1 parent 2699541 commit a90a577

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

src/Data/Skills/act_int.lua

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11202,33 +11202,38 @@ skills["KineticFusillade"] = {
1120211202
-- Calculate effective attack rate accounting for delayed projectile firing
1120311203
-- Projectiles orbit for base_skill_effect_duration before firing
1120411204
-- Recasting resets the timer, so attacking too fast wastes potential damage
11205-
local baseDuration = skillData.duration
11206-
local actualDuration = output.Duration or baseDuration
11207-
local ticksNeededForInitialDelay = math.ceil(actualDuration / data.misc.ServerTickTime)
11208-
local timePerProjectile = baseDelayBetweenProjectiles * output.DurationMod
11209-
local timeForAllProjectiles = timePerProjectile * projectileCount
11210-
local effectiveDelay = ticksNeededForInitialDelay * data.misc.ServerTickTime + math.ceil(timeForAllProjectiles / data.misc.ServerTickTime) * data.misc.ServerTickTime
11205+
-- Formula: totalTime = (hoverDelay + delayBetweenProj * nProj) * durationMod
11206+
local hoverDelay = skillData.duration
11207+
local durationMod = output.DurationMod
11208+
local baseTimeForAllProjectiles = baseDelayBetweenProjectiles * projectileCount
11209+
local effectiveDelay = (hoverDelay + baseTimeForAllProjectiles) * durationMod
1121111210
local maxEffectiveAPS = 1 / effectiveDelay
1121211211
local currentAPS = output.Speed
1121311212

1121411213
output.KineticFusilladeMaxEffectiveAPS = maxEffectiveAPS
1121511214

1121611215
if breakdown then
1121711216
local breakdownAPS = {}
11218-
t_insert(breakdownAPS, s_format("^1(These calculations are speculative and best-effort)", actualDuration))
11219-
t_insert(breakdownAPS, s_format("^8Delay of^7 %.3fs ^8before projectiles start firing", actualDuration))
11220-
t_insert(breakdownAPS, s_format("^8Each projectile fires sequentially with a^7 %.3fs ^8delay between each projectile", timePerProjectile))
11221-
t_insert(breakdownAPS, s_format("^8Server tick time:^7 %.3fs", data.misc.ServerTickTime))
11222-
t_insert(breakdownAPS, s_format("^8Ticks needed:^7 %d ^8(rounded up)", ticksNeededForInitialDelay + math.ceil(timeForAllProjectiles / data.misc.ServerTickTime)))
11223-
t_insert(breakdownAPS, s_format("^8Effective delay:^7 %.3fs", effectiveDelay))
11224-
t_insert(breakdownAPS, s_format("^8Max effective attack rate:^7 1 / %.3f = %.2f", effectiveDelay, maxEffectiveAPS))
11225-
if currentAPS and currentAPS > maxEffectiveAPS then
11226-
t_insert(breakdownAPS, "")
11227-
t_insert(breakdownAPS, s_format("^1Current attack rate (%.2f) exceeds max effective rate!", currentAPS))
11228-
t_insert(breakdownAPS, s_format("^1DPS is reduced by %.1f%%", (1 - maxEffectiveAPS / currentAPS) * 100))
11229-
elseif currentAPS then
11217+
t_insert(breakdownAPS, s_format("^1(These calculations are speculative and best-effort)"))
11218+
t_insert(breakdownAPS, s_format("^8Base hover delay:^7 %.3fs", hoverDelay))
11219+
t_insert(breakdownAPS, s_format("^8Base delay between projectiles:^7 %.3fs", baseDelayBetweenProjectiles))
11220+
t_insert(breakdownAPS, s_format("^8Base time for^7 %d ^8projectiles:^7 %.3fs x %d = %.3fs", projectileCount, baseDelayBetweenProjectiles, projectileCount, baseTimeForAllProjectiles))
11221+
t_insert(breakdownAPS, s_format("^8Duration modifier:^7 %.4f", durationMod))
11222+
t_insert(breakdownAPS, s_format("^8Effective delay:^7 (%.3f + %.3f) x %.4f = %.4fs", hoverDelay, baseTimeForAllProjectiles, durationMod, effectiveDelay))
11223+
t_insert(breakdownAPS, s_format("^8Max effective attack rate:^7 1 / %.4f = %.2f", effectiveDelay, maxEffectiveAPS))
11224+
if currentAPS then
11225+
local currentInc = activeSkill.skillModList:Sum("INC", activeSkill.skillCfg, "Speed")
11226+
local neededInc = ((maxEffectiveAPS / currentAPS) * (1 + currentInc / 100) - 1) * 100
11227+
local additionalInc = neededInc - currentInc
1123011228
t_insert(breakdownAPS, "")
11231-
t_insert(breakdownAPS, s_format("^2Current attack rate (%.2f) is within effective limits", currentAPS))
11229+
if currentAPS > maxEffectiveAPS then
11230+
t_insert(breakdownAPS, s_format("^1Current attack rate (%.2f) exceeds max effective rate!", currentAPS))
11231+
t_insert(breakdownAPS, s_format("^1Reduce attack speed by at least^7 %d%% ^1", math.ceil(-additionalInc)))
11232+
t_insert(breakdownAPS, s_format("^1DPS is reduced by %.1f%%", (1 - maxEffectiveAPS / currentAPS) * 100))
11233+
else
11234+
t_insert(breakdownAPS, s_format("^2Current attack rate (%.2f) is within effective limits", currentAPS))
11235+
t_insert(breakdownAPS, s_format("^2You can add up to^7 %d%% ^2increased attack speed", math.floor(additionalInc)))
11236+
end
1123211237
end
1123311238
breakdown.KineticFusilladeMaxEffectiveAPS = breakdownAPS
1123411239
end

0 commit comments

Comments
 (0)