Skip to content

Commit 4c963c6

Browse files
vaisestLocalIdentity
andauthored
Allow Intuitive Leap -likes to shorten power report distance (#9938)
* Allow Intuitive Leap -likes to shorten power report distance * Fix node distance for masteries Mastery distance wasn't including the point spent to allocate it --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 3f7cc0d commit 4c963c6

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/Classes/CalcsTab.lua

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,13 @@ function CalcsTabClass:PowerBuilder()
513513
return not assignedNodeId or assignedNodeId == node.id
514514
end
515515

516-
local function calculateAddNodePower(power, node, output, buildPathNodes)
516+
local function calculateAddNodePower(power, distance, node, output, buildPathNodes)
517517
if self.powerStat and self.powerStat.stat and not self.powerStat.ignoreForNodes then
518518
power.singleStat = self:CalculatePowerStat(self.powerStat, output, calcBase)
519519
if node.path and not node.ascendancyName then
520520
newPowerMax.singleStat = m_max(newPowerMax.singleStat, power.singleStat)
521521
power.pathPower = power.singleStat
522-
if node.pathDist > 1 then
522+
if distance > 1 then
523523
power.pathPower = self:CalculatePowerStat(self.powerStat, calcFunc({ addNodes = buildPathNodes() }, useFullDPS), calcBase)
524524
end
525525
end
@@ -529,8 +529,8 @@ function CalcsTabClass:PowerBuilder()
529529
if node.path and not node.ascendancyName then
530530
newPowerMax.offence = m_max(newPowerMax.offence, power.offence)
531531
newPowerMax.defence = m_max(newPowerMax.defence, power.defence)
532-
newPowerMax.offencePerPoint = m_max(newPowerMax.offencePerPoint, power.offence / node.pathDist)
533-
newPowerMax.defencePerPoint = m_max(newPowerMax.defencePerPoint, power.defence / node.pathDist)
532+
newPowerMax.offencePerPoint = m_max(newPowerMax.offencePerPoint, power.offence / distance)
533+
newPowerMax.defencePerPoint = m_max(newPowerMax.defencePerPoint, power.defence / distance)
534534
end
535535
end
536536
end
@@ -555,9 +555,16 @@ function CalcsTabClass:PowerBuilder()
555555
end
556556
end
557557
else
558-
distanceMap[node.pathDist or 1000] = distanceMap[node.pathDist or 1000] or { }
559-
distanceMap[node.pathDist or 1000][nodeId] = node
560-
if not (self.nodePowerMaxDepth and self.nodePowerMaxDepth < node.pathDist) then
558+
local dist = node.pathDist or 1000
559+
for _, leap in ipairs(node.intuitiveLeapLikesAffecting or {}) do
560+
if leap.alloc then
561+
dist = math.max(math.min(leap.pathDist or 1000, dist), 1)
562+
end
563+
end
564+
distanceMap[dist] = distanceMap[dist] or {}
565+
distanceMap[dist][nodeId] = node
566+
node.power.distance = dist
567+
if (not self.nodePowerMaxDepth) or dist <= self.nodePowerMaxDepth then
561568
total = total + 1
562569
end
563570
end
@@ -586,7 +593,7 @@ function CalcsTabClass:PowerBuilder()
586593
cache[node.modKey] = calcFunc({ addNodes = { [node] = true } }, useFullDPS)
587594
end
588595
local output = cache[node.modKey]
589-
calculateAddNodePower(node.power, node, output, function()
596+
calculateAddNodePower(node.power, distance, node, output, function()
590597
local pathNodes = { }
591598
for _, pathNode in pairs(node.path) do
592599
pathNodes[pathNode] = true
@@ -647,7 +654,7 @@ function CalcsTabClass:PowerBuilder()
647654
local output = cache[effectNode.modKey]
648655
node.power.masteryEffects[effect.id] = { }
649656
local effectPower = node.power.masteryEffects[effect.id]
650-
calculateAddNodePower(effectPower, node, output, function()
657+
calculateAddNodePower(effectPower, node.pathDist, node, output, function()
651658
local pathNodes = {
652659
[effectNode] = true
653660
}

src/Classes/TreeTab.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ function TreeTabClass:BuildPowerReportList(currentStat)
10911091
if isAlloc then
10921092
return #(node.depends or { }) == 0 and 1 or #node.depends
10931093
end
1094-
return #(node.path or { }) == 0 and 1 or #node.path
1094+
return node.power.distance or #(node.path or {}) == 0 and 1 or #node.path
10951095
end
10961096
local function addReportEntry(node, name, nodePower, pathPower, pathDist, isAlloc, pathPowerStr)
10971097
t_insert(report, {

0 commit comments

Comments
 (0)