From 858e10649150985fe2910ac67d6e195b9ebd366b Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Wed, 21 May 2025 14:17:32 +1000 Subject: [PATCH] Add support for Leopold's Applause Adds support for the negative resistance mod on the gloves Breakdowns are correct an update to use the negative pen cap --- src/Data/ModCache.lua | 2 +- src/Modules/CalcBreakdown.lua | 10 ++++++---- src/Modules/CalcOffence.lua | 11 +++++++---- src/Modules/ModParser.lua | 13 ++++++++++--- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 946a617467..783e0051f3 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -4687,7 +4687,7 @@ c["Your Dexterity is added to your Minions"]={{[1]={flags=0,keywordFlags=0,name= c["Your Heavy Stun buildup empties 50% faster"]={nil,"Your Heavy Stun buildup empties 50% faster "} c["Your Heavy Stun buildup empties 50% faster if you've successfully Parried Recently"]={nil,"Your Heavy Stun buildup empties 50% faster if you've successfully Parried Recently "} c["Your Hits are Crushing Blows"]={nil,"Your Hits are Crushing Blows "} -c["Your Hits can Penetrate Elemental Resistances down to a minimum of -50%"]={nil,"Your Hits can Penetrate Elemental Resistances down to a minimum of -50% "} +c["Your Hits can Penetrate Elemental Resistances down to a minimum of -50%"]={{[1]={flags=0,keywordFlags=262144,name="ElementalPenetrationMinimum",type="BASE",value=-50}},nil} c["Your Hits can't be Evaded"]={{[1]={flags=0,keywordFlags=0,name="CannotBeEvaded",type="FLAG",value=true}},nil} c["Your Life cannot change while you have Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="EternalLife",type="FLAG",value=true}},nil} c["Your base Energy Shield Recharge Delay is 10 seconds"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldRechargeBase",type="OVERRIDE",value=10}},nil} diff --git a/src/Modules/CalcBreakdown.lua b/src/Modules/CalcBreakdown.lua index 587b782d66..c2740d5dcd 100644 --- a/src/Modules/CalcBreakdown.lua +++ b/src/Modules/CalcBreakdown.lua @@ -10,6 +10,8 @@ local ipairs = ipairs local t_insert = table.insert local m_floor = math.floor local m_sqrt = math.sqrt +local m_min = math.min +local m_max = math.max local s_format = string.format local breakdown = { } @@ -108,7 +110,7 @@ function breakdown.area(base, areaMod, total, incBreakpoint, moreBreakpoint, red return out end -function breakdown.effMult(damageType, resist, pen, taken, mult, takenMore, sourceRes, useRes, invertChance) +function breakdown.effMult(damageType, resist, pen, taken, mult, takenMore, sourceRes, useRes, invertChance, minPen) local out = { } local resistForm = (damageType == "Physical") and "physical damage reduction" or "resistance" local resistLabel = resistForm @@ -132,10 +134,10 @@ function breakdown.effMult(damageType, resist, pen, taken, mult, takenMore, sour if not useRes then t_insert(out, s_format("x %d%% ^8(resistance ignored)", 0)) t_insert(out, s_format("= %d%%", (0))) - elseif resist <= 0 then + elseif resist <= minPen then t_insert(out, s_format("= %d%% ^8(negative resistance unaffected by penetration)", resist)) - elseif (resist - pen) < 0 then - t_insert(out, s_format("= %d%% ^8(penetration cannot bring resistances below 0)", 0)) + elseif (resist - pen) < minPen then + t_insert(out, s_format("= %d%% ^8(penetration cannot bring resistances below %d%%)", m_max(resist - pen, minPen), minPen)) else t_insert(out, s_format("= %d%%", (resist - pen))) end diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index 3b1a1f280a..bed3db2eaa 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -3482,6 +3482,7 @@ function calcs.offence(env, actor, activeSkill) -- Apply enemy resistances and damage taken modifiers local resist = 0 local pen = 0 + local minPen = 0 local sourceRes = damageType local takenInc = enemyDB:Sum("INC", cfg, "DamageTaken", damageType.."DamageTaken") local takenMore = enemyDB:More(cfg, "DamageTaken", damageType.."DamageTaken") @@ -3545,6 +3546,7 @@ function calcs.offence(env, actor, activeSkill) -- Update the penetration based on the element used if isElemental[elementUsed] then pen = skillModList:Sum("BASE", cfg, elementUsed.."Penetration", "ElementalPenetration") + minPen = skillModList:Sum("BASE", cfg, elementUsed.."PenetrationMinimum", "ElementalPenetrationMinimum") elseif elementUsed == "Chaos" then pen = skillModList:Sum("BASE", cfg, "ChaosPenetration") end @@ -3554,6 +3556,7 @@ function calcs.offence(env, actor, activeSkill) resist = 0 end pen = skillModList:Sum("BASE", cfg, damageType.."Penetration", "ElementalPenetration") + minPen = skillModList:Sum("BASE", cfg, damageType.."PenetrationMinimum", "ElementalPenetrationMinimum") takenInc = takenInc + enemyDB:Sum("INC", cfg, "ElementalDamageTaken") elseif damageType == "Chaos" then pen = skillModList:Sum("BASE", cfg, "ChaosPenetration") @@ -3580,7 +3583,7 @@ function calcs.offence(env, actor, activeSkill) if skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then effMult = effMult * (1 - resist / 100) elseif useRes then - effMult = effMult * (1 - (resist > 0 and m_max(resist - pen, 0) or resist) / 100) + effMult = effMult * (1 - (resist > minPen and m_max(resist - pen, minPen) or resist) / 100) end damageTypeHitMin = damageTypeHitMin * effMult damageTypeHitMax = damageTypeHitMax * effMult @@ -3590,10 +3593,10 @@ function calcs.offence(env, actor, activeSkill) end if pass == 2 and breakdown and (effMult ~= 1 or sourceRes ~= damageType) and skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then t_insert(breakdown[damageType], s_format("x %.3f ^8(effective DPS modifier)", effMult)) - breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, 0, takenInc, effMult, takenMore, sourceRes, useRes, invertChance) - elseif pass == 2 and breakdown and (effMult ~= 1 or (resist - pen) < 0 or sourceRes ~= damageType) then + breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, 0, takenInc, effMult, takenMore, sourceRes, useRes, invertChance, minPen) + elseif pass == 2 and breakdown and (effMult ~= 1 or (resist - pen) < minPen or sourceRes ~= damageType) then t_insert(breakdown[damageType], s_format("x %.3f ^8(effective DPS modifier)", effMult)) - breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, pen, takenInc, effMult, takenMore, sourceRes, useRes, invertChance) + breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, pen, takenInc, effMult, takenMore, sourceRes, useRes, invertChance, minPen) end end if pass == 2 and breakdown then diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index e72fa935a0..c656e9a270 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -3223,9 +3223,8 @@ local specialModList = { ["trigger level (%d+) (.+) after spending a total of (%d+) mana"] = function(num, _, skill) return triggerExtraSkill(skill, num) end, ["consumes a void charge to trigger level (%d+) (.+) when you fire arrows"] = function(num, _, skill) return triggerExtraSkill(skill, num) end, ["consumes a void charge to trigger level (%d+) (.+) when you fire arrows with a non%-triggered skill"] = function(num, _, skill) return triggerExtraSkill(skill, num) end, - ["your hits treat cold resistance as (%d+)%% higher than actual value"] = function(num) return { - mod("ColdPenetration", "BASE", -num, nil, 0, KeywordFlag.Hit), - } end, + ["your hits treat cold resistance as (%d+)%% higher than actual value"] = function(num) return { mod("ColdPenetration", "BASE", -num, nil, 0, KeywordFlag.Hit) } end, + ["your hits can penetrate elemental resistances down to a minimum of %-(%d+)%%"] = function(num) return { mod("ElementalPenetrationMinimum", "BASE", -num, nil, 0, KeywordFlag.Hit) } end, -- Conversion ["increases and reductions to minion damage also affects? you"] = { flag("MinionDamageAppliesToPlayer"), mod("ImprovedMinionDamageAppliesToPlayer", "MAX", 100) }, ["increases and reductions to minion damage also affects? you at (%d+)%% of their value"] = function(num) return { flag("MinionDamageAppliesToPlayer"), mod("ImprovedMinionDamageAppliesToPlayer", "MAX", num) } end, @@ -6229,6 +6228,14 @@ local jewelOtherFuncs = { end end end, + ["(%d+)%% increased Effect of Notable Passive Skills in Radius$"] = function(num) + return function(node, out, data) + if node and node.type == "Notable" then + out:NewMod("JewelNotablePassiveSkillEffect", "INC", tonumber(num), data.modSource, { type = "GlobalEffect", effectType = "Global", unscalable = true }) + out[#out].parsedLine = num.."% increased Effect" + end + end + end, ["^(%w+) Passive Skills in Radius also grant (.*)$"] = function(type, mod) return function(node, out, data) if node and (node.type == firstToUpper(type) or (node.type == "Normal" and not node.isAttribute and firstToUpper(type) == "Small")) then