Skip to content

Commit 7a686f4

Browse files
justjuanguijustjuanguiLocalIdentity
authored
More Passive Tree Nodes Mods support (#162)
* Triggered Spells deal increased, gain rage on and inc damage pe chance block was added * Stun Threshold Passive Nodes was added, LowestOfArmourAndEvasionOn was added * Fix PerStat type in Stun Threshold * Fix Stun Threshold per Strength mod * Calcs information regarding Stun Threshold was improved * Fix formatting --------- Co-authored-by: justjuangui <servicios@juacarvajal.com> Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent cd72f94 commit 7a686f4

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/Modules/CalcDefence.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ function calcs.defence(env, actor)
575575
end
576576
output["EvasionOn"..slot] = evasionBase
577577
end
578+
output["LowestOfArmourAndEvasionOn"..slot] = m_min(armourBase, evasionBase)
578579
end
579580
end
580581

@@ -2116,7 +2117,8 @@ function calcs.buildDefenceEstimations(env, actor)
21162117
end
21172118
local StunThresholdInc = 1 + modDB:Sum("INC", nil, "StunThreshold") / 100
21182119
local StunThresholdMore = modDB:More("INC", nil, "StunThreshold")
2119-
output.StunThreshold = stunThresholdBase * StunThresholdInc * StunThresholdMore
2120+
local StunThresholdModBase = modDB:Sum("BASE", nil, "StunThreshold")
2121+
output.StunThreshold = (stunThresholdBase + StunThresholdModBase) * StunThresholdInc * StunThresholdMore
21202122

21212123
local notAvoidChance = modDB:Flag(nil, "StunImmune") and 0 or 100 - m_min(modDB:Sum("BASE", nil, "AvoidStun"), 100)
21222124
if output.EnergyShield > output["totalTakenHit"] and not env.modDB:Flag(nil, "EnergyShieldProtectsMana") then
@@ -2126,6 +2128,12 @@ function calcs.buildDefenceEstimations(env, actor)
21262128

21272129
if breakdown then
21282130
breakdown.StunThreshold = { s_format("%d ^8(base from %s)", stunThresholdBase, stunThresholdSource) }
2131+
for _, source in ipairs({"Tree", "Item", "Skill"}) do
2132+
local sourceVal = modDB:Sum("BASE", { source = source }, "StunThreshold")
2133+
if sourceVal > 0 then
2134+
t_insert(breakdown.StunThreshold, s_format("+ %d ^8(base from %s)", sourceVal, source))
2135+
end
2136+
end
21292137
if StunThresholdInc ~= 1 then
21302138
t_insert(breakdown.StunThreshold, s_format("* %.2f ^8(increased threshold)", StunThresholdInc))
21312139
end

src/Modules/ModParser.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,7 @@ local preFlagList = {
11511151
["^non%-channelling skills have "] = { tag = { type = "SkillType", skillType = SkillType.Channel, neg = true } },
11521152
["^non%-vaal skills deal "] = { tag = { type = "SkillType", skillType = SkillType.Vaal, neg = true } },
11531153
["^skills [hgdf][aei][vari][eln] "] = { },
1154+
["^triggered spells [hd][ae][va][el] "] = { keywordFlags = KeywordFlag.Spell, tag = { type = "SkillType", skillType = SkillType.Triggered } },
11541155
-- Slot specific
11551156
["^left ring slot: "] = { tag = { type = "SlotNumber", num = 1 } },
11561157
["^right ring slot: "] = { tag = { type = "SlotNumber", num = 2 } },
@@ -1357,6 +1358,7 @@ local modTagList = {
13571358
["per tailwind"] = { tag = { type = "Multiplier", var = "Tailwind" } },
13581359
-- Per stat
13591360
["per (%d+)%% of maximum mana they reserve"] = function(num) return { tag = { type = "PerStat", stat = "ManaReservedPercent", div = num } } end,
1361+
["per strength"] = { tag = { type = "PerStat", stat = "Str"} },
13601362
["per (%d+) strength"] = function(num) return { tag = { type = "PerStat", stat = "Str", div = num } } end,
13611363
["per (%d+) dexterity"] = function(num) return { tag = { type = "PerStat", stat = "Dex", div = num } } end,
13621364
["per (%d+) intelligence"] = function(num) return { tag = { type = "PerStat", stat = "Int", div = num } } end,
@@ -1378,6 +1380,7 @@ local modTagList = {
13781380
["per (%d+) maximum mana, up to a maximum of (%d+)%%"] = function(num, _, limit) return { tag = { type = "PerStat", stat = "Mana", div = num, limit = tonumber(limit), limitTotal = true } } end,
13791381
["per (%d+) accuracy rating"] = function(num) return { tag = { type = "PerStat", stat = "Accuracy", div = num } } end,
13801382
["per (%d+)%% block chance"] = function(num) return { tag = { type = "PerStat", stat = "BlockChance", div = num } } end,
1383+
["per (%d+)%% chance to block"] = function(num) return { tag = { type = "PerStat", stat = "BlockChance", div = num } } end,
13811384
["per (%d+)%% chance to block on equipped shield"] = function(num) return { tag = { type = "PerStat", stat = "ShieldBlockChance", div = num } } end,
13821385
["per (%d+)%% chance to block attack damage"] = function(num) return { tag = { type = "PerStat", stat = "BlockChance", div = num } } end,
13831386
["per (%d+)%% chance to block spell damage"] = function(num) return { tag = { type = "PerStat", stat = "SpellBlockChance", div = num } } end,
@@ -1622,6 +1625,8 @@ local modTagList = {
16221625
["while not cursed"] = { tag = { type = "Condition", var = "Cursed", neg = true } },
16231626
["while there is only one nearby enemy"] = { tagList = { { type = "Multiplier", var = "NearbyEnemies", limit = 1 }, { type = "Condition", var = "OnlyOneNearbyEnemy" } } },
16241627
["while t?h?e?r?e? ?i?s? ?a rare or unique enemy i?s? ?nearby"] = { tag = { type = "ActorCondition", actor = "enemy", varList = { "NearbyRareOrUniqueEnemy", "RareOrUnique" } } },
1628+
["if you have been stunned recently"] = { tag = { type = "Condition", var = "StunnedRecently" } },
1629+
["if you haven't been stunned recently"] = { tag = { type = "Condition", var = "StunnedRecently", neg = true } },
16251630
["if you[' ]h?a?ve hit recently"] = { tag = { type = "Condition", var = "HitRecently" } },
16261631
["if you[' ]h?a?ve hit an enemy recently"] = { tag = { type = "Condition", var = "HitRecently" } },
16271632
["if you[' ]h?a?ve hit with your main hand weapon recently"] = { tag = { type = "Condition", var = "HitRecentlyWithWeapon" } },
@@ -2316,6 +2321,9 @@ local specialModList = {
23162321
["gain %d+ rage on melee weapon hit"] = {
23172322
flag("Condition:CanGainRage"),
23182323
},
2324+
["gain %d+ rage on ([%D]+)"] = {
2325+
flag("Condition:CanGainRage"),
2326+
},
23192327
["gain %d+ rage on hit with axes"] = {
23202328
flag("Condition:CanGainRage"),
23212329
},
@@ -4300,6 +4308,26 @@ local specialModList = {
43004308
flag("CurseImmune", { type = "Condition", var = "UsingFlask" }),
43014309
flag("StunImmune", { type = "Condition", var = "UsingFlask" }),
43024310
},
4311+
["gain (%d+)%% of maximum energy shield as additional (%a+) threshold"] = function(num, _, statType)
4312+
return { mod(firstToUpper(statType) .. "Threshold", "BASE", 1, { type = "PercentStat", stat = "EnergyShield", percent = num }) }
4313+
end,
4314+
["(%d+)%% increased maximum life, mana and energy shield"] = function(num) return {
4315+
mod("Life", "INC", num),
4316+
mod("Mana", "INC", num),
4317+
mod("EnergyShield", "INC", num),
4318+
} end,
4319+
["gain stun threshold equal to the lowest of evasion and armour on your helmet"] = {
4320+
mod("StunThreshold", "BASE", 1, { type = "PerStat", stat = "LowestOfArmourAndEvasionOnHelmet" }),
4321+
},
4322+
["your stun threshold is doubled"] = {
4323+
mod("StunThreshold", "MORE", 100),
4324+
},
4325+
["(%d+)%% of base armour from equipment also added to stun threshold"] = function(num) return {
4326+
mod("StunThreshold", "BASE", 1, { type = "PerStat", stat = "ArmourOnHelmet", percent = num }),
4327+
mod("StunThreshold", "BASE", 1, { type = "PerStat", stat = "ArmourOnGloves", percent = num }),
4328+
mod("StunThreshold", "BASE", 1, { type = "PerStat", stat = "ArmourOnBoots", percent = num }),
4329+
mod("StunThreshold", "BASE", 1, { type = "PerStat", stat = "ArmourOnBody Armour", percent = num }),
4330+
} end,
43034331
-- This mod doesn't work the way it should. It prevents self-chill among other issues.
43044332
--Since we don't currently really do anything with enemy ailment infliction, this should probably be removed
43054333
--["cursed enemies cannot inflict elemental ailments on you"] = {

0 commit comments

Comments
 (0)