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
33 changes: 0 additions & 33 deletions spec/System/TestGeneratedUniques_spec.lua

This file was deleted.

69 changes: 69 additions & 0 deletions spec/System/TestRareLike_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
describe("Veiled unique affix pools", function()
local function makeUnique(name)
for _, typeList in pairs(data.uniques) do
for _, raw in pairs(typeList) do
if raw:match("^%s*([^\r\n]+)") == name then
return new("Item"):Item(raw, "UNIQUE")
end
end
end
end

-- the mods the crafting UI would offer on this item, selected the same way
-- ItemsTab:UpdateAffixControl does
local function offeredMods(item)
local mods = { }
for modId, mod in pairs(item.affixes) do
if item:CanHaveMod(mod) then
mods[modId] = mod
end
end
return mods
end

local function offeredLines(item)
local lines = { }
for _, mod in pairs(offeredMods(item)) do
for _, line in ipairs(mod) do
table.insert(lines, line)
end
end
return table.concat(lines, "\n")
end

it("includes weapon-legal Catarina veiled mods on Cane of Kulemak", function()
local cane = makeUnique("Cane of Kulemak")
assert.is_not_nil(cane)
local lines = offeredLines(cane)
assert.is_not_nil(lines:find("+2 to Level of Socketed Support Gems", 1, true))
assert.is_not_nil(lines:find("+(5-8)% to Quality of Socketed Support Gems", 1, true))
assert.is_not_nil(lines:find("chance to Explode", 1, true))
end)

it("excludes weapon-illegal Catarina veiled mods from Cane of Kulemak", function()
local cane = makeUnique("Cane of Kulemak")
assert.is_not_nil(cane)
local lines = offeredLines(cane)
assert.is_nil(lines:find("maximum number of Spectres", 1, true))
assert.is_nil(lines:find("Minions are Aggressive", 1, true))
end)

it("only offers the base veiled pool on Paradoxica", function()
local item = makeUnique("Paradoxica")
assert.is_not_nil(item)
for modId, mod in pairs(offeredMods(item)) do
assert.is_true(mod.affix == "Chosen" or mod.affix == "of the Order",
modId .. " is a master signature mod")
end
end)

it("offers weapon-legal signature veiled mods on Replica Paradoxica", function()
local item = makeUnique("Replica Paradoxica")
assert.is_not_nil(item)
local lines = offeredLines(item)
assert.is_not_nil(lines:find("+(5-8)% to Quality of Socketed Support Gems", 1, true))
assert.is_not_nil(lines:find("chance to Explode", 1, true))
assert.is_nil(lines:find("maximum number of Spectres", 1, true))
assert.is_nil(lines:find("Minions are Aggressive", 1, true))
end)
end)
214 changes: 2 additions & 212 deletions src/Data/ModCache.lua

Large diffs are not rendered by default.

Loading
Loading