Skip to content

Commit 913922c

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 3b3bf78 + 0a855f8 commit 913922c

22 files changed

+388
-306
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 1.4.77 - 2018/02/24
2+
* Added Might of the Meek
3+
* Improved the handling of radius jewels; this mainly addresses issues with overlapping jewels
4+
* Notably, threshold jewels will now correctly handle nearby nodes that have converted attributes
5+
16
### 1.4.76 - 2018/02/23
27
* Added Atziri's Reflection
38
* Unique items can now be made Elder/Shaper

Classes/CalcBreakdownControl.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
351351
local node = build.spec.nodes[tonumber(nodeId)]
352352
row.sourceName = node.dn
353353
row.sourceNameNode = node
354-
elseif row.mod.source == "Tree:Jewel" then
355-
row.sourceName = "Jewel conversion"
356354
end
357355
elseif sourceType == "Skill" then
358356
-- Extract skill name
@@ -389,14 +387,16 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
389387
else
390388
desc = baseVal.." per "..self:FormatModName(tag.var)
391389
end
390+
elseif tag.type == "MultiplierThreshold" then
391+
desc = "If "..self:FormatModName(tag.var)..(tag.upper and " <= " or " >= ")..(tag.threshold or self:FormatModName(tag.thresholdVar))
392392
elseif tag.type == "PerStat" then
393393
if tag.base then
394394
desc = (row.mod.type == "BASE" and string.format("%+g", tag.base) or tag.base.."%").." + "..math.abs(row.mod.value).." per "..(tag.div or 1).." "..self:FormatModName(tag.var)
395395
else
396396
desc = baseVal.." per "..(tag.div or 1).." "..self:FormatModName(tag.stat)
397397
end
398398
elseif tag.type == "StatThreshold" then
399-
desc = "If "..self:FormatModName(tag.stat).." >= "..tag.threshold
399+
desc = "If "..self:FormatModName(tag.stat)..(tag.upper and " <= " or " >= ")..(tag.threshold or self:FormatModName(tag.thresholdStat))
400400
elseif tag.type == "SkillName" then
401401
desc = "Skill: "..tag.skillName
402402
elseif tag.type == "SkillId" then

Classes/CalcsTab.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ function CalcsTabClass:BuildOutput()
391391
ConPrintf("Calc time: %d msec", GetTime() - start)
392392
--]]
393393

394+
for _, node in pairs(self.build.spec.nodes) do
395+
-- Set default final mod list for all nodes; some may not be set during the main pass
396+
node.finalModList = node.modList
397+
end
398+
394399
self.mainEnv = self.calcs.buildOutput(self.build, "MAIN")
395400
self.mainOutput = self.mainEnv.player.output
396401
self.calcsEnv = self.calcs.buildOutput(self.build, "CALCS")

