Skip to content

Commit 9b29290

Browse files
sida-wangLocalIdentity
andauthored
Fix Cluster Jewel imports not allocating correctly (#7270)
* fix: cluster jewel imports not working - Tidy up in BuildClusterJewelGraphs() to prevent allocSubgraphNodes and allocExtendedNodes from having duplicate nodes - Add in orbitOffsets into ClusterJewels.lua via export. Credit to Wires77 #4302 for figuring this out - Update the logic that calculates the orbitIndex in BuildSubgraph to use orbitOffsets * Revert launch.lua --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 954580a commit 9b29290

4 files changed

Lines changed: 189 additions & 24 deletions

File tree

src/Classes/PassiveSpec.lua

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,9 @@ function PassiveSpecClass:BuildClusterJewelGraphs()
13371337
node.alloc = true
13381338
if not self.allocNodes[nodeId] then
13391339
self.allocNodes[nodeId] = node
1340-
t_insert(self.allocExtendedNodes, nodeId)
1340+
if not isValueInArray(self.allocExtendedNodes, nodeId) then
1341+
t_insert(self.allocExtendedNodes, nodeId)
1342+
end
13411343
end
13421344
end
13431345
end
@@ -1427,6 +1429,10 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
14271429
end
14281430

14291431
local function addToAllocatedSubgraphNodes(node)
1432+
-- Don't add to allocSubgraphNodes if node already exists
1433+
if isValueInArray(self.allocSubgraphNodes, node.id) then
1434+
return false
1435+
end
14301436
local proxyGroup = matchGroup(expansionJewel.proxy)
14311437
if proxyGroup then
14321438
for id, data in pairs(importedNodes) do
@@ -1473,7 +1479,6 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
14731479
self.nodes[node.id] = node
14741480
if addToAllocatedSubgraphNodes(node) then
14751481
t_insert(self.allocSubgraphNodes, node.id)
1476-
t_insert(self.allocExtendedNodes, node.id)
14771482
end
14781483
return
14791484
end
@@ -1488,21 +1493,6 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
14881493
end
14891494
end
14901495

1491-
-- Check if we need to downsize the group
1492-
local groupSize = expansionJewel.size
1493-
upSize = upSize or 0
1494-
while clusterJewel.sizeIndex < groupSize do
1495-
-- Look for the socket with index 1 first (middle socket of large groups), then index 0
1496-
local socket = findSocket(proxyGroup, 1) or findSocket(proxyGroup, 0)
1497-
assert(socket, "Downsizing socket not found")
1498-
1499-
-- Grab the proxy node/group from the socket
1500-
proxyNode = self.tree.nodes[tonumber(socket.expansionJewel.proxy)]
1501-
proxyGroup = proxyNode.group
1502-
groupSize = socket.expansionJewel.size
1503-
upSize = upSize + 1
1504-
end
1505-
15061496
-- Initialise orbit flags
15071497
local nodeOrbit = clusterJewel.sizeIndex + 1
15081498
subGraph.group.oo[nodeOrbit] = true
@@ -1714,13 +1704,14 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
17141704
return m_floor(srcOidx * destNodesPerOrbit / srcNodesPerOrbit)
17151705
end
17161706
end
1717-
local proxyNodeSkillsPerOrbit = self.tree.skillsPerOrbit[proxyNode.o+1]
1718-
1707+
1708+
local skillsPerOrbit = self.tree.skillsPerOrbit[clusterJewel.sizeIndex+2]
1709+
local startOidx = data.clusterJewels.orbitOffsets[proxyNode.id][clusterJewel.sizeIndex]
17191710
-- Translate oidx positioning to TreeData-relative values
17201711
for _, node in pairs(indicies) do
1721-
local proxyNodeOidxRelativeToClusterIndicies = translateOidx(proxyNode.oidx, proxyNodeSkillsPerOrbit, clusterJewel.totalIndicies)
1722-
local correctedNodeOidxRelativeToClusterIndicies = (node.oidx + proxyNodeOidxRelativeToClusterIndicies) % clusterJewel.totalIndicies
1723-
local correctedNodeOidxRelativeToTreeSkillsPerOrbit = translateOidx(correctedNodeOidxRelativeToClusterIndicies, clusterJewel.totalIndicies, proxyNodeSkillsPerOrbit)
1712+
local startOidxRelativeToClusterIndicies = translateOidx(startOidx, skillsPerOrbit, clusterJewel.totalIndicies)
1713+
local correctedNodeOidxRelativeToClusterIndicies = (node.oidx + startOidx) % clusterJewel.totalIndicies
1714+
local correctedNodeOidxRelativeToTreeSkillsPerOrbit = translateOidx(correctedNodeOidxRelativeToClusterIndicies, clusterJewel.totalIndicies, skillsPerOrbit)
17241715
node.oidx = correctedNodeOidxRelativeToTreeSkillsPerOrbit
17251716
end
17261717

src/Data/ClusterJewels.lua

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,4 +890,162 @@ return {
890890
"Hollow Palm Technique",
891891
"Pitfighter",
892892
},
893+
orbitOffsets = {
894+
[43989] = {
895+
[0] = 3,
896+
[1] = 5,
897+
[2] = 5,
898+
},
899+
[25134] = {
900+
[0] = 0,
901+
[1] = 11,
902+
[2] = 11,
903+
},
904+
[30275] = {
905+
[0] = 2,
906+
[1] = 3,
907+
[2] = 3,
908+
},
909+
[28650] = {
910+
[0] = 1,
911+
[1] = 1,
912+
[2] = 1,
913+
},
914+
[48132] = {
915+
[0] = 5,
916+
[1] = 9,
917+
[2] = 9,
918+
},
919+
[18756] = {
920+
[0] = 4,
921+
[1] = 7,
922+
[2] = 7,
923+
},
924+
[55706] = {
925+
[0] = 2,
926+
[1] = 3,
927+
},
928+
[26661] = {
929+
[0] = 3,
930+
[1] = 5,
931+
},
932+
[13201] = {
933+
[0] = 3,
934+
[1] = 7,
935+
},
936+
[40114] = {
937+
[0] = 1,
938+
},
939+
[18361] = {
940+
[0] = 2,
941+
},
942+
[7956] = {
943+
[0] = 3,
944+
},
945+
[51233] = {
946+
[0] = 5,
947+
[1] = 9,
948+
},
949+
[57194] = {
950+
[0] = 5,
951+
[1] = 11,
952+
},
953+
[35853] = {
954+
[0] = 0,
955+
[1] = 1,
956+
},
957+
[35313] = {
958+
[0] = 4,
959+
},
960+
[44470] = {
961+
[0] = 5,
962+
},
963+
[37147] = {
964+
[0] = 0,
965+
},
966+
[25441] = {
967+
[0] = 1,
968+
[1] = 1,
969+
},
970+
[28018] = {
971+
[0] = 2,
972+
[1] = 3,
973+
},
974+
[53203] = {
975+
[0] = 3,
976+
[1] = 5,
977+
},
978+
[3854] = {
979+
[0] = 0,
980+
},
981+
[49951] = {
982+
[0] = 1,
983+
},
984+
[22046] = {
985+
[0] = 2,
986+
},
987+
[37898] = {
988+
[0] = 5,
989+
[1] = 11,
990+
},
991+
[64166] = {
992+
[0] = 1,
993+
[1] = 1,
994+
},
995+
[58355] = {
996+
[0] = 2,
997+
[1] = 3,
998+
},
999+
[48128] = {
1000+
[0] = 5,
1001+
},
1002+
[27475] = {
1003+
[0] = 0,
1004+
},
1005+
[35070] = {
1006+
[0] = 1,
1007+
},
1008+
[35926] = {
1009+
[0] = 4,
1010+
[1] = 7,
1011+
},
1012+
[33833] = {
1013+
[0] = 5,
1014+
[1] = 9,
1015+
},
1016+
[50179] = {
1017+
[0] = 5,
1018+
[1] = 11,
1019+
},
1020+
[36414] = {
1021+
[0] = 3,
1022+
},
1023+
[10643] = {
1024+
[0] = 4,
1025+
},
1026+
[56439] = {
1027+
[0] = 5,
1028+
},
1029+
[58194] = {
1030+
[0] = 3,
1031+
[1] = 5,
1032+
},
1033+
[34013] = {
1034+
[0] = 4,
1035+
[1] = 7,
1036+
},
1037+
[24452] = {
1038+
[0] = 5,
1039+
[1] = 9,
1040+
},
1041+
[63754] = {
1042+
[0] = 2,
1043+
},
1044+
[54600] = {
1045+
[0] = 3,
1046+
},
1047+
[27819] = {
1048+
[0] = 4,
1049+
},
1050+
},
8931051
}

