Skip to content

Commit 5457bca

Browse files
LocalIdentityLocalIdentity
andauthored
Add Support for Time-Lost Notable Passive effect mod (#1342)
Adds separate calc for just the increased effect from notables as majority of it was done before. Renamed some variables and a comment as they were confusing making it seem like they only applied to small nodes Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 601a278 commit 5457bca

2 files changed

Lines changed: 36 additions & 11 deletions

File tree

src/Classes/PassiveTreeView.lua

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
12231223
tooltip:AddSeparator(14)
12241224
end
12251225

1226-
local function addModInfoToTooltip(node, i, line, localSmallIncEffect)
1226+
local function addModInfoToTooltip(node, i, line, localIncEffect)
12271227
if node.mods[i] then
12281228
if launch.devModeAlt and node.mods[i].list then
12291229
-- Modifier debugging info
@@ -1239,9 +1239,9 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
12391239
end
12401240
end
12411241

1242-
-- Apply Inc Node scaling from Hulking Form only visually
1243-
if (incSmallPassiveSkillEffect + localSmallIncEffect) > 0 and node.type == "Normal" and not node.isAttribute and not node.ascendancyName and node.mods[i].list then
1244-
local scale = 1 + (incSmallPassiveSkillEffect + localSmallIncEffect) / 100
1242+
-- Apply Inc Node scaling from Hulking Form + Radius Jewels only visually
1243+
if (incSmallPassiveSkillEffect + localIncEffect) > 0 and (node.type == "Normal" or node.type == "Notable") and not node.isAttribute and not node.ascendancyName and node.mods[i].list then
1244+
local scale = 1 + (node.type == "Normal" and incSmallPassiveSkillEffect or 0 + localIncEffect) / 100
12451245
local modsList = copyTable(node.mods[i].list)
12461246
local scaledList = new("ModList")
12471247
-- some passive node mods are only Condition/Flag and have no value to scale by default, grab number from line
@@ -1303,7 +1303,7 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
13031303
-- loop over mods generated in CalcSetup by rad.func calls and grab the lines added
13041304
-- processStats once on copied node to cleanly setup for the tooltip
13051305
local function processTimeLostModsAndGetLocalEffect(mNode, build)
1306-
local localSmallIncEffect = 0
1306+
local localIncEffect = 0
13071307
local hasWSCondition = false
13081308
local newSd = copyTable(build.spec.tree.nodes[mNode.id].sd)
13091309
for _, mod in ipairs(mNode.finalModList) do
@@ -1313,7 +1313,9 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
13131313
if modCriteria.type == "Condition" and modCriteria.var and modCriteria.var:match("^WeaponSet") then
13141314
if (tonumber(modCriteria.var:match("(%d)")) == (build.itemsTab.activeItemSet.useSecondWeaponSet and 2 or 1)) then
13151315
if mod.name == "JewelSmallPassiveSkillEffect" then
1316-
localSmallIncEffect = mod.value
1316+
localIncEffect = mod.value
1317+
elseif mod.name == "JewelNotablePassiveSkillEffect" then
1318+
localIncEffect = mod.value
13171319
elseif mod.parsedLine then
13181320
mergeStats(newSd, mod.parsedLine, build.spec)
13191321
end
@@ -1323,15 +1325,17 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
13231325
end
13241326
if not hasWSCondition then
13251327
if mod.name == "JewelSmallPassiveSkillEffect" then
1326-
localSmallIncEffect = mod.value
1328+
localIncEffect = mod.value
1329+
elseif mod.name == "JewelNotablePassiveSkillEffect" then
1330+
localIncEffect = mod.value
13271331
elseif mod.parsedLine then
13281332
mergeStats(newSd, mod.parsedLine, build.spec)
13291333
end
13301334
end
13311335
end
13321336
mNode.sd = copyTable(newSd)
13331337
build.spec.tree:ProcessStats(mNode)
1334-
return localSmallIncEffect
1338+
return localIncEffect
13351339
end
13361340

13371341
-- we only want to run the timeLost function on a node that can could be in a jewel socket radius of up to Large
@@ -1358,12 +1362,12 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
13581362
end
13591363
if mNode.sd and mNode.sd[1] and not mNode.allMasteryOptions then
13601364
tooltip:AddLine(16, "")
1361-
local localSmallIncEffect = 0
1365+
local localIncEffect = 0
13621366
if not mNode.isAttribute and (mNode.type == "Normal" or mNode.type == "Notable") and isNodeInARadius(node) then
1363-
localSmallIncEffect = processTimeLostModsAndGetLocalEffect(mNode, build)
1367+
localIncEffect = processTimeLostModsAndGetLocalEffect(mNode, build)
13641368
end
13651369
for i, line in ipairs(mNode.sd) do
1366-
addModInfoToTooltip(mNode, i, line, localSmallIncEffect)
1370+
addModInfoToTooltip(mNode, i, line, localIncEffect)
13671371
end
13681372
end
13691373

src/Modules/CalcSetup.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ end
117117

118118
function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
119119
local localSmallIncEffect = 0
120+
local localNotableIncEffect = 0
120121
local modList = new("ModList")
121122
if node.type == "Keystone" then
122123
modList:AddMod(node.keystoneMod)
@@ -227,6 +228,19 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
227228
localSmallIncEffect = mod.value
228229
end
229230
end
231+
if mod.name == "JewelNotablePassiveSkillEffect" then
232+
for _, modCriteria in ipairs(mod) do
233+
if modCriteria.type == "Condition" and modCriteria.var and modCriteria.var:match("^WeaponSet") then
234+
if (tonumber(modCriteria.var:match("(%d)")) == (env.build.itemsTab.activeItemSet.useSecondWeaponSet and 2 or 1)) then
235+
localNotableIncEffect = mod.value
236+
end
237+
hasWSCondition = true
238+
end
239+
end
240+
if not hasWSCondition then
241+
localNotableIncEffect = mod.value
242+
end
243+
end
230244
end
231245

232246
-- Apply Inc Node scaling from Hulking Form
@@ -237,6 +251,13 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
237251
modList = scaledList
238252
end
239253

254+
if localNotableIncEffect > 0 and node.type == "Notable" and not node.isAttribute and not node.ascendancyName then
255+
local scale = 1 + localNotableIncEffect / 100
256+
local scaledList = new("ModList")
257+
scaledList:ScaleAddList(modList, scale)
258+
modList = scaledList
259+
end
260+
240261
return modList
241262
end
242263

0 commit comments

Comments
 (0)