Skip to content

Commit 8497ed7

Browse files
committed
Fixed interaction between block replacement effect from ascendancy with Necromantic Aegis
Fixes interaction between Block Replacement effect granted from Gladiator's "Determined Survivor" ascendency with Necromantic Aegis.
1 parent d3ae425 commit 8497ed7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Modules/CalcDefence.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,19 @@ function calcs.defence(env, actor)
516516
local baseBlockChance = 0
517517
if actor.itemList["Weapon 2"] and actor.itemList["Weapon 2"].armourData then
518518
baseBlockChance = baseBlockChance + actor.itemList["Weapon 2"].armourData.BlockChance
519+
519520
end
520521
if actor.itemList["Weapon 3"] and actor.itemList["Weapon 3"].armourData then
521522
baseBlockChance = baseBlockChance + actor.itemList["Weapon 3"].armourData.BlockChance
522-
end
523+
end
523524
output.ShieldBlockChance = baseBlockChance
525+
-- Override from Ascendancy or other sources
524526
baseBlockChance = modDB:Override(nil, "ReplaceShieldBlock") or baseBlockChance
527+
-- Bandage fix for interaction of block replacement effects with Necromantic Aegis
528+
if actor == env.minion and env.player.modDB:Override(nil, "ReplaceShieldBlock") and env.allocNodes[45175] then
529+
baseBlockChance = env.player.modDB:Override(nil, "ReplaceShieldBlock")
530+
end
531+
525532
if modDB:Flag(nil, "BlockAttackChanceIsEqualToParent") then
526533
output.BlockChance = m_min(actor.parent.output.BlockChance, output.BlockChanceMax)
527534
elseif modDB:Flag(nil, "BlockAttackChanceIsEqualToPartyMember") then
@@ -533,6 +540,7 @@ function calcs.defence(env, actor)
533540
output.BlockChance = m_min(totalBlockChance, output.BlockChanceMax)
534541
output.BlockChanceOverCap = m_max(0, totalBlockChance - output.BlockChanceMax)
535542
end
543+
536544
output.ProjectileBlockChance = m_min(output.BlockChance + modDB:Sum("BASE", nil, "ProjectileBlockChance") * calcLib.mod(modDB, nil, "BlockChance"), output.BlockChanceMax)
537545
if modDB:Flag(nil, "SpellBlockChanceMaxIsBlockChanceMax") then
538546
output.SpellBlockChanceMax = output.BlockChanceMax

0 commit comments

Comments
 (0)