Skip to content

Commit e7910cc

Browse files
committed
consider delay between projectiles for max effective APS
Signed-off-by: Justin Stitt <[email protected]>
1 parent 9cc024d commit e7910cc

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/Export/Skills/act_int.txt

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,18 +2267,18 @@ local skills, mod, flag, skill = ...
22672267
#flags attack projectile area duration
22682268
parts = {
22692269
{
2270-
name = "1 Projectile"
2270+
name = "All Projectiles",
22712271
},
22722272
{
2273-
name = "All Projectiles",
2273+
name = "1 Projectile"
22742274
},
22752275
},
22762276
preDamageFunc = function(activeSkill, output, breakdown)
22772277
local skillData = activeSkill.skillData
22782278
local t_insert = table.insert
22792279
local s_format = string.format
22802280

2281-
if activeSkill.skillPart == 2 then
2281+
if activeSkill.skillPart == 1 then
22822282
-- Set base dpsMultiplier for projectile count
22832283
activeSkill.skillData.dpsMultiplier = output.ProjectileCount
22842284

@@ -2313,23 +2313,34 @@ local skills, mod, flag, skill = ...
23132313
local t_insert = table.insert
23142314
local s_format = string.format
23152315

2316+
local baseDelayBetweenProjectiles = 0.05
2317+
local projectileCount = 1
2318+
2319+
if activeSkill.skillPart == 1 then
2320+
projectileCount = output.ProjectileCount
2321+
end
2322+
23162323
-- Calculate effective attack rate accounting for delayed projectile firing
23172324
-- Projectiles orbit for base_skill_effect_duration before firing
23182325
-- Recasting resets the timer, so attacking too fast wastes potential damage
23192326
local baseDuration = skillData.duration
23202327
local actualDuration = output.Duration or baseDuration
2321-
local ticksNeeded = math.ceil(actualDuration / data.misc.ServerTickTime)
2322-
local effectiveDelay = ticksNeeded * data.misc.ServerTickTime
2328+
local ticksNeededForInitialDelay = math.ceil(actualDuration / data.misc.ServerTickTime)
2329+
local timePerProjectile = baseDelayBetweenProjectiles * output.DurationMod
2330+
local timeForAllProjectiles = timePerProjectile * projectileCount
2331+
local effectiveDelay = ticksNeededForInitialDelay * data.misc.ServerTickTime + math.ceil(timeForAllProjectiles / data.misc.ServerTickTime) * data.misc.ServerTickTime
23232332
local maxEffectiveAPS = 1 / effectiveDelay
23242333
local currentAPS = output.Speed
23252334

23262335
output.KineticFusilladeMaxEffectiveAPS = maxEffectiveAPS
23272336

23282337
if breakdown then
23292338
local breakdownAPS = {}
2330-
t_insert(breakdownAPS, s_format("^8Projectiles orbit for %.3fs before firing", actualDuration))
2339+
t_insert(breakdownAPS, s_format("^1(These calculations are speculative and best-effort)", actualDuration))
2340+
t_insert(breakdownAPS, s_format("^8Delay of^7 %.3fs ^8before projectiles start firing", actualDuration))
2341+
t_insert(breakdownAPS, s_format("^8Each projectile fires sequentially with a^7 %.3fs ^8delay between each projectile", timePerProjectile))
23312342
t_insert(breakdownAPS, s_format("^8Server tick time:^7 %.3fs", data.misc.ServerTickTime))
2332-
t_insert(breakdownAPS, s_format("^8Ticks needed:^7 %d ^8(rounded up)", ticksNeeded))
2343+
t_insert(breakdownAPS, s_format("^8Ticks needed:^7 %d ^8(rounded up)", ticksNeededForInitialDelay + math.ceil(timeForAllProjectiles / data.misc.ServerTickTime)))
23332344
t_insert(breakdownAPS, s_format("^8Effective delay:^7 %.3fs", effectiveDelay))
23342345
t_insert(breakdownAPS, s_format("^8Max effective attack rate:^7 1 / %.3f = %.2f", effectiveDelay, maxEffectiveAPS))
23352346
if currentAPS and currentAPS > maxEffectiveAPS then
@@ -2344,7 +2355,7 @@ local skills, mod, flag, skill = ...
23442355
end
23452356

23462357
-- Adjust dpsMultiplier if attacking too fast (only for "All Projectiles" mode)
2347-
if activeSkill.skillPart == 2 then
2358+
if activeSkill.skillPart == 1 then
23482359
if currentAPS and currentAPS > maxEffectiveAPS then
23492360
local efficiencyRatio = maxEffectiveAPS / currentAPS
23502361
local originalMultiplier = skillData.dpsMultiplier or output.ProjectileCount

0 commit comments

Comments
 (0)