Skip to content
Closed
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
36 changes: 35 additions & 1 deletion spec/System/TestDefence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -527,4 +561,4 @@ describe("TestDefence", function()
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
end)
end)
end)
4 changes: 4 additions & 0 deletions src/Data/SkillStatMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
--
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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") },
Expand Down