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
12 changes: 12 additions & 0 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,18 @@ describe("TestSkills", function()
assert.are.equals(3, grantedGroup.displaySkillList[1].activeEffect.level)
end)

it("applies item quality to skills granted by items", function()
local item = new("Item"):Item("New Item\nShrine Sceptre (Purity of Cold)\nQuality: 20\nImplicits: 1\nGrants Skill: Level 1 Purity of Ice")
build.itemsTab:AddItem(item, true)
build.itemsTab.slots["Weapon 1"]:SetSelItemId(item.id)
recalculate()

local grantedGroup = findGrantedGroup("sourceItem", item)
assert.is_not_nil(grantedGroup)
assert.are.equals("Purity of Ice", grantedGroup.gemList[1].nameSpec)
assert.are.equals(20, grantedGroup.gemList[1].quality)
end)

it("keeps both sets' default attacks and treats a quiver as unarmed", function()
local bow = new("Item"):Item("New Item\nCrude Bow")
local quiver = new("Item"):Item("New Item\nBroadhead Quiver")
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ function calcs.initEnv(build, mode, override, specEnv)
activeGemInstance.skillId = grantedSkill.skillId
activeGemInstance.gemId = nil
activeGemInstance.level = grantedSkill.level
activeGemInstance.quality = 0
activeGemInstance.quality = grantedSkill.sourceItem and grantedSkill.sourceItem.quality or 0
activeGemInstance.enabled = true
activeGemInstance.count = 1
activeGemInstance.corrupted = false
Expand Down
Loading