diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index c71602d263..87fa615ca7 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -685,11 +685,13 @@ end -- Count the number of allocated nodes and allocated ascendancy nodes function PassiveSpecClass:CountAllocNodes() - local used, ascUsed, sockets = 0, 0, 0 + local used, ascUsed, secondaryAscUsed, sockets = 0, 0, 0, 0 for _, node in pairs(self.allocNodes) do - if node.type ~= "ClassStart" and node.type ~= "AscendClassStart" and not (node.ascendancyName and (node.ascendancyName == "Warden" or node.ascendancyName == "Warlock" or node.ascendancyName == "Primalist")) then - if node.ascendancyName then - if not node.isMultipleChoiceOption then + if node.type ~= "ClassStart" and node.type ~= "AscendClassStart" then + if node.ascendancyName and not node.isMultipleChoiceOption then + if self.tree.secondaryAscendNameMap and self.tree.secondaryAscendNameMap[node.ascendancyName] then + secondaryAscUsed = secondaryAscUsed + 1 + else ascUsed = ascUsed + 1 end else @@ -700,7 +702,7 @@ function PassiveSpecClass:CountAllocNodes() end end end - return used, ascUsed, sockets + return used, ascUsed, secondaryAscUsed, sockets end -- Attempt to find a class start node starting from the given node diff --git a/src/Classes/PassiveTree.lua b/src/Classes/PassiveTree.lua index f9c00d4c96..41442991a3 100644 --- a/src/Classes/PassiveTree.lua +++ b/src/Classes/PassiveTree.lua @@ -122,6 +122,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion) end if self.alternate_ascendancies then + self.secondaryAscendNameMap = { } local alternate_ascendancies_class = { ["name"]= "alternate_ascendancies", ["classes"]= self.alternate_ascendancies @@ -133,6 +134,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion) ascendClassId = ascendClassId, ascendClass = ascendClass } + self.secondaryAscendNameMap[ascendClass.id] = self.ascendNameMap[ascendClass.id] end end diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index 6d97a1eac6..617e238abd 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -474,7 +474,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) overlay = isAlloc and node.startArt or "PSStartNodeBackgroundInactive" elseif node.type == "AscendClassStart" then overlay = treeVersions[tree.treeVersion].num >= 3.10 and "AscendancyMiddle" or "PassiveSkillScreenAscendancyMiddle" - if node.ascendancyName and (node.ascendancyName == "Warden" or node.ascendancyName == "Warlock" or node.ascendancyName == "Primalist") then + if node.ascendancyName and tree.secondaryAscendNameMap and tree.secondaryAscendNameMap[node.ascendancyName] then overlay = "Azmiri"..overlay end else @@ -541,7 +541,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) end base = node.sprites[node.type:lower()..(isAlloc and "Active" or "Inactive")] overlay = node.overlay[state .. (node.ascendancyName and "Ascend" or "") .. (node.isBlighted and "Blighted" or "")] - if node.ascendancyName and (node.ascendancyName == "Warden" or node.ascendancyName == "Warlock" or node.ascendancyName == "Primalist") then + if node.ascendancyName and tree.secondaryAscendNameMap and tree.secondaryAscendNameMap[node.ascendancyName] then overlay = "Azmiri"..overlay end end diff --git a/src/Classes/TreeTab.lua b/src/Classes/TreeTab.lua index 86167f581f..5b96a41ec2 100644 --- a/src/Classes/TreeTab.lua +++ b/src/Classes/TreeTab.lua @@ -52,7 +52,7 @@ local TreeTabClass = newClass("TreeTab", "ControlHost", function(self, build) if mode ~= "OUT" then local spec = self.specList[selIndex] if spec then - local used, ascUsed, sockets = spec:CountAllocNodes() + local used, ascUsed, secondaryAscUsed, sockets = spec:CountAllocNodes() tooltip:AddLine(16, "Class: "..spec.curClassName) tooltip:AddLine(16, "Ascendancy: "..spec.curAscendClassName) tooltip:AddLine(16, "Points used: "..used) diff --git a/src/Modules/Build.lua b/src/Modules/Build.lua index 71b3124fca..d8033ad6e0 100644 --- a/src/Modules/Build.lua +++ b/src/Modules/Build.lua @@ -756,9 +756,9 @@ local function actExtra(act, extra) end function buildMode:EstimatePlayerProgress() - local PointsUsed, AscUsed = self.spec:CountAllocNodes() + local PointsUsed, AscUsed, SecondaryAscUsed = self.spec:CountAllocNodes() local extra = self.calcsTab.mainOutput and self.calcsTab.mainOutput.ExtraPoints or 0 - local usedMax, ascMax, level, act = 99 + 22 + extra, 8, 1, 0 + local usedMax, ascMax, secondaryAscMax, level, act = 99 + 22 + extra, 8, 8, 1, 0 -- Find estimated act and level based on points used repeat @@ -782,6 +782,7 @@ function buildMode:EstimatePlayerProgress() if PointsUsed > usedMax then InsertIfNew(self.controls.warnings.lines, "You have too many passive points allocated") end if AscUsed > ascMax then InsertIfNew(self.controls.warnings.lines, "You have too many ascendancy points allocated") end + if SecondaryAscUsed > secondaryAscMax then InsertIfNew(self.controls.warnings.lines, "You have too many secondary ascendancy points allocated") end self.Act = level < 90 and act <= 10 and act or "Endgame" return string.format("%s%3d / %3d %s%d / %d", PointsUsed > usedMax and colorCodes.NEGATIVE or "^7", PointsUsed, usedMax, AscUsed > ascMax and colorCodes.NEGATIVE or "^7", AscUsed, ascMax),