diff --git a/spec/System/TestSocketables_spec.lua b/spec/System/TestSocketables_spec.lua index 06bb8a815e..b60d33df54 100644 --- a/spec/System/TestSocketables_spec.lua +++ b/spec/System/TestSocketables_spec.lua @@ -5,17 +5,17 @@ describe("TestSocketables", function() it("ModRunes matches Data/Soulcores", function() 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 @@ -33,8 +33,8 @@ describe("TestSocketables", function() 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 @@ -49,11 +49,11 @@ describe("TestSocketables", function() -- 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 @@ -87,7 +87,7 @@ describe("TestSocketables", function() 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")) @@ -102,7 +102,7 @@ describe("TestSocketables", function() 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")) diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index d8a3a5fcda..97c0569cb3 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -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 diff --git a/src/Export/Scripts/bases.lua b/src/Export/Scripts/bases.lua index 14607a47ca..84a7045362 100644 --- a/src/Export/Scripts/bases.lua +++ b/src/Export/Scripts/bases.lua @@ -262,41 +262,41 @@ directiveTable.base = function(state, args, out) 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')) @@ -305,13 +305,13 @@ directiveTable.base = function(state, args, out) end end -- Check for more slot specific Soulcores/Runes/Talismans - 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') diff --git a/src/Export/Scripts/soulcores.lua b/src/Export/Scripts/soulcores.lua index 6cae6fe9a6..ad37f822e0 100644 --- a/src/Export/Scripts/soulcores.lua +++ b/src/Export/Scripts/soulcores.lua @@ -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 @@ -90,8 +90,8 @@ 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 @@ -99,10 +99,10 @@ directiveTable.base = function(state, args, out) 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 @@ -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 @@ -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