Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Classes/CalcBreakdownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
-- Build list of modifiers to display
local cfg = (sectionData.cfg and actor.mainSkill[sectionData.cfg.."Cfg"] and copyTable(actor.mainSkill[sectionData.cfg.."Cfg"], true)) or { }
cfg.source = sectionData.modSource
cfg.ignoreSourceinCheckConditions = true
cfg.actor = sectionData.actor
local rowList
local modStore = (sectionData.enemy and actor.enemy.modDB) or (sectionData.cfg and actor.mainSkill.skillModList) or actor.modDB
Expand Down
1 change: 1 addition & 0 deletions src/Classes/CalcSectionControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function CalcSectionClass:FormatStr(str, actor, colData)
local modCfg = (sectionData.cfg and actor.mainSkill[sectionData.cfg.."Cfg"]) or { }
if sectionData.modSource then
modCfg.source = sectionData.modSource
modCfg.ignoreSourceinCheckConditions = true
end
if sectionData.actor then
modCfg.actor = sectionData.actor
Expand Down
6 changes: 6 additions & 0 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,12 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
end
return ""
end)

-- Used to flag Bonded soul core mods
if line:find("Bonded:") then
modLine.bonded = true
end

if modLine.rune then
modLine.enchant = true
end
Expand Down
3 changes: 2 additions & 1 deletion src/Classes/ModDB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ function ModDBClass:FlagInternal(context, cfg, flags, keywordFlags, source, ...)
if modList then
for i = 1, #modList do
local mod = modList[i]
if mod.type == "FLAG" and band(flags, mod.flags) == mod.flags and MatchKeywordFlags(keywordFlags, mod.keywordFlags) and (not source or mod.source:match("[^:]+") == source) then
local checkSource = not cfg or not cfg.ignoreSourceinCheckConditions
if mod.type == "FLAG" and band(flags, mod.flags) == mod.flags and MatchKeywordFlags(keywordFlags, mod.keywordFlags) and (not checkSource or not source or mod.source:match("[^:]+") == source) then
if mod[1] then
if context:EvalMod(mod, cfg) then
return true
Expand Down
34 changes: 33 additions & 1 deletion src/Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,14 @@ function PassiveSpecClass:BuildPathFromNode(root)
-- All nodes that are 1 node away from the root will be processed first, then all nodes that are 2 nodes away, etc
local node = queue[o]
o = o + 1

if node.unlockConstraint then
for _, nodeId in ipairs(node.unlockConstraint.nodes) do
if not self.nodes[nodeId].alloc then
goto continue
end
end
end
local curDist = node.pathDist
-- Iterate through all nodes that are connected to this one
for _, other in ipairs(node.linked) do
Expand All @@ -845,10 +853,23 @@ function PassiveSpecClass:BuildPathFromNode(root)
-- The one exception to that rule is that a path may start from an ascendancy node and pass into the main tree
-- This permits pathing from the Ascendant 'Path of the X' nodes into the respective class start areas
-- 3. They must not pass away from mastery nodes
-- 4. Unlock constraints must be satisfied

-- validate if the other node have unlockConstraints met
local canPath = true
if other.unlockConstraint then
for _, nodeId in ipairs(other.unlockConstraint.nodes) do
if not self.nodes[nodeId].alloc then
canPath = false
break
end
end
end

if not other.pathDist then
ConPrintTable(other, true)
end
if node.type ~= "Mastery" and other.type ~= "ClassStart" and other.type ~= "AscendClassStart" and other.pathDist > curDist and (node.ascendancyName == other.ascendancyName or (curDist == 0 and not other.ascendancyName)) then
if node.type ~= "Mastery" and other.type ~= "ClassStart" and other.type ~= "AscendClassStart" and other.pathDist > curDist and (node.ascendancyName == other.ascendancyName or (curDist == 0 and not other.ascendancyName)) and canPath then
-- The shortest path to the other node is through the current node
other.pathDist = curDist
if not other.alloc then
Expand All @@ -864,6 +885,7 @@ function PassiveSpecClass:BuildPathFromNode(root)
i = i + 1
end
end
::continue::
end
end

Expand Down Expand Up @@ -1021,6 +1043,16 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
end

for _, node in pairs(self.nodes) do
-- if the node have unlockConstraints, add this node as dependent to the constraint nodes
-- we are running here after wiping all depends above
if node.unlockConstraint then
for _, nodeId in ipairs(node.unlockConstraint.nodes) do
if self.nodes[nodeId] then
t_insert(self.nodes[nodeId].depends, node)
end
end
end

-- set attribute nodes
if self.hashOverrides[node.id] then
self:ReplaceNode(node, self.hashOverrides[node.id])
Expand Down
62 changes: 18 additions & 44 deletions src/Classes/PassiveTree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,47 +137,6 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
end
end

