Skip to content

Add support for Leopold's Applause #1136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
10 changes: 6 additions & 4 deletions src/Modules/CalcBreakdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { }
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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
Expand All @@ -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
Expand Down
13 changes: 10 additions & 3 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down