Skip to content

Commit 4f25340

Browse files
Fixed interaction between block replacement effect from Determined Survivor and Necromantic Aegis (#8417)
* 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. * Improved Changed to allow for more flexibility. Co-authored-by: Paliak <91493239+Paliak@users.noreply.github.com> * Wrong Variable Needs to be baseBlockChance or else it doesn't have the complete 50% block chance granted from Ascendency. * Update CalcDefence.lua * Corrected Affected Variables. * Last Fix --------- Co-authored-by: Paliak <91493239+Paliak@users.noreply.github.com>
1 parent 195006f commit 4f25340

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Modules/CalcDefence.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,17 @@ function calcs.defence(env, actor)
542542
local baseBlockChance = 0
543543
if actor.itemList["Weapon 2"] and actor.itemList["Weapon 2"].armourData then
544544
baseBlockChance = baseBlockChance + actor.itemList["Weapon 2"].armourData.BlockChance
545+
545546
end
546547
if actor.itemList["Weapon 3"] and actor.itemList["Weapon 3"].armourData then
547548
baseBlockChance = baseBlockChance + actor.itemList["Weapon 3"].armourData.BlockChance
548549
end
549550
output.ShieldBlockChance = baseBlockChance
550551
baseBlockChance = modDB:Override(nil, "ReplaceShieldBlock") or baseBlockChance
552+
553+
-- Apply player block overrides if Necromantic Aegis allocated
554+
baseBlockChance = actor == env.minion and env.keystonesAdded["Necromantic Aegis"] and env.player.modDB:Override(nil, "ReplaceShieldBlock") or baseBlockChance
555+
551556
if modDB:Flag(nil, "BlockAttackChanceIsEqualToParent") then
552557
output.BlockChance = m_min(actor.parent.output.BlockChance, output.BlockChanceMax)
553558
elseif modDB:Flag(nil, "BlockAttackChanceIsEqualToPartyMember") then
@@ -559,6 +564,7 @@ function calcs.defence(env, actor)
559564
output.BlockChance = m_min(totalBlockChance, output.BlockChanceMax)
560565
output.BlockChanceOverCap = m_max(0, totalBlockChance - output.BlockChanceMax)
561566
end
567+
562568
output.ProjectileBlockChance = m_min(output.BlockChance + modDB:Sum("BASE", nil, "ProjectileBlockChance") * calcLib.mod(modDB, nil, "BlockChance"), output.BlockChanceMax)
563569
if modDB:Flag(nil, "SpellBlockChanceMaxIsBlockChanceMax") then
564570
output.SpellBlockChanceMax = output.BlockChanceMax

0 commit comments

Comments
 (0)