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
41 changes: 41 additions & 0 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,45 @@ describe("TestAttacks", function()
assert.are.equals(0, nonDurationSkill.skillModList:Sum("BASE", nonDurationSkill.skillCfg, "BaseFlagTest"))
assert.are.equals(1, nonDurationSkill.skillModList:Sum("BASE", nonDurationSkill.skillCfg, "NegatedBaseFlagTest"))
end)

it("applies Skills Socketed in your Helmet are Supported by to helmet gems only", function()
build.skillsTab:PasteSocketGroup("Slot: Helmet\nFireball 20/0 1\n")
runCallback("OnFrame")

local function hasSupport(name)
for _, effect in ipairs(build.calcsTab.mainEnv.player.mainSkill.supportList or { }) do
if effect.grantedEffect and effect.grantedEffect.name == name then
return true
end
end
return false
end

local baseDamage = build.calcsTab.mainOutput.AverageDamage
assert.is_false(hasSupport("Controlled Destruction"))

build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Prismatic Ring
Skills Socketed in your Helmet are Supported by level 20 Controlled Destruction
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")

assert.is_true(hasSupport("Controlled Destruction"))
assert.is_true(build.calcsTab.mainOutput.AverageDamage > baseDamage)

-- Gems socketed in other slots are not supported
newBuild()
build.skillsTab:PasteSocketGroup("Slot: Body Armour\nFireball 20/0 1\n")
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Prismatic Ring
Skills Socketed in your Helmet are Supported by level 20 Controlled Destruction
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")

assert.is_false(hasSupport("Controlled Destruction"))
end)
end)
Loading