@@ -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
@@ -669,10 +670,14 @@ for i, classId in ipairs(psg.passives) do
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" ,
@@ -985,6 +990,63 @@ for i, group in ipairs(psg.groups) do
985990 }
986991 end
987992
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+
9881050 -- classStartName
9891051 if # passiveRow .ClassStart > 0 then
9901052 node [" classesStart" ] = {}
@@ -1113,11 +1175,6 @@ for i, classId in ipairs(psg.passives) do
11131175 local cX = hardCoded * math.cos (angle )
11141176 local cY = hardCoded * math.sin (angle )
11151177
1116- ascendancy .background .x = cX
1117- ascendancy .background .y = cY
1118-
1119- j = j + 1
1120-
11211178 local info = ascendancyGroups [ascendancy .id ]
11221179 if info == nil then
11231180 printf (" Ascendancy group " .. ascendancy .id .. " not found" )
@@ -1128,6 +1185,10 @@ for i, classId in ipairs(psg.passives) do
11281185 printf (" Ascendancy node " .. ascendancy .id .. " not found" )
11291186 goto continuepositioning
11301187 end
1188+
1189+ ascendancy .background .x = cX
1190+ ascendancy .background .y = cY
1191+
11311192 local groupAscendancy = tree .groups [ascendancyNode .group ]
11321193
11331194 local innerRadious = dat (" ascendancy" ):GetRow (" Id" , ascendancy .internalId ).distanceTree
@@ -1158,11 +1219,45 @@ for i, classId in ipairs(psg.passives) do
11581219 end
11591220 end
11601221
1222+ j = j + 1
11611223 :: continuepositioning ::
11621224 end
11631225 end
11641226end
11651227
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+
11661261printf (" Generating sprite info..." )
11671262for i , sheet in ipairs (sheets ) do
11681263 printf (" Calculating sprite dimensions for " .. sheet .name )
0 commit comments