Skip to content

Commit 5eaf2b8

Browse files
authored
Add support for bleed and poison chance on critical hit calculation (#1058)
* Add support for crit-dependent bleed and poison chance calculation * Use copyTable for temporary critCfg to avoid unitended changes to the original --------- Co-authored-by: majochem <[email protected]>
1 parent cebd308 commit 5eaf2b8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Modules/CalcOffence.lua

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4603,12 +4603,15 @@ function calcs.offence(env, actor, activeSkill)
46034603
output[flatAilment.."ChanceOnCrit"] = 0
46044604
skillFlags["inflict"..flatAilment] = false
46054605
else
4606-
local base = skillModList:Sum("BASE", cfg, flatAilment.."Chance", "AilmentChance") + enemyDB:Sum("BASE", nil, "Self"..flatAilment.."Chance")
4607-
local inc = skillModList:Sum("INC", cfg, flatAilment.."Chance", "AilmentChance")
4608-
local more = skillModList:More(cfg, flatAilment.."Chance", "AilmentChance")
4609-
local chance = m_min(100, base * (1 + inc / 100) * more)
4610-
output[flatAilment.."ChanceOnHit"] = chance
4611-
output[flatAilment.."ChanceOnCrit"] = chance
4606+
for _, val in pairs({"OnHit", "OnCrit"}) do
4607+
local critCfg = copyTable(cfg,true)
4608+
critCfg.skillCond.CriticalStrike = val == "OnCrit" -- force crit config to be true for "OnCrit" chance calculation
4609+
local base = skillModList:Sum("BASE", critCfg, flatAilment.."Chance", "AilmentChance") + enemyDB:Sum("BASE", nil, "Self"..flatAilment.."Chance")
4610+
local inc = skillModList:Sum("INC", critCfg, flatAilment.."Chance", "AilmentChance")
4611+
local more = skillModList:More(critCfg, flatAilment.."Chance", "AilmentChance")
4612+
local chance = m_min(100, skillModList:Override(critCfg, flatAilment .. "Chance") or (base * (1 + inc / 100) * more))
4613+
output[flatAilment.."Chance" .. val] = chance
4614+
end
46124615
skillFlags["inflict"..flatAilment] = true
46134616
end
46144617
end

0 commit comments

Comments
 (0)