Skip to content
Merged
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
20 changes: 10 additions & 10 deletions spec/System/TestSocketables_spec.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
describe("TestSocketables", function()

Check warning on line 1 in spec/System/TestSocketables_spec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Socketables)
before_each(function()
newBuild()
end)

it("ModRunes matches Data/Soulcores", function()

Check warning on line 6 in spec/System/TestSocketables_spec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Soulcores)
local modRunes = LoadModule("../src/Data/ModRunes")
local soulcores = {}
LoadModule("../src/Data/Bases/soulcore", soulcores)
local soulCores = {}
LoadModule("../src/Data/Bases/soulcore", soulCores)
local soulCoreCount = 0
for name, _ in pairs(soulcores) do
for name, _ in pairs(soulCores) do
assert.is_not.equals(modRunes[name], nil)
soulCoreCount = soulCoreCount + 1
end

local modRunesCount = 0
for name, _ in pairs(modRunes) do
assert.is_not.equals(soulcores[name], nil)
assert.is_not.equals(soulCores[name], nil)
modRunesCount = modRunesCount + 1
end
-- Final check that Bases/soulcore has same number of entries as ModRunes
Expand All @@ -33,8 +33,8 @@
if runeSlotType == slotType then
-- Need to add an entry of the name for each mod line for tests
for _, _ in ipairs(mods) do
table.insert(names, name)
end
table.insert(names, name)
end
end
end
end
Expand All @@ -49,11 +49,11 @@

-- Create an ItemTab and add a socketable item to it
local item = new("Item", itemRaw)

build.itemsTab:AddItem(item)
build.itemsTab:SetDisplayItem(item)
runCallback("OnFrame")

-- Extract the proper slot type runes from the list
local itemTabRunes = { }
for _, rune in ipairs(build.itemsTab.controls["displayItemRune1"].list) do
Expand Down Expand Up @@ -87,7 +87,7 @@
it("'Shield' runes appear in Items tab", slotTypeTest("shield", "Vaal Tower Shield"))

it("'Focus' runes appear in Items tab", slotTypeTest("focus", "Hallowed Focus"))

-- Weapons
it("'Bow' runes appear in Items tab", slotTypeTest("bow", "Gemini Bow"))

Expand All @@ -102,7 +102,7 @@
it("'(Quarterstaff) War Staff' runes appear in Items tab", slotTypeTest("warstaff", "Striking Quarterstaff"))

it("'Spear' runes appear in Items tab", slotTypeTest("spear", "Flying Spear"))

it("'One Hand Mace' runes appear in Items tab", slotTypeTest("one hand mace", "Marauding Mace"))

it("'Two Hand Mace' runes appear in Items tab", slotTypeTest("two hand mace", "Massive Greathammer"))
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
remainingRunes = remainingRunes - numRunes
-- this code should probably be refactored to based off stored self.runes rather than the recomputed amounts off the runeModLines this
-- is too avoid having to run the relatively expensive recomputation every time the item is parsed even if we know the runes on the item already.
modLine.soulcore = groupedRunes[1][1]:match("Soul Core") ~= nil
modLine.soulCore = groupedRunes[1][1]:match("Soul Core") ~= nil
modLine.runeCount = numRunes

if shouldFixRunesOnItem then
Expand Down
40 changes: 20 additions & 20 deletions src/Export/Scripts/bases.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,41 +262,41 @@
end
-- Special handling of Runes and SoulCores
if state.type == "Rune" or state.type == "SoulCore" or state.type == "Talisman" then
local soulcore = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
local soulcoresperclass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)
local soulCores = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
local soulCoresPerClass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)

