Skip to content

Commit a0ab9e7

Browse files
authored
fix: case soulcore (#1178)
1 parent 9889e6f commit a0ab9e7

File tree

4 files changed

+49
-49
lines changed

4 files changed

+49
-49
lines changed

spec/System/TestSocketables_spec.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ describe("TestSocketables", function()
55

66
it("ModRunes matches Data/Soulcores", function()
77
local modRunes = LoadModule("../src/Data/ModRunes")
8-
local soulcores = {}
9-
LoadModule("../src/Data/Bases/soulcore", soulcores)
8+
local soulCores = {}
9+
LoadModule("../src/Data/Bases/soulcore", soulCores)
1010
local soulCoreCount = 0
11-
for name, _ in pairs(soulcores) do
11+
for name, _ in pairs(soulCores) do
1212
assert.is_not.equals(modRunes[name], nil)
1313
soulCoreCount = soulCoreCount + 1
1414
end
1515

1616
local modRunesCount = 0
1717
for name, _ in pairs(modRunes) do
18-
assert.is_not.equals(soulcores[name], nil)
18+
assert.is_not.equals(soulCores[name], nil)
1919
modRunesCount = modRunesCount + 1
2020
end
2121
-- Final check that Bases/soulcore has same number of entries as ModRunes
@@ -33,8 +33,8 @@ describe("TestSocketables", function()
3333
if runeSlotType == slotType then
3434
-- Need to add an entry of the name for each mod line for tests
3535
for _, _ in ipairs(mods) do
36-
table.insert(names, name)
37-
end
36+
table.insert(names, name)
37+
end
3838
end
3939
end
4040
end
@@ -49,11 +49,11 @@ describe("TestSocketables", function()
4949

5050
-- Create an ItemTab and add a socketable item to it
5151
local item = new("Item", itemRaw)
52-
52+
5353
build.itemsTab:AddItem(item)
5454
build.itemsTab:SetDisplayItem(item)
5555
runCallback("OnFrame")
56-
56+
5757
-- Extract the proper slot type runes from the list
5858
local itemTabRunes = { }
5959
for _, rune in ipairs(build.itemsTab.controls["displayItemRune1"].list) do
@@ -87,7 +87,7 @@ describe("TestSocketables", function()
8787
it("'Shield' runes appear in Items tab", slotTypeTest("shield", "Vaal Tower Shield"))
8888

8989
it("'Focus' runes appear in Items tab", slotTypeTest("focus", "Hallowed Focus"))
90-
90+
9191
-- Weapons
9292
it("'Bow' runes appear in Items tab", slotTypeTest("bow", "Gemini Bow"))
9393

@@ -102,7 +102,7 @@ describe("TestSocketables", function()
102102
it("'(Quarterstaff) War Staff' runes appear in Items tab", slotTypeTest("warstaff", "Striking Quarterstaff"))
103103

104104
it("'Spear' runes appear in Items tab", slotTypeTest("spear", "Flying Spear"))
105-
105+
106106
it("'One Hand Mace' runes appear in Items tab", slotTypeTest("one hand mace", "Marauding Mace"))
107107

108108
it("'Two Hand Mace' runes appear in Items tab", slotTypeTest("two hand mace", "Massive Greathammer"))

src/Classes/Item.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
940940
remainingRunes = remainingRunes - numRunes
941941
-- this code should probably be refactored to based off stored self.runes rather than the recomputed amounts off the runeModLines this
942942
-- 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.
943-
modLine.soulcore = groupedRunes[1][1]:match("Soul Core") ~= nil
943+
modLine.soulCore = groupedRunes[1][1]:match("Soul Core") ~= nil
944944
modLine.runeCount = numRunes
945945

946946
if shouldFixRunesOnItem then

src/Export/Scripts/bases.lua

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -262,41 +262,41 @@ directiveTable.base = function(state, args, out)
262262
end
263263
-- Special handling of Runes and SoulCores
264264
if state.type == "Rune" or state.type == "SoulCore" or state.type == "Talisman" then
265-
local soulcore = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
266-
local soulcoresperclass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)
265+
local soulCores = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
266+
local soulCoresPerClass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)
267267

268268
local stats = { }
269269
local outLines = { }
270-
if soulcore then
271-
if #soulcore.StatsKeysWeapon > 0 then
272-
for i, statKey in ipairs(soulcore.StatsKeysWeapon) do
273-
local statValue = soulcore["StatsValuesWeapon"][i]
270+
if soulCores then
271+
if #soulCores.StatsKeysWeapon > 0 then
272+
for i, statKey in ipairs(soulCores.StatsKeysWeapon) do
273+
local statValue = soulCores["StatsValuesWeapon"][i]
274274
stats[statKey.Id] = { min = statValue, max = statValue }
275275
end
276276
table.insert(outLines, 'Martial Weapons: ' .. table.concat(describeStats(stats), '\\n'))
277277
end
278-
if #soulcore.StatsKeysArmour > 0 then
278+
if #soulCores.StatsKeysArmour > 0 then
279279
stats = { } -- reset stats to empty
280-
for i, statKey in ipairs(soulcore.StatsKeysArmour) do
281-
local statValue = soulcore["StatsValuesArmour"][i]
280+
for i, statKey in ipairs(soulCores.StatsKeysArmour) do
281+
local statValue = soulCores["StatsValuesArmour"][i]
282282
stats[statKey.Id] = { min = statValue, max = statValue }
283283
end
284284
table.insert(outLines, 'Armour: ' .. table.concat(describeStats(stats), '\\n'))
285285
end
286-
if #soulcore.StatsKeysCaster > 0 then
286+
if #soulCores.StatsKeysCaster > 0 then
287287
stats = { } -- reset stats to empty
288-
for i, statKey in ipairs(soulcore.StatsKeysCaster) do
289-
local statValue = soulcore["StatsValuesCaster"][i]
288+
for i, statKey in ipairs(soulCores.StatsKeysCaster) do
289+
local statValue = soulCores["StatsValuesCaster"][i]
290290
stats[statKey.Id] = { min = statValue, max = statValue }
291291
end
292292
table.insert(outLines, 'Caster: ' .. table.concat(describeStats(stats), '\\n'))
293293
end
294294
-- Attribute runes are special case and can socket in everything
295-
-- Sceptres are handled in "soulcoresperclass"
296-
if #soulcore.StatsKeysAttributes > 0 then
295+
-- Sceptres are handled in "soulCoresPerClass"
296+
if #soulCores.StatsKeysAttributes > 0 then
297297
stats = { } -- reset stats to empty
298-
for i, statKey in ipairs(soulcore.StatsKeysAttributes) do
299-
local statValue = soulcore["StatsValuesAttributes"][i]
298+
for i, statKey in ipairs(soulCores.StatsKeysAttributes) do
299+
local statValue = soulCores["StatsValuesAttributes"][i]
300300
stats[statKey.Id] = { min = statValue, max = statValue }
301301
end
302302
table.insert(outLines, 'Martial Weapons: ' .. table.concat(describeStats(stats), '\\n'))
@@ -305,13 +305,13 @@ directiveTable.base = function(state, args, out)
305305
end
306306
end
307307
-- Check for more slot specific Soulcores/Runes/Talismans
308-
if soulcoresperclass then
308+
if soulCoresPerClass then
309309
stats = { }
310-
for i, statKey in ipairs(soulcoresperclass.Stats) do
311-
local statValue = soulcoresperclass["StatsValues"][i]
310+
for i, statKey in ipairs(soulCoresPerClass.Stats) do
311+
local statValue = soulCoresPerClass["StatsValues"][i]
312312
stats[statKey.Id] = { min = statValue, max = statValue }
313313
end
314-
local coreItemClass = soulcoresperclass.ItemClass.Id
314+
local coreItemClass = soulCoresPerClass.ItemClass.Id
315315
table.insert(outLines, coreItemClass..': ' .. table.concat(describeStats(stats), '\\n'))
316316
end
317317
out:write('\timplicit = "'..table.concat(outLines, '\\n')..'",\n')

src/Export/Scripts/soulcores.lua

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,25 @@ directiveTable.base = function(state, args, out)
6363
end
6464

6565
-- Check for Standard Weapon, Armour, Caster Runes
66-
local soulcore = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
67-
local soulcoresperclass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)
66+
local soulCores = dat("SoulCores"):GetRow("BaseItemTypes", baseItemType)
67+
local soulCoresPerClass = dat("SoulCoresPerClass"):GetRow("BaseItemType", baseItemType)
6868
out:write('\t["', displayName, '"] = {\n')
6969
local modLines = { }
70-
if soulcore then
70+
if soulCores then
7171
-- weapons
7272
local stats = { }
73-
for i, statKey in ipairs(soulcore.StatsKeysWeapon) do
74-
local statValue = soulcore["StatsValuesWeapon"][i]
73+
for i, statKey in ipairs(soulCores.StatsKeysWeapon) do
74+
local statValue = soulCores["StatsValuesWeapon"][i]
7575
stats[statKey.Id] = { min = statValue, max = statValue }
7676
end
7777
if next(stats) then
7878
addRuneStats(stats, "weapon", modLines)
7979
end
80-
80+
8181
-- armour
8282
stats = { } -- reset stats to empty
83-
for i, statKey in ipairs(soulcore.StatsKeysArmour) do
84-
local statValue = soulcore["StatsValuesArmour"][i]
83+
for i, statKey in ipairs(soulCores.StatsKeysArmour) do
84+
local statValue = soulCores["StatsValuesArmour"][i]
8585
stats[statKey.Id] = { min = statValue, max = statValue }
8686
end
8787
if next(stats) then
@@ -90,19 +90,19 @@ directiveTable.base = function(state, args, out)
9090

9191
-- caster check (wand & staff)
9292
stats = { } -- reset stats to empty
93-
for i, statKey in ipairs(soulcore.StatsKeysCaster) do
94-
local statValue = soulcore["StatsValuesCaster"][i]
93+
for i, statKey in ipairs(soulCores.StatsKeysCaster) do
94+
local statValue = soulCores["StatsValuesCaster"][i]
9595
stats[statKey.Id] = { min = statValue, max = statValue }
9696
end
9797
if next(stats) then
9898
addRuneStats(stats, "caster", modLines)
9999
end
100100

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

116116
-- Handle special case of new runes on specific item types
117-
if soulcoresperclass then
117+
if soulCoresPerClass then
118118
local stats = { } -- reset stats to empty
119-
for i, statKey in ipairs(soulcoresperclass.Stats) do
120-
local statValue = soulcoresperclass["StatsValues"][i]
119+
for i, statKey in ipairs(soulCoresPerClass.Stats) do
120+
local statValue = soulCoresPerClass["StatsValues"][i]
121121
stats[statKey.Id] = { min = statValue, max = statValue }
122122
end
123-
local itemClassId = soulcoresperclass.ItemClass.Id
123+
local itemClassId = soulCoresPerClass.ItemClass.Id
124124
if next(stats) then
125125
addRuneStats(stats, itemClassId:lower(), modLines)
126126
end
@@ -134,7 +134,7 @@ directiveTable.baseMatch = function(state, argstr, out)
134134
local key = "Id"
135135
local args = {}
136136
for i in string.gmatch(argstr, "%S+") do
137-
table.insert(args, i)
137+
table.insert(args, i)
138138
end
139139
local value = args[1]
140140
-- If column name is specified, use that

0 commit comments

Comments
 (0)