Skip to content

Commit 7d860ea

Browse files
authored
Add support for Foulborn Ancestral Vision (#9299)
* add support for suppress applies to chance to defend with 200% armour at 50% value * pr comments, use Max instead of Sum
1 parent 119ba2b commit 7d860ea

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Modules/CalcDefence.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,8 +1013,6 @@ function calcs.defence(env, actor)
10131013
end
10141014
output.EnergyShield = modDB:Override(nil, "EnergyShield") or m_max(round(energyShield), 0)
10151015
output.Armour = m_max(round(armour), 0)
1016-
output.ArmourDefense = (modDB:Max(nil, "ArmourDefense") or 0) / 100
1017-
output.RawArmourDefense = output.ArmourDefense > 0 and ((1 + output.ArmourDefense) * 100) or nil
10181016
output.Evasion = m_max(round(evasion), 0)
10191017
output.MeleeEvasion = m_max(round(evasion * calcLib.mod(modDB, nil, "MeleeEvasion")), 0)
10201018
output.ProjectileEvasion = m_max(round(evasion * calcLib.mod(modDB, nil, "ProjectileEvasion")), 0)
@@ -1500,6 +1498,16 @@ function calcs.defence(env, actor)
15001498
-- Ancestral Vision
15011499
modDB:NewMod("AvoidElementalAilments", "BASE", m_floor(spellSuppressionToAilmentPercent * spellSuppressionChance), "Ancestral Vision")
15021500
end
1501+
if modDB:Flag(nil, "SpellSuppressionAppliesToChanceToDefendWithArmour") then
1502+
local spellSuppressionAppliesToChanceToDefendWithArmourPercent = (modDB:Max(nil, "SpellSuppressionAppliesToChanceToDefendWithArmourPercent") or 0)
1503+
local spellSuppressionAppliesToChanceToDefendWithArmourPercentArmour = (modDB:Max(nil, "SpellSuppressionAppliesToChanceToDefendWithArmourPercentArmour") or 0)
1504+
-- Foulborn Ancestral Vision
1505+
modDB:NewMod("ArmourDefense", "MAX", tonumber(spellSuppressionAppliesToChanceToDefendWithArmourPercentArmour) - 100, "Chance to Defend from Spell Suppression: Max Calc", { type = "Condition", var = "ArmourMax" })
1506+
modDB:NewMod("ArmourDefense", "MAX", math.min((spellSuppressionAppliesToChanceToDefendWithArmourPercent * spellSuppressionChance) / 100, 1.0) * (tonumber(spellSuppressionAppliesToChanceToDefendWithArmourPercentArmour) - 100), "Chance to Defend from Spell Suppression: Average Calc", { type = "Condition", var = "ArmourAvg" })
1507+
modDB:NewMod("ArmourDefense", "MAX", math.min(math.floor((spellSuppressionAppliesToChanceToDefendWithArmourPercent * spellSuppressionChance) / 100), 1.0) * (tonumber(spellSuppressionAppliesToChanceToDefendWithArmourPercentArmour) - 100), modSource or "Chance to Defend from Spell Suppression: Min Calc", { type = "Condition", var = "ArmourMax", neg = true }, { type = "Condition", var = "ArmourAvg", neg = true })
1508+
end
1509+
output.ArmourDefense = (modDB:Max(nil, "ArmourDefense") or 0) / 100
1510+
output.RawArmourDefense = output.ArmourDefense > 0 and ((1 + output.ArmourDefense) * 100) or nil
15031511

15041512
-- This is only used for breakdown purposes
15051513
if modDB:Flag(nil, "ShockAvoidAppliesToElementalAilments") then

src/Modules/ModParser.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,6 +3538,11 @@ local specialModList = {
35383538
mod("SpellSuppressionAppliesToAilmentAvoidancePercent", "BASE", num),
35393539
flag("SpellSuppressionAppliesToAilmentAvoidance")
35403540
} end,
3541+
["modifiers to chance to suppress spell damage also apply to chance to defend with (%d+)%% of armour at (%d+)%% of their value"] = function (armourPercentage, _, effectiveness) return {
3542+
mod("SpellSuppressionAppliesToChanceToDefendWithArmourPercentArmour", "MAX", tonumber(armourPercentage)),
3543+
mod("SpellSuppressionAppliesToChanceToDefendWithArmourPercent", "MAX", tonumber(effectiveness)),
3544+
flag("SpellSuppressionAppliesToChanceToDefendWithArmour"),
3545+
} end,
35413546
["enemies chilled by your hits have damage taken increased by chill effect"] = { flag("ChillEffectIncDamageTaken") },
35423547
["left ring slot: your chilling skitterbot's aura applies socketed h?e?x? ?curse instead"] = { flag("SkitterbotsCannotChill", { type = "SlotNumber", num = 1 }) },
35433548
["right ring slot: your shocking skitterbot's aura applies socketed h?e?x? ?curse instead"] = { flag("SkitterbotsCannotShock", { type = "SlotNumber", num = 2 }) },

0 commit comments

Comments
 (0)