Classes/ItemsTab.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ local ItemsTabClass = common.NewClass("ItemsTab", "UndoHandler", "ControlHost",
104104
self.sockets = { }
105105
local socketOrder = { }
106106
for _, node in pairs(build.tree.nodes) do
107-
if node.type == "socket" then
107+
if node.type == "Socket" then
108108
t_insert(socketOrder, node)
109109
end
110110
end
@@ -1773,7 +1773,7 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
17731773
end
17741774
end
17751775
if line then
1776-
tooltip:AddLine(16, "^x7F7F7FAllocated in Radius: "..line)
1776+
tooltip:AddLine(16, "^x7F7F7FAttributes in Radius: "..line)
17771777
end
17781778
end
17791779
end

Classes/ModDB.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ function ModDBClass:EvalMod(mod, cfg)
141141
else
142142
mult = (self.multipliers[tag.var] or 0) + self:Sum("BASE", cfg, multiplierName[tag.var])
143143
end
144-
if mult < tag.threshold then
144+
local threshold = tag.threshold or ((self.multipliers[tag.thresholdVar] or 0) + self:Sum("BASE", cfg, multiplierName[tag.thresholdVar]))
145+
if (tag.upper and mult > tag.threshold) or (not tag.upper and mult < tag.threshold) then
145146
return
146147
end
147148
elseif tag.type == "PerStat" then
@@ -162,7 +163,9 @@ function ModDBClass:EvalMod(mod, cfg)
162163
value = value * mult + (tag.base or 0)
163164
end
164165
elseif tag.type == "StatThreshold" then
165-
if (self.actor.output[tag.stat] or (cfg and cfg.skillStats and cfg.skillStats[tag.stat]) or 0) < tag.threshold then
166+
local stat = self.actor.output[tag.stat] or (cfg and cfg.skillStats and cfg.skillStats[tag.stat]) or 0
167+
local threshold = tag.threshold or (self.actor.output[tag.thresholdStat] or (cfg and cfg.skillStats and cfg.skillStats[tag.thresholdStat]) or 0)
168+
if (tag.upper and stat > threshold) or (not tag.upper and stat < threshold) then
166169
return
167170
end
168171
elseif tag.type == "DistanceRamp" then

Classes/ModList.lua

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ function ModListClass:AddMod(mod)
3838
t_insert(self, mod)
3939
end
4040

41+
function ModListClass:MergeMod(mod)
42+
if mod.type == "BASE" or mod.type == "INC" then
43+
for i = 1, #self do
44+
if modLib.compareModParams(self[i], mod) then
45+
self[i] = copyTable(self[i], true)
46+
self[i].value = self[i].value + mod.value
47+
return
48+
end
49+
end
50+
end
51+
self:AddMod(mod)
52+
end
53+
4154
function ModListClass:ScaleAddMod(mod, scale)
4255
if scale == 1 then
4356
self:AddMod(mod)
@@ -82,6 +95,10 @@ function ModListClass:NewMod(...)
8295
self:AddMod(mod_createMod(...))
8396
end
8497

98+
function ModListClass:MergeNewMod(...)
99+
self:MergeMod(mod_createMod(...))
100+
end
101+
85102
function ModListClass:EvalMod(mod, cfg)
86103
local value = mod.value
87104
for _, tag in ipairs(mod) do
@@ -118,7 +135,8 @@ function ModListClass:EvalMod(mod, cfg)
118135
else
119136
mult = (self.multipliers[tag.var] or 0) + self:Sum("BASE", cfg, multiplierName[tag.var])
120137
end
121-
if mult < tag.threshold then
138+
local threshold = tag.threshold or ((self.multipliers[tag.thresholdVar] or 0) + self:Sum("BASE", cfg, multiplierName[tag.thresholdVar]))
139+
if (tag.upper and mult > tag.threshold) or (not tag.upper and mult < tag.threshold) then
122140
return
123141
end
124142
elseif tag.type == "PerStat" then
@@ -139,7 +157,9 @@ function ModListClass:EvalMod(mod, cfg)
139157
value = value * mult + (tag.base or 0)
140158
end
141159
elseif tag.type == "StatThreshold" then
142-
if (self.actor.output[tag.stat] or (cfg and cfg.skillStats and cfg.skillStats[tag.stat]) or 0) < tag.threshold then
160+
local stat = self.actor.output[tag.stat] or (cfg and cfg.skillStats and cfg.skillStats[tag.stat]) or 0
161+
local threshold = tag.threshold or (self.actor.output[tag.thresholdStat] or (cfg and cfg.skillStats and cfg.skillStats[tag.thresholdStat]) or 0)
162+
if (tag.upper and stat > threshold) or (not tag.upper and stat < threshold) then
143163
return
144164
end
145165
elseif tag.type == "DistanceRamp" then

Classes/PassiveSpec.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ end
178178
function PassiveSpecClass:EncodeURL(prefix)
179179
local a = { 0, 0, 0, 4, self.curClassId, self.curAscendClassId, 0 }
180180
for id, node in pairs(self.allocNodes) do
181-
if node.type ~= "classStart" and node.type ~= "ascendClassStart" then
181+
if node.type ~= "ClassStart" and node.type ~= "AscendClassStart" then
182182
t_insert(a, m_floor(id / 256))
183183
t_insert(a, id % 256)
184184
end
@@ -263,7 +263,7 @@ end
263263
-- Clear the allocated status of all non-class-start nodes
264264
function PassiveSpecClass:ResetNodes()
265265
for id, node in pairs(self.nodes) do
266-
if node.type ~= "classStart" and node.type ~= "ascendClassStart" then
266+
if node.type ~= "ClassStart" and node.type ~= "AscendClassStart" then
267267
node.alloc = false
268268
self.allocNodes[id] = nil
269269
end
@@ -320,15 +320,15 @@ end
320320
function PassiveSpecClass:CountAllocNodes()
321321
local used, ascUsed, sockets = 0, 0, 0
322322
for _, node in pairs(self.allocNodes) do
323-
if node.type ~= "classStart" and node.type ~= "ascendClassStart" then
323+
if node.type ~= "ClassStart" and node.type ~= "AscendClassStart" then
324324
if node.ascendancyName then
325325
if not node.isMultipleChoiceOption then
326326
ascUsed = ascUsed + 1
327327
end
328328
else
329329
used = used + 1
330330
end
331-
if node.type == "socket" then
331+
if node.type == "Socket" then
332332
sockets = sockets + 1
333333
end
334334
end
@@ -348,8 +348,8 @@ function PassiveSpecClass:FindStartFromNode(node, visited, noAscend)
348348
-- Either:
349349
-- - the other node is a start node, or
350350
-- - there is a path to a start node through the other node which didn't pass through any nodes which have already been visited
351-
if other.alloc and (other.type == "classStart" or other.type == "ascendClassStart" or (not other.visited and self:FindStartFromNode(other, visited, noAscend))) then
352-
if not noAscend or other.type ~= "ascendClassStart" then
351+
if other.alloc and (other.type == "ClassStart" or other.type == "AscendClassStart" or (not other.visited and self:FindStartFromNode(other, visited, noAscend))) then
352+
if not noAscend or other.type ~= "AscendClassStart" then
353353
return true
354354
end
355355
end
@@ -375,7 +375,7 @@ function PassiveSpecClass:BuildPathFromNode(root)
375375
-- 2. They cannot pass between different ascendancy classes or between an ascendancy class and the main tree
376376
-- The one exception to that rule is that a path may start from an ascendancy node and pass into the main tree
377377
-- This permits pathing from the Ascendant 'Path of the X' nodes into the respective class start areas
378-
if other.type ~= "classStart" and other.type ~= "ascendClassStart" and other.pathDist > curDist and (node.ascendancyName == other.ascendancyName or (curDist == 1 and not other.ascendancyName)) then
378+
if other.type ~= "ClassStart" and other.type ~= "AscendClassStart" and other.pathDist > curDist and (node.ascendancyName == other.ascendancyName or (curDist == 1 and not other.ascendancyName)) then
379379
-- The shortest path to the other node is through the current node
380380
other.pathDist = curDist
381381
other.path = wipeTable(other.path)
@@ -400,7 +400,7 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
400400
for id, node in pairs(self.nodes) do
401401
node.depends = wipeTable(node.depends)
402402
node.dependsOnIntuitiveLeap = false
403-
if node.type ~= "classStart" then
403+
if node.type ~= "ClassStart" then
404404
for nodeId, itemId in pairs(self.jewels) do
405405
if self.allocNodes[nodeId] and self.nodes[nodeId].nodesInRadius[1][node.id] then
406406
if itemId ~= 0 and self.build.itemsTab.items[itemId] and self.build.itemsTab.items[itemId].jewelData and self.build.itemsTab.items[itemId].jewelData.intuitiveLeap then
@@ -422,11 +422,11 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
422422
for id, node in pairs(self.allocNodes) do
423423
node.visited = true
424424

425-
local anyStartFound = (node.type == "classStart" or node.type == "ascendClassStart")
425+
local anyStartFound = (node.type == "ClassStart" or node.type == "AscendClassStart")
426426
for _, other in ipairs(node.linked) do
427427
if other.alloc and not isValueInArray(node.depends, other) then
428428
-- The other node is allocated and isn't already dependant on this node, so try and find a path to a start node through it
429-
if other.type == "classStart" or other.type == "ascendClassStart" then
429+
if other.type == "ClassStart" or other.type == "AscendClassStart" then
430430
-- Well that was easy!
431431
anyStartFound = true
432432
elseif self:FindStartFromNode(other, visited) then

Classes/PassiveTree.lua

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
125125
[6] = "centershadow"
126126
}
127127
local nodeOverlay = {
128-
normal = {
128+
Normal = {
129129
artWidth = 40,
130130
alloc = "PSSkillFrameActive",
131131
path = "PSSkillFrameHighlighted",
@@ -134,7 +134,7 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
134134
pathAscend = "PassiveSkillScreenAscendancyFrameSmallCanAllocate",
135135
unallocAscend = "PassiveSkillScreenAscendancyFrameSmallNormal"
136136
},
137-
notable = {
137+
Notable = {
138138
artWidth = 58,
139139
alloc = "NotableFrameAllocated",
140140
path = "NotableFrameCanAllocate",
@@ -143,13 +143,13 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
143143
pathAscend = "PassiveSkillScreenAscendancyFrameLargeCanAllocate",
144144
unallocAscend = "PassiveSkillScreenAscendancyFrameLargeNormal"
145145
},
146-
keystone = {
146+
Keystone = {
147147
artWidth = 84,
148148
alloc = "KeystoneFrameAllocated",
149149
path = "KeystoneFrameCanAllocate",
150150
unalloc = "KeystoneFrameUnallocated"
151151
},
152-
socket = {
152+
Socket = {
153153
artWidth = 58,
154154
alloc = "JewelFrameAllocated",
155155
path = "JewelFrameCanAllocate",
@@ -177,26 +177,26 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
177177

178178
-- Determine node type
179179
if node.spc[0] then
180-
node.type = "classStart"
180+
node.type = "ClassStart"
181181
local class = self.classes[node.spc[0]]
182182
class.startNodeId = node.id
183183
node.startArt = classArt[node.spc[0]]
184184
elseif node.isAscendancyStart then
185-
node.type = "ascendClassStart"
185+
node.type = "AscendClassStart"
186186
local ascendClass = self.ascendNameMap[node.ascendancyName].ascendClass
187187
ascendClass.startNodeId = node.id
188188
elseif node.m then
189-
node.type = "mastery"
189+
node.type = "Mastery"
190190
elseif node.isJewelSocket then
191-
node.type = "socket"
191+
node.type = "Socket"
192192
sockets[node.id] = node
193193
elseif node.ks then
194-
node.type = "keystone"
194+
node.type = "Keystone"
195195
self.keystoneMap[node.dn] = node
196196
elseif node["not"] then
197-
node.type = "notable"
197+
node.type = "Notable"
198198
else
199-
node.type = "normal"
199+
node.type = "Normal"
200200
end
201201

202202
-- Assign node artwork assets
@@ -299,7 +299,7 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
299299
end
300300
end
301301
end
302-
if node.type == "keystone" then
302+
if node.type == "Keystone" then
303303
node.keystoneMod = modLib.createMod("Keystone", "LIST", node.dn, "Tree"..node.id)
304304
end
305305
end
@@ -317,9 +317,6 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
317317
local vX, vY = node.x - socket.x, node.y - socket.y
318318
if vX * vX + vY * vY <= rSq then
319319
socket.nodesInRadius[radiusIndex][node.id] = node
320-
for _, att in pairs({"Str","Dex","Int"}) do
321-
socket.attributesInRadius[radiusIndex][att] = (socket.attributesInRadius[radiusIndex][att] or 0) + node.modList:Sum("BASE", nil, att)
322-
end
323320
end
324321
end
325322
end
@@ -333,7 +330,7 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
333330
local other = nodeMap[otherId]
334331
t_insert(node.linkedId, otherId)
335332
t_insert(other.linkedId, node.id)
336-
if node.type ~= "classStart" and other.type ~= "classStart" and node.type ~= "mastery" and other.type ~= "mastery" and node.ascendancyName == other.ascendancyName then
333+
if node.type ~= "ClassStart" and other.type ~= "ClassStart" and node.type ~= "Mastery" and other.type ~= "Mastery" and node.ascendancyName == other.ascendancyName then
337334
t_insert(self.connectors, self:BuildConnector(node, other))
338335
end
339336
end
@@ -343,7 +340,7 @@ local PassiveTreeClass = common.NewClass("PassiveTree", function(self, targetVer
343340
local startNode = nodeMap[class.startNodeId]
344341
for _, nodeId in ipairs(startNode.linkedId) do
345342
local node = nodeMap[nodeId]
346-
if node.type == "normal" then
343+
if node.type == "Normal" then
347344
node.modList:NewMod("Condition:ConnectedTo"..class.name.."Start", "FLAG", true, "Tree:"..nodeId)
348345
end
349346
end

0 commit comments

Comments
 (0)