Skip to content

Commit 8a408fc

Browse files
LocalIdentityLocalIdentity
andauthored
Add support for Leopold's Applause (#1136)
Adds support for the negative resistance mod on the gloves Breakdowns are correct an update to use the negative pen cap Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 5887edb commit 8a408fc

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4687,7 +4687,7 @@ c["Your Dexterity is added to your Minions"]={{[1]={flags=0,keywordFlags=0,name=
46874687
c["Your Heavy Stun buildup empties 50% faster"]={nil,"Your Heavy Stun buildup empties 50% faster "}
46884688
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 "}
46894689
c["Your Hits are Crushing Blows"]={nil,"Your Hits are Crushing Blows "}
4690-
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% "}
4690+
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}
46914691
c["Your Hits can't be Evaded"]={{[1]={flags=0,keywordFlags=0,name="CannotBeEvaded",type="FLAG",value=true}},nil}
46924692
c["Your Life cannot change while you have Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="EternalLife",type="FLAG",value=true}},nil}
46934693
c["Your base Energy Shield Recharge Delay is 10 seconds"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldRechargeBase",type="OVERRIDE",value=10}},nil}

src/Modules/CalcBreakdown.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ local ipairs = ipairs
1010
local t_insert = table.insert
1111
local m_floor = math.floor
1212
local m_sqrt = math.sqrt
13+
local m_min = math.min
14+
local m_max = math.max
1315
local s_format = string.format
1416

1517
local breakdown = { }
@@ -108,7 +110,7 @@ function breakdown.area(base, areaMod, total, incBreakpoint, moreBreakpoint, red
108110
return out
109111
end
110112

111-
function breakdown.effMult(damageType, resist, pen, taken, mult, takenMore, sourceRes, useRes, invertChance)
113+
function breakdown.effMult(damageType, resist, pen, taken, mult, takenMore, sourceRes, useRes, invertChance, minPen)
112114
local out = { }
113115
local resistForm = (damageType == "Physical") and "physical damage reduction" or "resistance"
114116
local resistLabel = resistForm
@@ -132,10 +134,10 @@ function breakdown.effMult(damageType, resist, pen, taken, mult, takenMore, sour
132134
if not useRes then
133135
t_insert(out, s_format("x %d%% ^8(resistance ignored)", 0))
134136
t_insert(out, s_format("= %d%%", (0)))
135-
elseif resist <= 0 then
137+
elseif resist <= minPen then
136138
t_insert(out, s_format("= %d%% ^8(negative resistance unaffected by penetration)", resist))
137-
elseif (resist - pen) < 0 then
138-
t_insert(out, s_format("= %d%% ^8(penetration cannot bring resistances below 0)", 0))
139+
elseif (resist - pen) < minPen then
140+
t_insert(out, s_format("= %d%% ^8(penetration cannot bring resistances below %d%%)", m_max(resist - pen, minPen), minPen))
139141
else
140142
t_insert(out, s_format("= %d%%", (resist - pen)))
141143
end

src/Modules/CalcOffence.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3486,6 +3486,7 @@ function calcs.offence(env, actor, activeSkill)
34863486
-- Apply enemy resistances and damage taken modifiers
34873487
local resist = 0
34883488
local pen = 0
3489+
local minPen = 0
34893490
local sourceRes = damageType
34903491
local takenInc = enemyDB:Sum("INC", cfg, "DamageTaken", damageType.."DamageTaken")
34913492
local takenMore = enemyDB:More(cfg, "DamageTaken", damageType.."DamageTaken")
@@ -3549,6 +3550,7 @@ function calcs.offence(env, actor, activeSkill)
35493550
-- Update the penetration based on the element used
35503551
if isElemental[elementUsed] then
35513552
pen = skillModList:Sum("BASE", cfg, elementUsed.."Penetration", "ElementalPenetration")
3553+
minPen = skillModList:Sum("BASE", cfg, elementUsed.."PenetrationMinimum", "ElementalPenetrationMinimum")
35523554
elseif elementUsed == "Chaos" then
35533555
pen = skillModList:Sum("BASE", cfg, "ChaosPenetration")
35543556
end
@@ -3558,6 +3560,7 @@ function calcs.offence(env, actor, activeSkill)
35583560
resist = 0
35593561
end
35603562
pen = skillModList:Sum("BASE", cfg, damageType.."Penetration", "ElementalPenetration")
3563+
minPen = skillModList:Sum("BASE", cfg, damageType.."PenetrationMinimum", "ElementalPenetrationMinimum")
35613564
takenInc = takenInc + enemyDB:Sum("INC", cfg, "ElementalDamageTaken")
35623565
elseif damageType == "Chaos" then
35633566
pen = skillModList:Sum("BASE", cfg, "ChaosPenetration")
@@ -3584,7 +3587,7 @@ function calcs.offence(env, actor, activeSkill)
35843587
if skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then
35853588
effMult = effMult * (1 - resist / 100)
35863589
elseif useRes then
3587-
effMult = effMult * (1 - (resist > 0 and m_max(resist - pen, 0) or resist) / 100)
3590+
effMult = effMult * (1 - (resist > minPen and m_max(resist - pen, minPen) or resist) / 100)
35883591
end
35893592
damageTypeHitMin = damageTypeHitMin * effMult
35903593
damageTypeHitMax = damageTypeHitMax * effMult
@@ -3594,10 +3597,10 @@ function calcs.offence(env, actor, activeSkill)
35943597
end
35953598
if pass == 2 and breakdown and (effMult ~= 1 or sourceRes ~= damageType) and skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then
35963599
t_insert(breakdown[damageType], s_format("x %.3f ^8(effective DPS modifier)", effMult))
3597-
breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, 0, takenInc, effMult, takenMore, sourceRes, useRes, invertChance)
3598-
elseif pass == 2 and breakdown and (effMult ~= 1 or (resist - pen) < 0 or sourceRes ~= damageType) then
3600+
breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, 0, takenInc, effMult, takenMore, sourceRes, useRes, invertChance, minPen)
3601+
elseif pass == 2 and breakdown and (effMult ~= 1 or (resist - pen) < minPen or sourceRes ~= damageType) then
35993602
t_insert(breakdown[damageType], s_format("x %.3f ^8(effective DPS modifier)", effMult))
3600-
breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, pen, takenInc, effMult, takenMore, sourceRes, useRes, invertChance)
3603+
breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, pen, takenInc, effMult, takenMore, sourceRes, useRes, invertChance, minPen)
36013604
end
36023605
end
36033606
if pass == 2 and breakdown then

src/Modules/ModParser.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,9 +3223,8 @@ local specialModList = {
32233223
["trigger level (%d+) (.+) after spending a total of (%d+) mana"] = function(num, _, skill) return triggerExtraSkill(skill, num) end,
32243224
["consumes a void charge to trigger level (%d+) (.+) when you fire arrows"] = function(num, _, skill) return triggerExtraSkill(skill, num) end,
32253225
["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,
3226-
["your hits treat cold resistance as (%d+)%% higher than actual value"] = function(num) return {
3227-
mod("ColdPenetration", "BASE", -num, nil, 0, KeywordFlag.Hit),
3228-
} end,
3226+
["your hits treat cold resistance as (%d+)%% higher than actual value"] = function(num) return { mod("ColdPenetration", "BASE", -num, nil, 0, KeywordFlag.Hit) } end,
3227+
["your hits can penetrate elemental resistances down to a minimum of %-(%d+)%%"] = function(num) return { mod("ElementalPenetrationMinimum", "BASE", -num, nil, 0, KeywordFlag.Hit) } end,
32293228
-- Conversion
32303229
["increases and reductions to minion damage also affects? you"] = { flag("MinionDamageAppliesToPlayer"), mod("ImprovedMinionDamageAppliesToPlayer", "MAX", 100) },
32313230
["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 = {
62296228
end
62306229
end
62316230
end,
6231+
["(%d+)%% increased Effect of Notable Passive Skills in Radius$"] = function(num)
6232+
return function(node, out, data)
6233+
if node and node.type == "Notable" then
6234+
out:NewMod("JewelNotablePassiveSkillEffect", "INC", tonumber(num), data.modSource, { type = "GlobalEffect", effectType = "Global", unscalable = true })
6235+
out[#out].parsedLine = num.."% increased Effect"
6236+
end
6237+
end
6238+
end,
62326239
["^(%w+) Passive Skills in Radius also grant (.*)$"] = function(type, mod)
62336240
return function(node, out, data)
62346241
if node and (node.type == firstToUpper(type) or (node.type == "Normal" and not node.isAttribute and firstToUpper(type) == "Small")) then

0 commit comments

Comments
 (0)