Skip to content

Commit c499cad

Browse files
Add Foulborn Skin of the Lords with alt variant for keystone selection
Skin of the Lords is a tree-dependent generated unique, so it's built separately in buildFoulbornSkinOfTheLords() called from buildTreeDependentUniques(). Uses alt variant to give users two dropdowns: one for keystone selection, one for Foulborn mutation.
1 parent e3f5de7 commit c499cad

2 files changed

Lines changed: 99 additions & 0 deletions

File tree

spec/System/TestFoulborn_spec.lua

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,42 @@ describe("Foulborn generation", function()
7979
end
8080
end
8181
end)
82+
83+
it("generates Foulborn Skin of the Lords with alt variant", function()
84+
local raw
85+
for _, r in ipairs(data.uniques.generated) do
86+
if r:match("^Foulborn Skin of the Lords") then raw = r; break end
87+
end
88+
assert.is_truthy(raw, "Foulborn Skin of the Lords not found")
89+
assert.truthy(raw:match("Simple Robe"), "Missing base type")
90+
assert.truthy(raw:match("Has Alt Variant: true"), "Missing alt variant flag")
91+
assert.truthy(raw:match("Selected Alt Variant:"), "Missing selected alt variant")
92+
-- Should have keystone variants + Foulborn mutation variants
93+
local variantCount = 0
94+
for _ in raw:gmatch("Variant: ") do
95+
variantCount = variantCount + 1
96+
end
97+
assert.is_true(variantCount > 30, "Expected 30+ variants (keystones + mutations), got " .. variantCount)
98+
-- Should have base mods
99+
assert.truthy(raw:match("%+2 to Level of Socketed Gems"), "Missing base mod")
100+
assert.truthy(raw:match("100%% increased Global Defences"), "Missing base mod")
101+
-- Should have Foulborn mutation mods
102+
assert.truthy(raw:match("Elemental and Chaos Resistances"), "Missing Foulborn mutation mod")
103+
print(" Skin of the Lords variants: " .. variantCount)
104+
end)
105+
106+
it("parses Foulborn Skin of the Lords with alt variant", function()
107+
newBuild()
108+
local raw
109+
for _, r in ipairs(data.uniques.generated) do
110+
if r:match("^Foulborn Skin of the Lords") then raw = r; break end
111+
end
112+
assert.is_truthy(raw, "Foulborn Skin of the Lords not found")
113+
local item = new("Item", raw)
114+
assert.is_true(item.foulborn, "foulborn flag not set")
115+
assert.are.equals("Simple Robe", item.baseName)
116+
assert.is_true(item.hasAltVariant, "Alt variant not parsed")
117+
assert.is_true(#item.variantList > 30, "Not enough variants parsed")
118+
print(" Parsed variants: " .. #item.variantList .. ", hasAltVariant: " .. tostring(item.hasAltVariant))
119+
end)
82120
end)

src/Data/Uniques/Special/Generated.lua

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ table.insert(data.uniques.generated, table.concat(boundByDestiny, "\n"))
775775
function buildTreeDependentUniques(tree)
776776
buildForbidden(tree.classNotables)
777777
buildKeystoneItems(tree.keystoneMap)
778+
buildFoulbornSkinOfTheLords(tree.keystoneMap)
778779
end
779780

780781
function buildForbidden(classNotables)
@@ -892,6 +893,66 @@ function buildKeystoneItems(keystoneMap)
892893
table.insert(data.uniques.generated, table.concat(impossibleEscape, "\n"))
893894
end
894895

896+
function buildFoulbornSkinOfTheLords(keystoneMap)
897+
if not data.foulbornMap or not data.foulbornMap["Skin of the Lords"] then return end
898+
899+
local fbMods = data.foulbornMap["Skin of the Lords"]
900+
local excludedPassiveKeystones = {
901+
"Chaos Inoculation",
902+
"Necromantic Aegis",
903+
}
904+
905+
local isKeystoneNative = function(node) return node.isKeystone and not node.isBlighted and node.x ~= nil end
906+
907+
local keystones = {}
908+
local seen = {}
909+
for _, node in pairs(keystoneMap) do
910+
if isKeystoneNative(node) and not isValueInArray(excludedPassiveKeystones, node.name) and not seen[node] then
911+
table.insert(keystones, node.name)
912+
seen[node] = true
913+
end
914+
end
915+
table.sort(keystones)
916+
917+
local item = {}
918+
table.insert(item, "Foulborn Skin of the Lords")
919+
table.insert(item, "Simple Robe")
920+
table.insert(item, "Has Alt Variant: true")
921+
922+
-- Variant declarations: keystones first, then Foulborn mutation mods
923+
for _, name in ipairs(keystones) do
924+
table.insert(item, "Variant: " .. name)
925+
end
926+
for _, modLine in ipairs(fbMods) do
927+
table.insert(item, "Variant: " .. modLine)
928+
end
929+
930+
-- Default selections: first keystone + first Foulborn mutation
931+
table.insert(item, "Selected Variant: 1")
932+
table.insert(item, "Selected Alt Variant: " .. (#keystones + 1))
933+
934+
table.insert(item, "Implicits: 0")
935+
936+
-- Base mods (same as regular Skin of the Lords)
937+
table.insert(item, "Sockets cannot be modified")
938+
table.insert(item, "+2 to Level of Socketed Gems")
939+
table.insert(item, "100% increased Global Defences")
940+
table.insert(item, "You can only Socket Corrupted Gems in this item")
941+
942+
-- Keystone mods (variant-tagged)
943+
for index, name in ipairs(keystones) do
944+
table.insert(item, "{variant:" .. index .. "}" .. name)
945+
end
946+
947+
-- Foulborn mutation mods (variant-tagged, after keystones)
948+
for idx, modLine in ipairs(fbMods) do
949+
table.insert(item, "{variant:" .. (#keystones + idx) .. "}" .. modLine)
950+
end
951+
952+
table.insert(item, "Corrupted")
953+
table.insert(data.uniques.generated, table.concat(item, "\n"))
954+
end
955+
895956
-- That Which Was Taken
896957
local thatWhichWasTaken = {
897958
[[

0 commit comments

Comments
 (0)