From 0ba2532d98b0f19f34e5a70c8bed689b8d6ecdfb Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Fri, 25 Aug 2023 01:57:11 +1000 Subject: [PATCH] Fix Strength of Blood not working The order of calculation in CalcDefence had to be moved so the leech stuff was done first --- src/Modules/CalcDefence.lua | 16 ++++++++-------- src/Modules/ModParser.lua | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Modules/CalcDefence.lua b/src/Modules/CalcDefence.lua index d9309b69ca..bd60657ead 100644 --- a/src/Modules/CalcDefence.lua +++ b/src/Modules/CalcDefence.lua @@ -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 @@ -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 diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 1c21f019d1..cd9762c7e3 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -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"),