Skip to content
Open
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions src/Data/Skills/act_dex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7169,13 +7169,42 @@ skills["StormRain"] = {
{
name = "Beam",
},
{
name = "Beam Overlaps",
},
},
preDamageFunc = function(activeSkill, output)
if activeSkill.skillPart == 2 then
activeSkill.skillData.hitTimeOverride = activeSkill.skillData.hitFrequency / (1 + activeSkill.skillModList:Sum("INC", activeSkill.skillCfg, "StormRainBeamFrequency") / 100)
activeSkill.skillData.dpsMultiplier = activeSkill.skillData.beamOverlapMultiplier or 1
end
end,
stormRainFunc = function(activeSkill, output, globalOutput, globalBreakdown, env)
if activeSkill.skillPart ~= 3 then
-- This doesn't apply to the "Arrow" skill part. That works like a normal skill.
return
end

-- Calculate the expected number of beam overlaps taking into account arrow cap and duration
if activeSkill.skillPart == 3 then
activeSkill.skillData.hitTimeOverride = activeSkill.skillData.hitFrequency / (1 + activeSkill.skillModList:Sum("INC", activeSkill.skillCfg, "StormRainBeamFrequency") / 100)
local projectiles = activeSkill.actor.output.ProjectileCount or 1
local attackSpeed = globalOutput.Speed
local beamFrequency = 1 / activeSkill.skillData.hitTimeOverride

-- Arrows pulse 4 times before expiring
local arrowDuration = activeSkill.skillData.hitTimeOverride * 4
-- Maximum amount of projectiles per second to calculate into dps (100 is max arrows out at one time)
local projectilesPerSecondCap = math.floor(100 / arrowDuration)
-- Number of attacks before arrows start to expire
local attacksBeforeArrowFalloff = math.floor(arrowDuration * attackSpeed)
local projectilesBeforeFalloff = projectiles * attacksBeforeArrowFalloff

-- Use the lower amount of projectiles in the dps calculation
activeSkill.skillData.dpsMultiplier = (activeSkill.skillData.dpsMultiplier or 1) * (math.min(projectilesBeforeFalloff, projectilesPerSecondCap) or 1)
globalOutput.HitSpeed = beamFrequency
end
end,
statMap = {
["prismatic_rain_beam_base_frequency_ms"] = {
skill("hitFrequency", nil),
Expand Down
29 changes: 29 additions & 0 deletions src/Export/Skills/act_dex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1479,13 +1479,42 @@ local skills, mod, flag, skill = ...
{
name = "Beam",
},
{
name = "Beam Overlaps",
},
},
preDamageFunc = function(activeSkill, output)
if activeSkill.skillPart == 2 then
activeSkill.skillData.hitTimeOverride = activeSkill.skillData.hitFrequency / (1 + activeSkill.skillModList:Sum("INC", activeSkill.skillCfg, "StormRainBeamFrequency") / 100)
activeSkill.skillData.dpsMultiplier = activeSkill.skillData.beamOverlapMultiplier or 1
end
end,
stormRainFunc = function(activeSkill, output, globalOutput, globalBreakdown, env)
if activeSkill.skillPart ~= 3 then
-- This doesn't apply to the "Arrow" skill part. That works like a normal skill.
return
end

-- Calculate the expected number of beam overlaps taking into account arrow cap and duration
if activeSkill.skillPart == 3 then
activeSkill.skillData.hitTimeOverride = activeSkill.skillData.hitFrequency / (1 + activeSkill.skillModList:Sum("INC", activeSkill.skillCfg, "StormRainBeamFrequency") / 100)
local projectiles = activeSkill.actor.output.ProjectileCount or 1
local attackSpeed = globalOutput.Speed
local beamFrequency = 1 / activeSkill.skillData.hitTimeOverride

-- Arrows pulse 4 times before expiring
local arrowDuration = activeSkill.skillData.hitTimeOverride * 4
-- Maximum amount of projectiles per second to calculate into dps (100 is max arrows out at one time)
local projectilesPerSecondCap = math.floor(100 / arrowDuration)
-- Number of attacks before arrows start to expire
local attacksBeforeArrowFalloff = math.floor(arrowDuration * attackSpeed)
local projectilesBeforeFalloff = projectiles * attacksBeforeArrowFalloff

-- Use the lower amount of projectiles in the dps calculation
activeSkill.skillData.dpsMultiplier = (activeSkill.skillData.dpsMultiplier or 1) * (math.min(projectilesBeforeFalloff, projectilesPerSecondCap) or 1)
globalOutput.HitSpeed = beamFrequency
end
end,
statMap = {
["prismatic_rain_beam_base_frequency_ms"] = {
skill("hitFrequency", nil),
Expand Down
5 changes: 5 additions & 0 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2583,6 +2583,11 @@ function calcs.offence(env, actor, activeSkill)
activeSkill.activeEffect.grantedEffect.explosiveArrowFunc(activeSkill, output, globalOutput, globalBreakdown, env)
end

-- Calculate beam overlaps for Storm Rain
if activeSkill.activeEffect.grantedEffect.name == "Storm Rain" then
activeSkill.activeEffect.grantedEffect.stormRainFunc(activeSkill, output, globalOutput, globalBreakdown, env)
end

-- Calculate crit chance, crit multiplier, and their combined effect
if skillModList:Flag(cfg, "NeverCrit") then
output.PreEffectiveCritChance = 0
Expand Down