Skip to content

Commit

Permalink
Added support for X% more max life if you have X life masteries alloc…
Browse files Browse the repository at this point in the history
  • Loading branch information
synotim authored and Dullson committed Dec 6, 2023
1 parent 0b0ff93 commit ba11f6c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ function PassiveSpecClass:AllocateMasteryEffects(masteryEffects)
self.tree:ProcessStats(self.allocNodes[id])
self.masterySelections[id] = effectId
self.allocatedMasteryCount = self.allocatedMasteryCount + 1
if self.allocNodes[id].name == "Life Mastery" then
self.allocatedLifeMasteryCount = self.allocatedLifeMasteryCount + 1
end
if not self.allocatedMasteryTypes[self.allocNodes[id].name] then
self.allocatedMasteryTypes[self.allocNodes[id].name] = 1
self.allocatedMasteryTypeCount = self.allocatedMasteryTypeCount + 1
Expand Down Expand Up @@ -870,6 +873,7 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
self.allocatedNotableCount = 0
self.allocatedMasteryTypes = { }
self.allocatedMasteryTypeCount = 0
self.allocatedLifeMasteryCount = 0
for id, node in pairs(self.nodes) do
if node.type == "Mastery" and self.masterySelections[id] then
local effect = self.tree.masteryEffects[self.masterySelections[id]]
Expand All @@ -879,6 +883,9 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
node.reminderText = { "Tip: Right click to select a different effect" }
self.tree:ProcessStats(node)
self.allocatedMasteryCount = self.allocatedMasteryCount + 1
if node.name == "Life Mastery" then
self.allocatedLifeMasteryCount = self.allocatedLifeMasteryCount + 1
end
if not self.allocatedMasteryTypes[self.allocNodes[id].name] then
self.allocatedMasteryTypes[self.allocNodes[id].name] = 1
self.allocatedMasteryTypeCount = self.allocatedMasteryTypeCount + 1
Expand Down
8 changes: 8 additions & 0 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ function calcs.initEnv(build, mode, override, specEnv)
local allocatedMasteryCount = env.spec.allocatedMasteryCount
local allocatedMasteryTypeCount = env.spec.allocatedMasteryTypeCount
local allocatedMasteryTypes = copyTable(env.spec.allocatedMasteryTypes)
local allocatedLifeMasteryCount = env.spec.allocatedLifeMasteryCount
if not accelerate.nodeAlloc then
-- Build list of passive nodes
local nodes
Expand All @@ -527,6 +528,9 @@ function calcs.initEnv(build, mode, override, specEnv)
nodes[node.id] = node
if node.type == "Mastery" then
allocatedMasteryCount = allocatedMasteryCount + 1
if node.name == "Life" then
allocatedLifeMasteryCount = allocatedLifeMasteryCount + 1
end

if not allocatedMasteryTypes[node.name] then
allocatedMasteryTypes[node.name] = 1
Expand All @@ -549,6 +553,9 @@ function calcs.initEnv(build, mode, override, specEnv)
elseif override.removeNodes[node] then
if node.type == "Mastery" then
allocatedMasteryCount = allocatedMasteryCount - 1
if node.name == "Life" then
allocatedLifeMasteryCount = allocatedLifeMasteryCount + 1
end

allocatedMasteryTypes[node.name] = allocatedMasteryTypes[node.name] - 1
if allocatedMasteryTypes[node.name] == 0 then
Expand All @@ -568,6 +575,7 @@ function calcs.initEnv(build, mode, override, specEnv)
modDB:NewMod("Multiplier:AllocatedNotable", "BASE", allocatedNotableCount, "")
modDB:NewMod("Multiplier:AllocatedMastery", "BASE", allocatedMasteryCount, "")
modDB:NewMod("Multiplier:AllocatedMasteryType", "BASE", allocatedMasteryTypeCount, "")
modDB:NewMod("Multiplier:AllocatedLifeMastery", "BASE", allocatedLifeMasteryCount)

-- Build and merge item modifiers, and create list of radius jewels
if not accelerate.requirementsItems then
Expand Down
4 changes: 4 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3129,6 +3129,10 @@ local specialModList = {
mod("ShrineBuff", "LIST", { mod = mod("Life", "INC", 20) }),
mod("ShrineBuff", "LIST", { mod = mod("AreaOfEffect", "INC", 20) })
},
--
["(%d+)%% more maximum life if you have at least (%d+) life masteries allocated"] = function(num, _, thresh) return {
mod("Life", "MORE", num, { type = "MultiplierThreshold", var = "AllocatedLifeMastery", threshold = tonumber(thresh) }),
} end,
["(%d+)%% increased effect of shrine buffs on you"] = function(num) return { mod("ShrineBuffEffect", "INC", num) } end,
["left ring slot: cover enemies in ash for 5 seconds when you ignite them"] = { mod("CoveredInAshEffect", "BASE", 20, { type = "SlotNumber", num = 1 }, { type = "ActorCondition", actor = "enemy", var = "Ignited" }) },
["right ring slot: cover enemies in frost for 5 seconds when you freeze them"] = { mod("CoveredInFrostEffect", "BASE", 20, { type = "SlotNumber", num = 2 }, { type = "ActorCondition", actor = "enemy", var = "Frozen" }) },
Expand Down

0 comments on commit ba11f6c

Please sign in to comment.