Skip to content
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

Fix negative bypass being ignored #6992

Merged
merged 2 commits into from
Dec 11, 2023
Merged
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
13 changes: 13 additions & 0 deletions spec/System/TestDefence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,19 @@ describe("TestDefence", function()
end)

it("energy shield bypass tests #pet", function()
-- Mastery
build.configTab.input.customMods = [[
+40 to maximum life
+200 to energy shield
50% of chaos damage taken does not bypass energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(300, build.calcsTab.calcsOutput.FireMaximumHitTaken)
assert.are.equals(200, build.calcsTab.calcsOutput.ChaosMaximumHitTaken)

-- Negative overrides positive
build.configTab.input.customMods = [[
+40 to maximum life
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ function calcs.buildDefenceEstimations(env, actor)
output[damageType.."EnergyShieldBypass"] = 100
output.AnyBypass = true
else
output[damageType.."EnergyShieldBypass"] = m_max(modDB:Sum("BASE", nil, damageType.."EnergyShieldBypass") or 0, modDB:Sum("OVERRIDE", nil, damageType.."EnergyShieldBypass") or 0)
output[damageType.."EnergyShieldBypass"] = modDB:Override(nil, damageType.."EnergyShieldBypass") or modDB:Sum("BASE", nil, damageType.."EnergyShieldBypass") or 0
if output[damageType.."EnergyShieldBypass"] ~= 0 then
output.AnyBypass = true
end
Expand Down