self.nodeOverlay = {
Normal = {
artWidth = 70,
alloc = "PSSkillFrameActive",
path = "PSSkillFrameHighlighted",
unalloc = "PSSkillFrame",
allocAscend = "AscendancyFrameSmallAllocated",
pathAscend = "AscendancyFrameSmallCanAllocate",
unallocAscend = "AscendancyFrameSmallNormal"
},
Notable = {
artWidth = 100,
alloc = "NotableFrameAllocated",
path = "NotableFrameCanAllocate",
unalloc = "NotableFrameUnallocated",
allocAscend = "AscendancyFrameLargeAllocated",
pathAscend = "AscendancyFrameLargeCanAllocate",
unallocAscend = "AscendancyFrameLargeNormal",
allocBlighted = "BlightedNotableFrameAllocated",
pathBlighted = "BlightedNotableFrameCanAllocate",
unallocBlighted = "BlightedNotableFrameUnallocated",
},
Keystone = {
artWidth = 138,
alloc = "KeystoneFrameAllocated",
path = "KeystoneFrameCanAllocate",
unalloc = "KeystoneFrameUnallocated",
allocBlighted = "KeystoneFrameAllocated",
pathBlighted = "KeystoneFrameCanAllocate",
unallocBlighted = "KeystoneFrameUnallocated",
},
Socket = {
artWidth = 100,
alloc = "JewelFrameAllocated",
path = "JewelFrameCanAllocate",
unalloc = "JewelFrameUnallocated",
allocAlt = "JewelSocketAltActive",
pathAlt = "JewelSocketAltCanAllocate",
unallocAlt = "JewelSocketAltNormal",
},
}
for type, data in pairs(self.nodeOverlay) do
local asset = self:GetAssetByName(data.alloc)
local artWidth = asset.width * self.scaleImage
Expand Down Expand Up @@ -518,7 +477,21 @@ end
-- Common processing code for nodes (used for both real tree nodes and subgraph nodes)
function PassiveTreeClass:ProcessNode(node)
node.targetSize = self:GetNodeTargetSize(node)
node.overlay = node.containJewelSocket and node.jewelOverlay or self.nodeOverlay[node.type]
local overlayData
if node.nodeOverlay then
overlayData = { }
for type, data in pairs(node.nodeOverlay) do
overlayData[type] = data
end
local asset = self:GetAssetByName(overlayData.alloc)
local artWidth = asset.width * self.scaleImage
overlayData.artWidth = artWidth
overlayData.size = artWidth
overlayData.rsq = overlayData.size * overlayData.size
else
overlayData = self.nodeOverlay[node.type]
end
node.overlay = overlayData
if node.overlay then
local size = node.targetSize["overlay"] and node.targetSize["overlay"].width or node.targetSize.width
node.rsq = size * size
Expand Down Expand Up @@ -588,6 +561,7 @@ end
function PassiveTreeClass:BuildConnector(node1, node2, connection)
local connector = {
ascendancyName = node1.ascendancyName,
connectionArt = node1.connectionArt or node2.connectionArt or self.connectionArt[node1.ascendancyName and "ascendancy" or "default"],
nodeId1 = node1.id,
nodeId2 = node2.id,
c = { } -- This array will contain the quad's data: 1-8 are the vertex coordinates, 9-16 are the texture coordinates
Expand Down Expand Up @@ -682,7 +656,7 @@ function PassiveTreeClass:BuildConnector(node1, node2, connection)

-- Generate a straight line
connector.type = "LineConnector"
local art = self:GetAssetByName("LineConnectorNormal")
local art = self:GetAssetByName(connector.connectionArt .. "LineConnectorNormal")
local vX, vY = node2.x - node1.x, node2.y - node1.y
local dist = m_sqrt(vX * vX + vY * vY)
local scale = art.height * 0.5 * self.scaleImage / dist
Expand Down Expand Up @@ -718,7 +692,7 @@ function PassiveTreeClass:BuildArc(arcAngle, orbit, xScale, yScale, angle, conne
connector.vert = { }
for _, state in pairs({ "Normal", "Intermediate", "Active" }) do
-- The different line states have differently-sized artwork, so the vertex coords must be calculated separately for each one
local art = self:GetAssetByName(connector.type .. state)
local art = self:GetAssetByName( connector.connectionArt .. connector.type .. state)
local size = art.width * self.scaleImage --self.orbitRadii[orbit + 1] * self.scaleImage
local oX, oY = size * m_sqrt(2) * m_sin(angle + m_pi / 4), size * m_sqrt(2) * -m_cos(angle + m_pi / 4)
local cX, cY = xScale + oX, yScale + oY
Expand Down
17 changes: 11 additions & 6 deletions src/Classes/PassiveTreeView.lua
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
setConnectorColor(0.75, 0.75, 0.75)
end
SetDrawColor(unpack(connectorColor))
handle = tree:GetAssetByName(connector.type..state).handle
handle = tree:GetAssetByName(connector.connectionArt .. connector.type..state).handle
DrawImageQuad(handle, unpack(connector.c))
end

Expand Down Expand Up @@ -671,11 +671,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)

base = tree:GetAssetByName(node.icon)

overlay = node.overlay[state .. (node.ascendancyName and "Ascend" or "") .. (node.isBlighted and "Blighted" or "")]

if node.ascendancyName and tree.secondaryAscendNameMap and tree.secondaryAscendNameMap[node.ascendancyName] then
overlay = "Azmeri"..overlay
end
overlay = node.overlay[state]
end
end

Expand Down Expand Up @@ -1119,6 +1115,15 @@ function PassiveTreeViewClass:DoesNodeMatchSearchParams(node)
if #needMatches == 0 then
return true
end

-- Check unlock ascendancy
if node.unlockConstraint then
err, needMatches = PCall(search, node.unlockConstraint.ascendancy:lower(), needMatches)
if err then return false end
if #needMatches == 0 then
return true
end
end

-- Check node id for devs
if launch.devMode then
Expand Down
Loading
Loading