Skip to content

Commit bfee69d

Browse files
committed
Adjust elemental inversion cap after testing
1 parent 5606cc6 commit bfee69d

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎spec/System/TestSkills_spec.lua‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,13 @@ describe("TestSkills", function()
626626
runCallback("OnFrame")
627627
return build.calcsTab.calcsOutput.FireEffMult
628628
end
629-
local maxResist = data.misc.EnemyMaxResist
630-
631-
-- -150% inverted is 150%, but it cannot go above the enemy's maximum resistance,
632-
-- so hits deal reduced damage instead of negative damage.
629+
local maxResist = 100
630+
-- -150% inverted is 150%, but it cannot go above 100% resistance,
631+
-- so hits deal no damage instead of negative damage.
633632
assert.are.near(1 - maxResist / 100, effMultWith("Hits have 100% chance to treat Enemy Monster Elemental Resistance values as inverted"), 1e-9)
634-
assert.True(build.calcsTab.mainOutput.TotalDPS > 0)
633+
assert.are.near(build.calcsTab.mainOutput.TotalDPS, 0, 1e-9)
635634
local breakdownText = table.concat(build.calcsTab.calcsEnv.player.breakdown.FireEffMult, "\n")
636-
assert.is_truthy(breakdownText:match(maxResist.."%% %^8%(inverted hit after penetration, capped at maximum resistance%)"))
635+
assert.is_truthy(breakdownText:match(maxResist.."%% %^8%(inverted hit after penetration, capped at 100%% resistance%)"))
637636

638637
-- Penetration applies after the cap
639638
assert.are.near(1 - (maxResist - 20) / 100, effMultWith("Hits have 100% chance to treat Enemy Monster Elemental Resistance values as inverted\nDamage Penetrates 20% of Enemy Fire Resistance"), 1e-9)

‎src/Modules/CalcBreakdown.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ return function(modDB, output, actor)
127127
local invertedHitResist = invertedResist - pen
128128
t_insert(out, "Effective resistance:")
129129
t_insert(out, s_format("%g%% ^8(non-inverted hit after penetration)", normalResist))
130-
t_insert(out, s_format("%g%% ^8(inverted hit after penetration%s)", invertedHitResist, invertedResist ~= -resist and ", capped at maximum resistance" or ""))
130+
t_insert(out, s_format("%g%% ^8(inverted hit after penetration%s)", invertedHitResist, invertedResist ~= -resist and ", capped at 100% resistance" or ""))
131131
t_insert(out, s_format("= %g%% ^8(weighted average from %.0f%% inversion chance)", effectiveResist, invertChance * 100))
132132
elseif pen ~= 0 or not useRes then
133133
t_insert(out, "Effective resistance:")

‎src/Modules/CalcOffence.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3615,7 +3615,7 @@ function calcs.offence(env, actor, activeSkill)
36153615
local invertChanceChaos = m_max(m_min(skillModList:Sum("CHANCE", cfg, "HitsInvertChaosResChance"), 1), 0)
36163616
local invertChance = (isElemental[damageType] and invertChanceEle) or (damageType == "Chaos" and invertChanceChaos) or 0
36173617
-- An inverted negative resistance is still capped by the enemy's maximum resistance
3618-
local invertedResist = invertChance > 0 and m_min(-resist, calcEnemyMaxResist(sourceRes)) or -resist
3618+
local invertedResist = invertChance > 0 and m_min(-resist, 100) or -resist
36193619
sourceRes = env.modDB:Flag(nil, "Enemy"..sourceRes.."ResistEqualToYours") and "Your "..sourceRes.." Resistance" or (env.partyMembers.modDB:Flag(nil, "Enemy"..sourceRes.."ResistEqualToYours") and "Party Member "..sourceRes.." Resistance" or sourceRes)
36203620
if skillFlags.projectile then
36213621
takenInc = takenInc + enemyDB:Sum("INC", nil, "ProjectileDamageTaken")

0 commit comments

Comments
 (0)