From 417803bcd9ae5a677829e516e83278427982a5b7 Mon Sep 17 00:00:00 2001 From: unrealdreamz <132005717+unrealdreamz@users.noreply.github.com> Date: Mon, 18 May 2026 21:33:39 -0400 Subject: [PATCH] Support Sorcery Ward aegis calculation --- spec/System/TestDefence_spec.lua | 36 +++++++++++++++++++++++++++++++- src/Data/SkillStatMap.lua | 4 ++++ src/Modules/ModParser.lua | 3 +++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/spec/System/TestDefence_spec.lua b/spec/System/TestDefence_spec.lua index 0f8aa0bc74..0ce0f02216 100644 --- a/spec/System/TestDefence_spec.lua +++ b/spec/System/TestDefence_spec.lua @@ -30,6 +30,40 @@ describe("TestDefence", function() return build.calcsTab.calcs.reducePoolsByDamage(nil, takenDamages, build.calcsTab.calcsEnv.player) end + it("Sorcery Ward grants elemental aegis from armour and evasion", function() + build.configTab.input.enemyIsBoss = "None" + build.configTab.input.customMods = "\z + +10000 to Armour\n\z + +5000 to Evasion Rating\n\z + 50% increased effect of Sorcery Ward\n\z + " + build.configTab:BuildModList() + build.skillsTab:PasteSocketGroup("Sorcery Ward 1/0 1") + runCallback("OnFrame") + + local output = build.calcsTab.calcsOutput + local expectedAegis = math.ceil((output.Armour + output.Evasion) * 0.45) + assert.are.equals(expectedAegis, output.sharedElementalAegis) + assert.are.equals(0, output.sharedAegis) + end) + + it("Sorcery Ward all-damage barrier uses shared aegis", function() + build.configTab.input.enemyIsBoss = "None" + build.configTab.input.customMods = "\z + +10000 to Armour\n\z + +5000 to Evasion Rating\n\z + Sorcery Ward's Barrier can also take Physical and Chaos Damage from Hits\n\z + " + build.configTab:BuildModList() + build.skillsTab:PasteSocketGroup("Sorcery Ward 1/0 1") + runCallback("OnFrame") + + local output = build.calcsTab.calcsOutput + local expectedAegis = math.ceil((output.Armour + output.Evasion) * 0.30) + assert.are.equals(0, output.sharedElementalAegis) + assert.are.equals(expectedAegis, output.sharedAegis) + end) + it("no armour max hits", function() build.configTab.input.enemyIsBoss = "None" build.configTab.input.customMods = "" @@ -527,4 +561,4 @@ describe("TestDefence", function() assert.are.equals(0, floor(poolsRemaining.Life)) assert.are.equals(0, floor(poolsRemaining.OverkillDamage)) end) -end) \ No newline at end of file +end) diff --git a/src/Data/SkillStatMap.lua b/src/Data/SkillStatMap.lua index 78811af1a6..c997b5a906 100644 --- a/src/Data/SkillStatMap.lua +++ b/src/Data/SkillStatMap.lua @@ -541,6 +541,10 @@ return { ["recover_%_maximum_life_on_cull"] = { mod("LifeOnKill", "BASE", nil, 0, 0, { type = "PercentStat", stat = "Life", percent = 1 }), }, +["aegis_unique_shield_max_value_from_%_armour_evasion"] = { + mod("ElementalAegisValue", "MAX", nil, 0, 0, { type = "Condition", var = "SorceryWardAllDamageTypes", neg = true }, { type = "PercentStat", statList = { "Armour", "Evasion" }, percent = 1 }, { type = "GlobalEffect", effectType = "Buff" }), + mod("AegisValue", "MAX", nil, 0, 0, { type = "Condition", var = "SorceryWardAllDamageTypes" }, { type = "PercentStat", statList = { "Armour", "Evasion" }, percent = 1 }, { type = "GlobalEffect", effectType = "Buff" }), +}, -- -- Offensive modifiers -- diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index cc20d66c35..e4159e9195 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -2988,6 +2988,9 @@ local specialModList = { flag("EnableSkill", { type = "SkillName", skillId = "Primal Aegis" }), }, ["primal aegis can take (%d+) elemental damage per allocated notable passive skill"] = function(num) return { mod("ElementalAegisValue", "MAX", num, 0, 0, { type = "Multiplier", var = "AllocatedNotable" }, { type = "GlobalEffect", effectType = "Buff", unscalable = true }) } end, + ["(%d+)%% increased effect of sorcery ward"] = function(num) return { mod("SorceryWardEffect", "INC", num) } end, + ["(%d+)%% reduced effect of sorcery ward"] = function(num) return { mod("SorceryWardEffect", "INC", -num) } end, + ["sorcery ward's barrier can also take physical and chaos damage from hits"] = { flag("Condition:SorceryWardAllDamageTypes") }, -- Gladiator ["chance to block spell damage is equal to chance to block attack damage"] = { flag("SpellBlockChanceIsBlockChance") }, ["maximum chance to block spell damage is equal to maximum chance to block attack damage"] = { flag("SpellBlockChanceMaxIsBlockChanceMax") },