src/Export/Scripts/cluster.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ for skill in dat("PassiveTreeExpansionSpecialSkills"):Rows() do
6363
end
6464
end
6565
out:write('\t},\n')
66+
out:write('\torbitOffsets = {\n')
67+
for jewelSlot in dat("PassiveJewelSlots"):Rows() do
68+
if jewelSlot.ClusterSize then
69+
out:write('\t\t[', jewelSlot.Proxy.PassiveSkillNodeId, '] = {\n')
70+
out:write('\t\t\t[0] = ', jewelSlot.StartIndices[1], ',\n')
71+
if jewelSlot.StartIndices[2] then
72+
out:write('\t\t\t[1] = ', jewelSlot.StartIndices[2], ',\n')
73+
end
74+
if jewelSlot.StartIndices[3] then
75+
out:write('\t\t\t[2] = ', jewelSlot.StartIndices[3], ',\n')
76+
end
77+
out:write('\t\t},\n')
78+
end
79+
end
80+
out:write('\t},\n')
81+
6682

6783
out:write('}')
6884
out:close()

src/Export/spec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8719,8 +8719,8 @@ return {
87198719
width=210
87208720
},
87218721
[7]={
8722-
list=false,
8723-
name="",
8722+
list=true,
8723+
name="StartIndices",
87248724
refTo="",
87258725
type="Int",
87268726
width=150

0 commit comments

Comments
 (0)