Skip to content
Open
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
39 changes: 39 additions & 0 deletions spec/System/TestDefence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,45 @@ describe("TestDefence", function()
return build.calcsTab.calcs.reducePoolsByDamage(nil, takenDamages, build.calcsTab.calcsEnv.player)
end

it("counts tree Defences in the Inc. from Tree stats", function()
local node, value
for _, candidate in pairs(build.spec.nodes) do
local mod = candidate.modList and candidate.modList[1]
if mod and #candidate.modList == 1 and mod.name == "Defences" and mod.type == "INC" and #mod == 0 then
node, value = candidate, mod.value
break
end
end
assert.is_not_nil(node)
node.alloc = true
build.spec.allocNodes[node.id] = node
build.buildFlag = true
runCallback("OnFrame")

local output = build.calcsTab.mainOutput
local actual = {
["Spec:ArmourInc"] = output["Spec:ArmourInc"],
["Spec:EvasionInc"] = output["Spec:EvasionInc"],
["Spec:EnergyShieldInc"] = output["Spec:EnergyShieldInc"],
}
for _, section in ipairs(LoadModule("Modules/CalcSections")) do
for _, row in ipairs(section[5][1].data) do
if row.label == "Inc. from Tree" and section[2] ~= "Life" and section[2] ~= "Mana" then
actual[section[2]] = formatCalcStr(row[1].format, build.calcsTab.mainEnv.player, row[1])
end
end
end
assert.are.same({
["Spec:ArmourInc"] = value,
["Spec:EvasionInc"] = value,
["Spec:EnergyShieldInc"] = value,
Armour = value.."%",
Evasion = value.."%",
EnergyShield = value.."%",
Ward = value.."%",
}, actual)
end)

it("attributes resistances inherited by minions to Bonemeld after loading a build", function()
build.skillsTab:PasteSocketGroup("Raise Zombie 20/0 1")
build.itemsTab:CreateDisplayItemFromRaw("Rarity: UNIQUE\nBonemeld\nMarble Amulet\nImplicits: 0\nMinions gain added Resistances equal to 50% of your Resistances")
Expand Down
8 changes: 4 additions & 4 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ return {
extra = "{0:output:EnergyShield}",
{ label = "Base from Armours", { format = "{0:output:Gear:EnergyShield}", { breakdown = "EnergyShield", gearOnly = true, skipSideBarIndex = true }, }, },
{ label = "Global Base", { format = "{0:mod:1}", { modName = "EnergyShield", modType = "BASE" }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = "EnergyShield", modType = "INC", modSource = "Tree" }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "EnergyShield", "Defences" }, modType = "INC", modSource = "Tree" }, }, },
{ label = "Total Increased", { format = "{0:mod:1}%", { modName = { "EnergyShield", "Defences" }, modType = "INC" }, }, },
{ label = "Total More", { format = "{0:mod:1}%", { modName = { "EnergyShield", "Defences" }, modType = "MORE" }, }, },
{ label = "Total", { format = "{0:output:EnergyShield}", { breakdown = "EnergyShield" }, }, },
Expand Down Expand Up @@ -1640,7 +1640,7 @@ return {
extra = "{0:output:Ward}",
{ label = "Base from Armours", { format = "{0:output:Gear:Ward}", { breakdown = "Ward", gearOnly = true }, }, },
{ label = "Global Base", { format = "{0:mod:1}", { modName = "Ward", modType = "BASE" }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = "Ward", modType = "INC", modSource = "Tree" }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Ward", "Defences" }, modType = "INC", modSource = "Tree" }, }, },
{ label = "Total Increased", { format = "{0:mod:1}%", { modName = { "Ward", "Defences" }, modType = "INC" }, }, },
{ label = "Total More", { format = "{0:mod:1}%", { modName = { "Ward", "Defences" }, modType = "MORE" }, }, },
{ label = "Total", { format = "{0:output:Ward}", { breakdown = "Ward" }, }, },
Expand Down Expand Up @@ -1675,7 +1675,7 @@ return {
extra = "{0:output:Armour}",
{ label = "Base from Armours", { format = "{0:output:Gear:Armour}", { breakdown = "Armour", gearOnly = true, skipSideBarIndex = true, }, }, },
{ label = "Global Base", { format = "{0:mod:1}", { modName = { "Armour", "ArmourAndEvasion" }, modType = "BASE" }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion" }, modType = "INC", modSource = "Tree", }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion", "Defences" }, modType = "INC", modSource = "Tree", }, }, },
{ label = "Total Increased", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion", "Defences" }, modType = "INC" }, }, },
{ label = "Total More", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion", "Defences" }, modType = "MORE" }, }, },
{ label = "Total", { format = "{0:output:Armour}", { breakdown = "Armour" }, }, },
Expand Down Expand Up @@ -1706,7 +1706,7 @@ return {
extra = "{0:output:Evasion}",
{ label = "Base from Armours", { format = "{0:output:Gear:Evasion}", { breakdown = "Evasion", gearOnly = true, skipSideBarIndex = true }, }, },
{ label = "Global Base", { format = "{0:mod:1}", { modName = { "Evasion", "ArmourAndEvasion" }, modType = "BASE" }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion" }, modType = "INC", modSource = "Tree" }, }, },
{ label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion", "Defences" }, modType = "INC", modSource = "Tree" }, }, },
{ label = "Total Increased", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion", "Defences" }, modType = "INC" }, }, },
{ label = "Total More", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion", "Defences" }, modType = "MORE" }, }, },
{ label = "Total", { format = "{0:output:Evasion}", { breakdown = "Evasion" }, }, },
Expand Down
6 changes: 3 additions & 3 deletions src/Modules/Calcs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ function calcs.buildOutput(build, mode)
}
output["Spec:LifeInc"] = env.modDB:Sum("INC", specCfg, "Life")
output["Spec:ManaInc"] = env.modDB:Sum("INC", specCfg, "Mana")
output["Spec:ArmourInc"] = env.modDB:Sum("INC", specCfg, "Armour", "ArmourAndEvasion")
output["Spec:EvasionInc"] = env.modDB:Sum("INC", specCfg, "Evasion", "ArmourAndEvasion")
output["Spec:EnergyShieldInc"] = env.modDB:Sum("INC", specCfg, "EnergyShield")
output["Spec:ArmourInc"] = env.modDB:Sum("INC", specCfg, "Armour", "ArmourAndEvasion", "Defences")
output["Spec:EvasionInc"] = env.modDB:Sum("INC", specCfg, "Evasion", "ArmourAndEvasion", "Defences")
output["Spec:EnergyShieldInc"] = env.modDB:Sum("INC", specCfg, "EnergyShield", "Defences")

env.skillsUsed = { }
for _, activeSkill in ipairs(env.player.activeSkillList) do
Expand Down
Loading