@@ -1137,7 +1137,7 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
1137
1137
tooltip :AddSeparator (14 )
1138
1138
end
1139
1139
1140
- local function addModInfoToTooltip (node , i , line )
1140
+ local function addModInfoToTooltip (node , i , line , localSmallIncEffect )
1141
1141
if node .mods [i ] then
1142
1142
if launch .devModeAlt and node .mods [i ].list then
1143
1143
-- Modifier debugging info
@@ -1152,10 +1152,10 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
1152
1152
line = line .. " " .. modStr
1153
1153
end
1154
1154
end
1155
-
1155
+
1156
1156
-- Apply Inc Node scaling from Hulking Form only visually
1157
- if incSmallPassiveSkillEffect > 0 and node .type == " Normal" and not node .isAttribute and not node .ascendancyName and node .mods [i ].list then
1158
- local scale = 1 + incSmallPassiveSkillEffect / 100
1157
+ if ( incSmallPassiveSkillEffect + localSmallIncEffect ) > 0 and node .type == " Normal" and not node .isAttribute and not node .ascendancyName and node .mods [i ].list then
1158
+ local scale = 1 + ( incSmallPassiveSkillEffect + localSmallIncEffect ) / 100
1159
1159
local scaledList = new (" ModList" )
1160
1160
scaledList :ScaleAddList (node .mods [i ].list , scale )
1161
1161
local number = line :match (" %d*%.?%d+" )
@@ -1166,24 +1166,105 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
1166
1166
elseif type (mod .value ) == " table" then
1167
1167
newValue = mod .value .mod .value
1168
1168
end
1169
- line = line :gsub (" %d*%.?%d+" ,math.abs (newValue ))
1169
+ line = line :gsub (" %d*%.?%d+" , math.abs (newValue ))
1170
1170
end
1171
1171
-- line = line .. " ^8(Effect increased by "..incSmallPassiveSkillEffect.."%)"
1172
1172
end
1173
-
1173
+
1174
1174
tooltip :AddLine (16 , ((node .mods [i ].extra or not node .mods [i ].list ) and colorCodes .UNSUPPORTED or colorCodes .MAGIC ).. line )
1175
1175
end
1176
1176
end
1177
1177
1178
+ local function mergeStats (nodeSd , jewelSd , spec )
1179
+ -- copy the original tree node so we ignore the mods being added from the jewel
1180
+ local nodeSdCopy = copyTable (nodeSd )
1181
+ local nodeNumber = 0
1182
+ local nodeString = " "
1183
+ local modToAddNumber = 0
1184
+ local modToAddString = " "
1185
+
1186
+ -- loop the original node mods and compare to the jewel mod we want to add
1187
+ -- if the strings without the numbers are identical, the mods should be identical
1188
+ -- if so, update the node's version of the mod and do not add the jewel mods to the list
1189
+ -- otherwise, add the jewel mod because it's unique/new to the node
1190
+ for index , originalSd in ipairs (nodeSdCopy ) do
1191
+ nodeString = originalSd :gsub (" (%d+)" , function (number )
1192
+ nodeNumber = number
1193
+ return " "
1194
+ end )
1195
+ modToAddString = jewelSd :gsub (" (%d+)" , function (number )
1196
+ modToAddNumber = number
1197
+ return " "
1198
+ end )
1199
+ if nodeString == modToAddString then
1200
+ nodeSd [index ] = nodeSd [index ]:gsub (" (%d+)" , (nodeNumber + modToAddNumber ))
1201
+ return
1202
+ end
1203
+ end
1204
+ t_insert (nodeSd , jewelSd )
1205
+ end
1206
+
1207
+ -- loop over mods generated in CalcSetup by rad.func calls and grab the lines added
1208
+ -- processStats once on copied node to cleanly setup for the tooltip
1209
+ local function processTimeLostModsAndGetLocalEffect (mNode , build )
1210
+ local localSmallIncEffect = 0
1211
+ local hasWSCondition = false
1212
+ local newSd = copyTable (build .spec .tree .nodes [mNode .id ].sd )
1213
+ for _ , mod in ipairs (mNode .finalModList ) do
1214
+ -- if the jewelMod has a WS Condition, only add the incEffect given it matches the activeWeaponSet
1215
+ -- otherwise the mod came from a jewel that is allocMode 0, so it always applies
1216
+ for _ , modCriteria in ipairs (mod ) do
1217
+ if modCriteria .type == " Condition" and modCriteria .var and modCriteria .var :match (" ^WeaponSet" ) then
1218
+ if (tonumber (modCriteria .var :match (" (%d)" )) == (build .itemsTab .activeItemSet .useSecondWeaponSet and 2 or 1 )) then
1219
+ if mod .name == " JewelSmallPassiveSkillEffect" then
1220
+ localSmallIncEffect = mod .value
1221
+ elseif mod .parsedLine then
1222
+ mergeStats (newSd , mod .parsedLine , build .spec )
1223
+ end
1224
+ end
1225
+ hasWSCondition = true
1226
+ end
1227
+ end
1228
+ if not hasWSCondition then
1229
+ if mod .name == " JewelSmallPassiveSkillEffect" then
1230
+ localSmallIncEffect = mod .value
1231
+ elseif mod .parsedLine then
1232
+ mergeStats (newSd , mod .parsedLine , build .spec )
1233
+ end
1234
+ end
1235
+ end
1236
+ mNode .sd = copyTable (newSd )
1237
+ build .spec .tree :ProcessStats (mNode )
1238
+ return localSmallIncEffect
1239
+ end
1240
+
1241
+ -- we only want to run the timeLost function on a node that can could be in a jewel socket radius of up to Large
1242
+ -- essentially trying to avoid calling ProcessStats for a Normal/Notable node that can't possibly be affected
1243
+ -- loops potentially every socket (24) until itemsTab is loaded or a jewel socket is hovered, then it will only loop the allocated sockets
1244
+ local function isNodeInARadius (node )
1245
+ local isInRadius = false
1246
+ for id , socket in pairs (build .itemsTab .sockets ) do
1247
+ if build .itemsTab .activeSocketList and socket .inactive == false or socket .inactive == nil then
1248
+ isInRadius = isInRadius or build .spec .nodes [id ].nodesInRadius [3 ][node .id ] ~= nil
1249
+ if isInRadius then break end
1250
+ end
1251
+ end
1252
+ return isInRadius
1253
+ end
1254
+
1178
1255
-- If so, check if the left hand tree is unallocated, but the right hand tree is allocated.
1179
1256
-- Then continue processing as normal
1180
- local mNode = node
1257
+ local mNode = copyTableSafe ( node , true , true )
1181
1258
1182
1259
-- This stanza actives for both Mastery and non Mastery tooltips. Proof: add '"Blah "..' to addModInfoToTooltip
1183
1260
if mNode .sd [1 ] and not mNode .allMasteryOptions then
1184
1261
tooltip :AddLine (16 , " " )
1262
+ local localSmallIncEffect = 0
1263
+ if not mNode .isAttribute and (mNode .type == " Normal" or mNode .type == " Notable" ) and isNodeInARadius (node ) then
1264
+ localSmallIncEffect = processTimeLostModsAndGetLocalEffect (mNode , build )
1265
+ end
1185
1266
for i , line in ipairs (mNode .sd ) do
1186
- addModInfoToTooltip (mNode , i , line )
1267
+ addModInfoToTooltip (mNode , i , line , localSmallIncEffect )
1187
1268
end
1188
1269
end
1189
1270
0 commit comments