local stats = { }
local outLines = { }
if soulcore then
if #soulcore.StatsKeysWeapon > 0 then
for i, statKey in ipairs(soulcore.StatsKeysWeapon) do
local statValue = soulcore["StatsValuesWeapon"][i]
if soulCores then
if #soulCores.StatsKeysWeapon > 0 then
for i, statKey in ipairs(soulCores.StatsKeysWeapon) do
local statValue = soulCores["StatsValuesWeapon"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
table.insert(outLines, 'Martial Weapons: ' .. table.concat(describeStats(stats), '\\n'))
end
if #soulcore.StatsKeysArmour > 0 then
if #soulCores.StatsKeysArmour > 0 then
stats = { } -- reset stats to empty
for i, statKey in ipairs(soulcore.StatsKeysArmour) do
local statValue = soulcore["StatsValuesArmour"][i]
for i, statKey in ipairs(soulCores.StatsKeysArmour) do
local statValue = soulCores["StatsValuesArmour"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
table.insert(outLines, 'Armour: ' .. table.concat(describeStats(stats), '\\n'))
end
if #soulcore.StatsKeysCaster > 0 then
if #soulCores.StatsKeysCaster > 0 then
stats = { } -- reset stats to empty
for i, statKey in ipairs(soulcore.StatsKeysCaster) do
local statValue = soulcore["StatsValuesCaster"][i]
for i, statKey in ipairs(soulCores.StatsKeysCaster) do
local statValue = soulCores["StatsValuesCaster"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
table.insert(outLines, 'Caster: ' .. table.concat(describeStats(stats), '\\n'))
end
-- Attribute runes are special case and can socket in everything
-- Sceptres are handled in "soulcoresperclass"
if #soulcore.StatsKeysAttributes > 0 then
-- Sceptres are handled in "soulCoresPerClass"
if #soulCores.StatsKeysAttributes > 0 then
stats = { } -- reset stats to empty
for i, statKey in ipairs(soulcore.StatsKeysAttributes) do
local statValue = soulcore["StatsValuesAttributes"][i]
for i, statKey in ipairs(soulCores.StatsKeysAttributes) do
local statValue = soulCores["StatsValuesAttributes"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
table.insert(outLines, 'Martial Weapons: ' .. table.concat(describeStats(stats), '\\n'))
Expand All @@ -304,14 +304,14 @@
table.insert(outLines, 'Caster: ' .. table.concat(describeStats(stats), '\\n'))
end
end
-- Check for more slot specific Soulcores/Runes/Talismans

Check warning on line 307 in src/Export/Scripts/bases.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Soulcores)
if soulcoresperclass then
if soulCoresPerClass then
stats = { }
for i, statKey in ipairs(soulcoresperclass.Stats) do
local statValue = soulcoresperclass["StatsValues"][i]
for i, statKey in ipairs(soulCoresPerClass.Stats) do
local statValue = soulCoresPerClass["StatsValues"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
local coreItemClass = soulcoresperclass.ItemClass.Id
local coreItemClass = soulCoresPerClass.ItemClass.Id
table.insert(outLines, coreItemClass..': ' .. table.concat(describeStats(stats), '\\n'))
end
out:write('\timplicit = "'..table.concat(outLines, '\\n')..'",\n')
Expand Down
36 changes: 18 additions & 18 deletions src/Export/Scripts/soulcores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ directiveTable.base = function(state, args, out)
end

-- Check for Standard Weapon, Armour, Caster Runes
local soulcore = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
local soulcoresperclass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)
local soulCores = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
local soulCoresPerClass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)
out:write('\t["', displayName, '"] = {\n')
local modLines = { }
if soulcore then
if soulCores then
-- weapons
local stats = { }
for i, statKey in ipairs(soulcore.StatsKeysWeapon) do
local statValue = soulcore["StatsValuesWeapon"][i]
for i, statKey in ipairs(soulCores.StatsKeysWeapon) do
local statValue = soulCores["StatsValuesWeapon"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
if next(stats) then
addRuneStats(stats, "weapon", modLines)
end

-- armour
stats = { } -- reset stats to empty
for i, statKey in ipairs(soulcore.StatsKeysArmour) do
local statValue = soulcore["StatsValuesArmour"][i]
for i, statKey in ipairs(soulCores.StatsKeysArmour) do
local statValue = soulCores["StatsValuesArmour"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
if next(stats) then
Expand All @@ -90,19 +90,19 @@ directiveTable.base = function(state, args, out)

-- caster check (wand & staff)
stats = { } -- reset stats to empty
for i, statKey in ipairs(soulcore.StatsKeysCaster) do
local statValue = soulcore["StatsValuesCaster"][i]
for i, statKey in ipairs(soulCores.StatsKeysCaster) do
local statValue = soulCores["StatsValuesCaster"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
if next(stats) then
addRuneStats(stats, "caster", modLines)
end

-- Check if the row is an Attribute rune which can go in all slots
if soulcore.StatsKeysAttributes then
if soulCores.StatsKeysAttributes then
stats = { } -- reset stats to empty
for i, statKey in ipairs(soulcore.StatsKeysAttributes) do
local statValue = soulcore["StatsValuesAttributes"][i]
for i, statKey in ipairs(soulCores.StatsKeysAttributes) do
local statValue = soulCores["StatsValuesAttributes"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
if next(stats) then
Expand All @@ -114,13 +114,13 @@ directiveTable.base = function(state, args, out)
end

-- Handle special case of new runes on specific item types
if soulcoresperclass then
if soulCoresPerClass then
local stats = { } -- reset stats to empty
for i, statKey in ipairs(soulcoresperclass.Stats) do
local statValue = soulcoresperclass["StatsValues"][i]
for i, statKey in ipairs(soulCoresPerClass.Stats) do
local statValue = soulCoresPerClass["StatsValues"][i]
stats[statKey.Id] = { min = statValue, max = statValue }
end
local itemClassId = soulcoresperclass.ItemClass.Id
local itemClassId = soulCoresPerClass.ItemClass.Id
if next(stats) then
addRuneStats(stats, itemClassId:lower(), modLines)
end
Expand All @@ -134,7 +134,7 @@ directiveTable.baseMatch = function(state, argstr, out)
local key = "Id"
local args = {}
for i in string.gmatch(argstr, "%S+") do
table.insert(args, i)
table.insert(args, i)
end
local value = args[1]
-- If column name is specified, use that
Expand Down
Loading