Skip to content

Commit 37e8867

Browse files
authored
[Kalandra] Add support for counting Mastery Type allocations (#4746)
* Feat: Add support for counting Mastery Type allocations * added support for on kill portion of ascendancy node * Fix spacing
1 parent f61b17a commit 37e8867

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/Classes/PassiveSpec.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ function PassiveSpecClass:AllocateMasteryEffects(masteryEffects)
221221
self.tree:ProcessStats(self.allocNodes[id])
222222
self.masterySelections[id] = effectId
223223
self.allocatedMasteryCount = self.allocatedMasteryCount + 1
224+
if not self.allocatedMasteryTypes[self.allocNodes[id].name] then
225+
self.allocatedMasteryTypes[self.allocNodes[id].name] = true
226+
self.allocatedMasteryTypeCount = self.allocatedMasteryTypeCount + 1
227+
end
224228
end
225229
end
226230

@@ -849,6 +853,8 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
849853
-- Add selected mastery effect mods to mastery nodes
850854
self.allocatedMasteryCount = 0
851855
self.allocatedNotableCount = 0
856+
self.allocatedMasteryTypes = { }
857+
self.allocatedMasteryTypeCount = 0
852858
for id, node in pairs(self.nodes) do
853859
if node.type == "Mastery" and self.masterySelections[id] then
854860
local effect = self.tree.masteryEffects[self.masterySelections[id]]
@@ -858,6 +864,10 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
858864
node.reminderText = { "Tip: Right click to select a different effect" }
859865
self.tree:ProcessStats(node)
860866
self.allocatedMasteryCount = self.allocatedMasteryCount + 1
867+
if not self.allocatedMasteryTypes[node.name] then
868+
self.allocatedMasteryTypes[node.name] = true
869+
self.allocatedMasteryTypeCount = self.allocatedMasteryTypeCount + 1
870+
end
861871
else
862872
self.nodes[id].alloc = false
863873
self.allocNodes[id] = nil

src/Modules/CalcSetup.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ function calcs.initEnv(build, mode, override, specEnv)
423423
modDB:NewMod("PerAbsorptionElementalEnergyShieldRecoup", "BASE", 12, "Base")
424424
modDB:NewMod("Multiplier:AllocatedNotable", "BASE", env.spec.allocatedNotableCount, "")
425425
modDB:NewMod("Multiplier:AllocatedMastery", "BASE", env.spec.allocatedMasteryCount, "")
426+
modDB:NewMod("Multiplier:AllocatedMasteryType", "BASE", env.spec.allocatedMasteryTypeCount, "")
426427

427428
-- Add bandit mods
428429
if env.configInput.bandit == "Alira" then

src/Modules/ModParser.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@ local modTagList = {
10821082
["per fragile regrowth"] = { tag = { type = "Multiplier", var = "FragileRegrowthCount" } },
10831083
["per allocated mastery passive skill"] = { tag = { type = "Multiplier", var = "AllocatedMastery" } },
10841084
["per allocated notable passive skill"] = { tag = { type = "Multiplier", var = "AllocatedNotable" } },
1085+
["for each different type of mastery you have allocated"] = { tag = { type = "Multiplier", var = "AllocatedMasteryType" } },
10851086
-- Per stat
10861087
["per (%d+)%% of maximum mana they reserve"] = function(num) return { tag = { type = "PerStat", stat = "ManaReservedPercent", div = num } } end,
10871088
["per (%d+) strength"] = function(num) return { tag = { type = "PerStat", stat = "Str", div = num } } end,
@@ -2971,15 +2972,18 @@ local specialModList = {
29712972
["(%d+) life gained for each cursed enemy hit by your attacks"] = function(num) return { mod("LifeOnHit", "BASE", num, { type = "ActorCondition", actor = "enemy", var = "Cursed"})} end,
29722973
["(%d+) mana gained for each cursed enemy hit by your attacks"] = function(num) return { mod("ManaOnHit", "BASE", num, { type = "ActorCondition", actor = "enemy", var = "Cursed"})} end,
29732974
["recover (%d+)%% of life on kill"] = function(num) return { mod("LifeOnKill", "BASE", 1, { type = "PercentStat", stat = "Life", percent = num }) } end,
2975+
["recover (%d+)%% of life on kill for each different type of mastery you have allocated"] = function(num) return { mod("LifeOnKill", "BASE", 1, { type = "PercentStat", stat = "Life", percent = num }, { type = "Multiplier", var = "AllocatedMasteryType"}) } end,
29742976
["recover (%d+)%% of life on killing a poisoned enemy"] = function(num) return { mod("LifeOnKill", "BASE", 1, { type = "PercentStat", stat = "Life", percent = num }, { type = "MultiplierThreshold", actor = "enemy", var = "PoisonStack", threshold = 1 }) } end,
29752977
["recover (%d+)%% of life on killing a chilled enemy"] = function(num) return { mod("LifeOnKill", "BASE", 1, { type = "PercentStat", stat = "Life", percent = num }, { type = "ActorCondition", actor = "enemy", var = "Chilled" }) } end,
29762978
["recover (%d+)%% of life on kill if you've spent life recently"] = function(num) return { mod("LifeOnKill", "BASE", 1, { type = "PercentStat", stat = "Life", percent = num }, { type = "MultiplierThreshold", var = "LifeSpentRecently", threshold = 1 }) } end,
29772979
["lose (%d+)%% of life on kill"] = function(num) return { mod("LifeOnKill", "BASE", -1, { type = "PercentStat", stat = "Life", percent = num }) } end,
29782980
["%+(%d+) life gained on killing ignited enemies"] = function(num) return { mod("LifeOnKill", "BASE", num, { type = "ActorCondition", actor = "enemy", var = "Ignited" }) } end,
29792981
["recover (%d+)%% of mana on kill"] = function(num) return { mod("ManaOnKill", "BASE", 1, { type = "PercentStat", stat = "Mana", percent = num }) } end,
2982+
["recover (%d+)%% of mana on kill for each different type of mastery you have allocated"] = function(num) return { mod("ManaOnKill", "BASE", 1, { type = "PercentStat", stat = "Mana", percent = num }, { type = "Multiplier", var = "AllocatedMasteryType"}) } end,
29802983
["lose (%d+)%% of mana on kill"] = function(num) return { mod("ManaOnKill", "BASE", -1, { type = "PercentStat", stat = "Mana", percent = num }) } end,
29812984
["%+(%d+) mana gained on killing a frozen enemy"] = function(num) return { mod("ManaOnKill", "BASE", num, { type = "ActorCondition", actor = "enemy", var = "Frozen" }) } end,
29822985
["recover (%d+)%% of energy shield on kill"] = function(num) return { mod("EnergyShieldOnKill", "BASE", 1, { type = "PercentStat", stat = "EnergyShield", percent = num }) } end,
2986+
["recover (%d+)%% of energy shield on kill for each different type of mastery you have allocated"] = function(num) return { mod("EnergyShieldOnKill", "BASE", 1, { type = "PercentStat", stat = "EnergyShield", percent = num }, { type = "Multiplier", var = "AllocatedMasteryType"}) } end,
29832987
["lose (%d+)%% of energy shield on kill"] = function(num) return { mod("EnergyShieldOnKill", "BASE", -1, { type = "PercentStat", stat = "EnergyShield", percent = num }) } end,
29842988
["%+(%d+) energy shield gained on killing a shocked enemy"] = function(num) return { mod("EnergyShieldOnKill", "BASE", num, { type = "ActorCondition", actor = "enemy", var = "Shocked" }) } end,
29852989
["%+(%d+) energy shield gained on kill per level"] = function(num) return { mod("EnergyShieldOnKill", "BASE", num, { type = "Multiplier", var = "Level" }) } end,

0 commit comments

Comments
 (0)