Skip to content

Commit

Permalink
Fix Strength of Blood not working (#6478)
Browse files Browse the repository at this point in the history
The order of calculation in CalcDefence  had to be moved so the leech stuff was done first

Co-authored-by: LocalIdentity <[email protected]>
  • Loading branch information
LocalIdentity and LocalIdentity authored Aug 24, 2023
1 parent 6a0dc77 commit 2575cde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,6 @@ function calcs.defence(env, actor)
end
end

-- Damage Reduction
output.DamageReductionMax = modDB:Override(nil, "DamageReductionMax") or data.misc.DamageReductionCap
modDB:NewMod("ArmourAppliesToPhysicalDamageTaken", "BASE", 100)
for _, damageType in ipairs(dmgTypeList) do
output["Base"..damageType.."DamageReduction"] = m_min(m_max(0, modDB:Sum("BASE", nil, damageType.."DamageReduction")), output.DamageReductionMax)
output["Base"..damageType.."DamageReductionWhenHit"] = m_min(m_max(0, output["Base"..damageType.."DamageReduction"] + modDB:Sum("BASE", nil, damageType.."DamageReductionWhenHit")), output.DamageReductionMax)
end

-- Block
output.BlockChanceMax = modDB:Sum("BASE", nil, "BlockChanceMax")
output.BlockChanceOverCap = 0
Expand Down Expand Up @@ -1147,6 +1139,14 @@ function calcs.defence(env, actor)
end
end

-- Damage Reduction
output.DamageReductionMax = modDB:Override(nil, "DamageReductionMax") or data.misc.DamageReductionCap
modDB:NewMod("ArmourAppliesToPhysicalDamageTaken", "BASE", 100)
for _, damageType in ipairs(dmgTypeList) do
output["Base"..damageType.."DamageReduction"] = m_min(m_max(0, modDB:Sum("BASE", nil, damageType.."DamageReduction")), output.DamageReductionMax)
output["Base"..damageType.."DamageReductionWhenHit"] = m_min(m_max(0, output["Base"..damageType.."DamageReduction"] + modDB:Sum("BASE", nil, damageType.."DamageReductionWhenHit")), output.DamageReductionMax)
end

-- Miscellaneous: move speed, avoidance
output.MovementSpeedMod = modDB:Override(nil, "MovementSpeed") or calcLib.mod(modDB, nil, "MovementSpeed")
if modDB:Flag(nil, "MovementSpeedCannotBeBelowBase") then
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ local specialModList = {
return { mod("DamageTaken", "MORE", -num, { type = "PerStat", stat = "MaxLifeLeechRatePercent", div = tonumber(div) }) }
end,
["(%d+)%% additional physical damage reduction for every (%d+)%% life recovery per second from leech"] = function(num, _, div)
return { mod("PhysicalDamageReduction", "BASE", -num, { type = "PerStat", stat = "MaxLifeLeechRatePercent", div = tonumber(div) }) }
return { mod("PhysicalDamageReduction", "BASE", num, { type = "PerStat", stat = "MaxLifeLeechRatePercent", div = tonumber(div) }) }
end,
["modifiers to chance to suppress spell damage instead apply to chance to dodge spell hits at 50%% of their value"] = {
flag("ConvertSpellSuppressionToSpellDodge"),
Expand Down

0 comments on commit 2575cde

Please sign in to comment.