@@ -615,6 +615,7 @@ local tree = {
615615}
616616
617617printf (" Generating classes..." )
618+ local ascedancyReplacements = {}
618619for i , classId in ipairs (psg .passives ) do
619620 local passiveRow = dat (" passiveskills" ):GetRow (" PassiveSkillNodeId" , classId )
620621 if passiveRow == nil then
@@ -665,14 +666,18 @@ for i, classId in ipairs(psg.passives) do
665666
666667 local ascendancies = dat (" ascendancy" ):GetRowList (" Class" , character )
667668 for k , ascendency in ipairs (ascendancies ) do
668- if ascendency .Name :find (ignoreFilter ) ~= nil or ascendency .isDisabled or ascendency . Id == " Witch3b " then
669+ if ascendency .Name :find (ignoreFilter ) ~= nil or ascendency .isDisabled then
669670 printf (" Ignoring ascendency " .. ascendency .Name .. " for class " .. character .Name )
670671 goto continue3
671672 end
673+ if ascendency .Replace then
674+ ascedancyReplacements [ascendency .Replace .Name ] = ascendency .Name
675+ end
672676 table.insert (classDef .ascendancies , {
673677 [" id" ] = ascendency .Name ,
674678 [" name" ] = ascendency .Name ,
675679 [" internalId" ] = ascendency .Id ,
680+ [" replace" ] = ascendency .Replace and ascendency .Replace .Name or nil ,
676681 [" background" ] = {
677682 image = " Classes" .. ascendency .Name ,
678683 section = " AscendancyBackground" ,
@@ -815,8 +820,7 @@ for i, group in ipairs(psg.groups) do
815820 if passiveRow .JewelSocket then
816821 node [" containJewelSocket" ] = true
817822
818- local uioverride = dat (" passiveskilltreenodeframeart" ):GetRow (" Id" , " LichAscendancyJewel" )
819-
823+ local uioverride = passiveRow .Ascendancy .UIArt .JewelFrame
820824 if uioverride then
821825 local uiSocketNormal = uiImages [string.lower (uioverride .Normal )]
822826 addToSheet (getSheet (" group-background" ), uiSocketNormal .path , " frame" , commonMetadata (nil ))
@@ -986,6 +990,63 @@ for i, group in ipairs(psg.groups) do
986990 }
987991 end
988992
993+ if passiveRow .Ascendancy and ascedancyReplacements [passiveRow .Ascendancy .Name ] then
994+ node [" isSwitchable" ] = true
995+ local ascendancyRow = dat (" ascendancy" ):GetRow (" Name" , ascedancyReplacements [passiveRow .Ascendancy .Name ])
996+
997+ local nodeInfo = {
998+ [" ascendancyName" ] = ascedancyReplacements [passiveRow .Ascendancy .Name ]
999+ }
1000+
1001+ local switchNode = dat (" ascendancypassiveskilloverrides" ):GetRow (" OriginalNode" , passiveRow )
1002+ if switchNode then
1003+ nodeInfo .id = switchNode .SwitchedNode .PassiveSkillNodeId
1004+ nodeInfo .name = switchNode .SwitchedNode .Name
1005+ nodeInfo .icon = switchNode .SwitchedNode .Icon
1006+ nodeInfo .stats = {}
1007+
1008+ -- add to assets
1009+ addToSheet (getSheet (" skills" ), switchNode .SwitchedNode .Icon , " normalActive" , commonMetadata (nil ))
1010+ addToSheet (getSheet (" skills-disabled" ), switchNode .SwitchedNode .Icon , " normalInactive" , commonMetadata (nil ))
1011+
1012+ -- Stats
1013+ if switchNode .SwitchedNode .Stats ~= nil then
1014+ local parseStats = {}
1015+ for k , stat in ipairs (switchNode .SwitchedNode .Stats ) do
1016+ parseStats [stat .Id ] = { min = switchNode .SwitchedNode [" Stat" .. k ], max = switchNode .SwitchedNode [" Stat" .. k ] }
1017+ end
1018+ local out , orders = describeStats (parseStats )
1019+ for k , line in ipairs (out ) do
1020+ table.insert (nodeInfo [" stats" ], line )
1021+ end
1022+ end
1023+ end
1024+
1025+ if passiveRow .JewelSocket and ascendancyRow .UIArt .JewelFrame then
1026+ -- override the jewel socket assets if any
1027+ local uioverride = ascendancyRow .UIArt .JewelFrame
1028+
1029+ local uiSocketNormal = uiImages [string.lower (uioverride .Normal )]
1030+ addToSheet (getSheet (" group-background" ), uiSocketNormal .path , " frame" , commonMetadata (nil ))
1031+
1032+ local uiSocketActive = uiImages [string.lower (uioverride .Active )]
1033+ addToSheet (getSheet (" group-background" ), uiSocketActive .path , " frame" , commonMetadata (nil ))
1034+
1035+ local uiSocketCanAllocate = uiImages [string.lower (uioverride .CanAllocate )]
1036+ addToSheet (getSheet (" group-background" ), uiSocketCanAllocate .path , " frame" , commonMetadata (nil ))
1037+
1038+ nodeInfo .jewelOverlay = {
1039+ alloc = uiSocketActive .path ,
1040+ path = uiSocketCanAllocate .path ,
1041+ unalloc = uiSocketNormal .path ,
1042+ }
1043+ end
1044+
1045+ node [" options" ] = {
1046+ [ascedancyReplacements [passiveRow .Ascendancy .Name ]] = nodeInfo
1047+ }
1048+ end
1049+
9891050 -- classStartName
9901051 if # passiveRow .ClassStart > 0 then
9911052 node [" classesStart" ] = {}
@@ -1109,6 +1170,11 @@ for i, classId in ipairs(psg.passives) do
11091170 for _ , class in ipairs (classes ) do
11101171 for _ , ascendancy in ipairs (class .ascendancies ) do
11111172 printf (" Positioning ascendancy " .. ascendancy .name .. " for class " .. class .name )
1173+
1174+ local angle = startAngle + (j - 1 ) * angleStep
1175+ local cX = hardCoded * math.cos (angle )
1176+ local cY = hardCoded * math.sin (angle )
1177+
11121178 local info = ascendancyGroups [ascendancy .id ]
11131179 if info == nil then
11141180 printf (" Ascendancy group " .. ascendancy .id .. " not found" )
@@ -1119,15 +1185,12 @@ for i, classId in ipairs(psg.passives) do
11191185 printf (" Ascendancy node " .. ascendancy .id .. " not found" )
11201186 goto continuepositioning
11211187 end
1122- local groupAscendancy = tree .groups [ascendancyNode .group ]
1123-
1124- local angle = startAngle + (j - 1 ) * angleStep
1125- local cX = hardCoded * math.cos (angle )
1126- local cY = hardCoded * math.sin (angle )
11271188
11281189 ascendancy .background .x = cX
11291190 ascendancy .background .y = cY
11301191
1192+ local groupAscendancy = tree .groups [ascendancyNode .group ]
1193+
11311194 local innerRadious = dat (" ascendancy" ):GetRow (" Id" , ascendancy .internalId ).distanceTree
11321195
11331196 local newInnerX = cX + math.cos (angleToCenter ) * innerRadious
@@ -1155,12 +1218,46 @@ for i, classId in ipairs(psg.passives) do
11551218 tree .max_y = math.max (tree .max_y , group .y + hardCoded / 2 )
11561219 end
11571220 end
1221+
11581222 j = j + 1
11591223 :: continuepositioning ::
11601224 end
11611225 end
11621226end
11631227
1228+ printf (" Fixing replace ascendancies position..." )
1229+ for from , to in pairs (ascedancyReplacements ) do
1230+ local fromAscendancy
1231+ local toAscendancy
1232+ for _ , class in ipairs (tree .classes ) do
1233+ for _ , ascendancy in ipairs (class .ascendancies ) do
1234+ if ascendancy .name == from then
1235+ fromAscendancy = ascendancy
1236+ end
1237+ if ascendancy .name == to then
1238+ toAscendancy = ascendancy
1239+ end
1240+ end
1241+ end
1242+
1243+ if fromAscendancy == nil then
1244+ printf (" From ascendancy " .. from .. " not found" )
1245+ goto continuereplace
1246+ end
1247+ if toAscendancy == nil then
1248+ printf (" To ascendancy " .. to .. " not found" )
1249+ goto continuereplace
1250+ end
1251+
1252+ fromAscendancy .replaceBy = to
1253+
1254+ toAscendancy .background .x = fromAscendancy .background .x
1255+ toAscendancy .background .y = fromAscendancy .background .y
1256+
1257+ :: continuereplace ::
1258+ end
1259+
1260+
11641261printf (" Generating sprite info..." )
11651262for i , sheet in ipairs (sheets ) do
11661263 printf (" Calculating sprite dimensions for " .. sheet .name )
0 commit comments