Skip to content

Commit

Permalink
Critical cull chance uses hit rate (#5378)
Browse files Browse the repository at this point in the history
* critical cull chance uses hit rate

* Move lines

Co-authored-by: LocalIdentity <localidentity2@gmail.com>
  • Loading branch information
andrewbelu and LocalIdentity authored Dec 19, 2022
1 parent 7512892 commit 25f4270
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2336,16 +2336,20 @@ function calcs.offence(env, actor, activeSkill)
output.DoubleDamageChance = m_max(output.DoubleDamageChance - output.TripleDamageChance * output.DoubleDamageChance / 100, 0)
end
output.DoubleDamageEffect = 1 + output.DoubleDamageChance / 100
output.ScaledDamageEffect = output.ScaledDamageEffect * output.DoubleDamageEffect
output.ScaledDamageEffect = output.ScaledDamageEffect * output.DoubleDamageEffect

local hitRate = output.HitChance / 100 * (globalOutput.HitSpeed or globalOutput.Speed) * (skillData.dpsMultiplier or 1)

-- Calculate culling DPS
local criticalCull = skillModList:Max(cfg, "CriticalCullPercent") or 0
if criticalCull > 0 then
criticalCull = criticalCull * (output.CritChance / 100)
criticalCull = m_min(criticalCull, criticalCull * (1 - (1 - output.CritChance / 100) ^ hitRate))
end
local regularCull = skillModList:Max(cfg, "CullPercent") or 0
local maxCullPercent = m_max(criticalCull, regularCull)
globalOutput.CullPercent = maxCullPercent
globalOutput.CullMultiplier = 100 / (100 - globalOutput.CullPercent)

-- Calculate base hit damage
for _, damageType in ipairs(dmgTypeList) do
local damageTypeMin = damageType.."Min"
Expand Down Expand Up @@ -2673,8 +2677,6 @@ function calcs.offence(env, actor, activeSkill)
skillModList:NewMod("Condition:"..highestType.."IsHighestDamageType", "FLAG", true, "Config")
end

local hitRate = output.HitChance / 100 * (globalOutput.HitSpeed or globalOutput.Speed) * (skillData.dpsMultiplier or 1)

-- Calculate leech
local function getLeechInstances(amount, total)
if total == 0 then
Expand Down

0 comments on commit 25f4270

Please sign in to comment.