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

Fixed interaction between block replacement effect from Determined Survivor and Necromantic Aegis #8417

Merged
Changes from 4 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
7 changes: 6 additions & 1 deletion src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,16 @@ function calcs.defence(env, actor)
local baseBlockChance = 0
if actor.itemList["Weapon 2"] and actor.itemList["Weapon 2"].armourData then
baseBlockChance = baseBlockChance + actor.itemList["Weapon 2"].armourData.BlockChance

end
if actor.itemList["Weapon 3"] and actor.itemList["Weapon 3"].armourData then
baseBlockChance = baseBlockChance + actor.itemList["Weapon 3"].armourData.BlockChance
end
output.ShieldBlockChance = baseBlockChance
baseBlockChance = modDB:Override(nil, "ReplaceShieldBlock") or baseBlockChance

-- Apply player block overrides if Necromantic Aegis allocated
baseBlockChance = actor == env.minion and env.keystonesAdded["Necromantic Aegis"] and env.player.modDB:Override(nil, "ReplaceShieldBlock") or output.ShieldBlockChance

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry didn't see that it was used below. This should be correct now.

Suggested change
baseBlockChance = modDB:Override(nil, "ReplaceShieldBlock") or baseBlockChance
-- Apply player block overrides if Necromantic Aegis allocated
baseBlockChance = actor == env.minion and env.keystonesAdded["Necromantic Aegis"] and env.player.modDB:Override(nil, "ReplaceShieldBlock") or output.ShieldBlockChance
output.ShieldBlockChance = baseBlockChance
baseBlockChance = modDB:Override(nil, "ReplaceShieldBlock") or baseBlockChance
-- Apply player block overrides if Necromantic Aegis allocated
baseBlockChance = actor == env.minion and env.keystonesAdded["Necromantic Aegis"] and env.player.modDB:Override(nil, "ReplaceShieldBlock") or baseBlockChance

if modDB:Flag(nil, "BlockAttackChanceIsEqualToParent") then
output.BlockChance = m_min(actor.parent.output.BlockChance, output.BlockChanceMax)
elseif modDB:Flag(nil, "BlockAttackChanceIsEqualToPartyMember") then
Expand All @@ -533,6 +537,7 @@ function calcs.defence(env, actor)
output.BlockChance = m_min(totalBlockChance, output.BlockChanceMax)
output.BlockChanceOverCap = m_max(0, totalBlockChance - output.BlockChanceMax)
end

output.ProjectileBlockChance = m_min(output.BlockChance + modDB:Sum("BASE", nil, "ProjectileBlockChance") * calcLib.mod(modDB, nil, "BlockChance"), output.BlockChanceMax)
if modDB:Flag(nil, "SpellBlockChanceMaxIsBlockChanceMax") then
output.SpellBlockChanceMax = output.BlockChanceMax
Expand Down
Loading