Skip to content

Commit 5132a59

Browse files
PeecheyLocalIdentity
andauthored
Add support for Foulborn Nightmare Jewels (#9258)
* add support for foulborn breach jewels * totem res update for nightmare jewels and capture group refactor * modcache * refactor chaosConvert to capture groups --------- Co-authored-by: LocalIdentity <[email protected]>
1 parent 1f27833 commit 5132a59

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

src/Modules/CalcOffence.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,6 +3137,8 @@ function calcs.offence(env, actor, activeSkill)
31373137
or (pass == 1 and skillModList:Flag(skillCfg, "CritLucky"))
31383138
or (damageType == "Lightning" and modDB:Flag(nil, "LightningLuckHits"))
31393139
or (damageType == "Chaos" and modDB:Flag(nil, "ChaosLuckyHits"))
3140+
or (damageType == "Fire" and modDB:Flag(nil, "FireLuckyHits"))
3141+
or (damageType == "Cold" and modDB:Flag(nil, "ColdLuckyHits"))
31403142
or ((damageType == "Lightning" or damageType == "Cold" or damageType == "Fire") and skillModList:Flag(skillCfg, "ElementalLuckHits")) then
31413143
damageTypeLuckyChance = 1
31423144
else

src/Modules/ModParser.lua

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ local function firstToUpper(str)
1515
end
1616

1717
-- Radius jewels that modify other nodes
18-
local function getSimpleConv(srcList, dst, type, remove, factor)
18+
local function getSimpleConv(srcList, dst, type, remove, factor, srcType) -- srcType for conversions where src and dst types do not match, e.g. increased life on base resistances
1919
return function(node, out, data)
2020
local attributes = {["Dex"] = true, ["Int"] = true, ["Str"] = true}
2121
if node then
2222
for _, src in pairs(srcList) do
2323
for _, mod in ipairs(node.modList) do
2424
-- do not convert stats from tattoos
25-
if mod.name == src and mod.type == type and not (node.isTattoo and attributes[src]) then
25+
if mod.name == src and (srcType and mod.type == srcType or mod.type == type) and not (node.isTattoo and attributes[src]) then
2626
if remove then
2727
out:MergeNewMod(src, type, -mod.value, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
2828
end
@@ -3708,6 +3708,9 @@ local specialModList = {
37083708
["your damage with hits is lucky"] = { flag("LuckyHits") },
37093709
["damage with hits is unlucky"] = { flag("UnluckyHits") },
37103710
["chaos damage with hits is lucky"] = { flag("ChaosLuckyHits") },
3711+
["lightning damage with hits is lucky if you[' ]h?a?ve blocked spell damage recently"] = { flag("LightningLuckHits", { type = "Condition", var = "BlockedSpellRecently" }) },
3712+
["cold damage with hits is lucky if you[' ]h?a?ve suppressed spell damage recently"] = { flag("ColdLuckyHits", { type = "Condition", var = "SuppressedRecently" }) },
3713+
["fire damage with hits is lucky if you[' ]h?a?ve blocked an attack recently"] = { flag("FireLuckyHits", { type = "Condition", var = "BlockedAttackRecently" }) },
37113714
["elemental damage with hits is lucky while you are shocked"] = { flag("ElementalLuckHits", { type = "Condition", var = "Shocked" }) },
37123715
["your lucky or unlucky effects are instead unexciting"] = { flag("Unexciting") },
37133716
["allies' aura buffs do not affect you"] = { flag("AlliesAurasCannotAffectSelf") },
@@ -5426,7 +5429,7 @@ local specialModList = {
54265429
return { mod("EnergyShield", "OVERRIDE", 1, { type = "PercentStat", stat = "Life", percent = num }) }
54275430
end,
54285431
["immun[ei]t?y? to elemental ailments while bleeding"] = { flag("ElementalAilmentImmune", { type = "Condition", var = "Bleeding" }) },
5429-
["mana is increased by (%d+)%% of overcapped lightning resistance"] = function(num) return { mod("Mana", "INC", num/100, { type = "PerStat", stat = "LightningResistOverCap" }) } end,
5432+
["mana is increased by (%d+)%% of overcapped lightning resistance"] = function(num) return { mod("Mana", "INC", num / 100, { type = "PerStat", stat = "LightningResistOverCap" }) } end,
54305433
}
54315434
for _, name in pairs(data.keystones) do
54325435
specialModList[name:lower()] = { mod("Keystone", "LIST", name) }
@@ -5642,26 +5645,38 @@ local jewelOtherFuncs = {
56425645
["Increases and Reductions to Physical Damage in Radius are Transformed to apply to Cold Damage"] = getSimpleConv({ "PhysicalDamage" }, "ColdDamage", "INC", true),
56435646
["Increases and Reductions to Cold Damage in Radius are Transformed to apply to Physical Damage"] = getSimpleConv({ "ColdDamage" }, "PhysicalDamage", "INC", true),
56445647
["Increases and Reductions to other Damage Types in Radius are Transformed to apply to Fire Damage"] = getSimpleConv({ "PhysicalDamage","ColdDamage","LightningDamage","ChaosDamage","ElementalDamage" }, "FireDamage", "INC", true),
5645-
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant Chance to Block Spells at (%d+)%% of its value"] = function(num)
5646-
return getSimpleConv({ "LightningResist","ElementalResist" }, "SpellBlockChance", "BASE", false, num / 100)
5648+
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant Chance to Block Spells? ?D?a?m?a?g?e? at (%d+)%% of its value"] = function(num)
5649+
return getSimpleConv({ "LightningResist", "ElementalResist" }, "SpellBlockChance", "BASE", false, num / 100)
56475650
end,
5648-
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant Chance to Block Spell Damage at (%d+)%% of its value"] = function(num)
5649-
return getSimpleConv({ "LightningResist","ElementalResist" }, "SpellBlockChance", "BASE", false, num / 100)
5651+
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant increased Maximum Energy Shield at (%d+)%% of its value"] = function(num)
5652+
return getSimpleConv({ "LightningResist", "ElementalResist" }, "EnergyShield", "INC", false, num / 100, "BASE")
56505653
end,
5651-
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Dodge Attacks at (%d+)%% of its value"] = function(num)
5652-
return getSimpleConv({ "ColdResist","ElementalResist" }, "AttackDodgeChance", "BASE", false, num / 100)
5654+
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant Lightning Damage converted to Chaos Damage at (%d+)%% of its value"] = function(num)
5655+
return getSimpleConv({ "LightningResist", "ElementalResist" }, "LightningDamageConvertToChaos", "BASE", false, num / 100)
56535656
end,
5654-
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Dodge Attack Hits at (%d+)%% of its value"] = function(num)
5655-
return getSimpleConv({ "ColdResist","ElementalResist" }, "AttackDodgeChance", "BASE", false, num / 100)
5657+
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Dodge Attacks? ?H?i?t?s? at (%d+)%% of its value"] = function(num)
5658+
return getSimpleConv({ "ColdResist", "ElementalResist" }, "AttackDodgeChance", "BASE", false, num / 100)
56565659
end,
56575660
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Suppress Spell Damage at (%d+)%% of its value"] = function(num)
5658-
return getSimpleConv({ "ColdResist","ElementalResist" }, "SpellSuppressionChance", "BASE", false, num / 100)
5661+
return getSimpleConv({ "ColdResist", "ElementalResist" }, "SpellSuppressionChance", "BASE", false, num / 100)
5662+
end,
5663+
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant increased Maximum Mana at (%d+)%% of its value"] = function(num)
5664+
return getSimpleConv({ "ColdResist", "ElementalResist" }, "Mana", "INC", false, num / 100, "BASE")
5665+
end,
5666+
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Cold Damage converted to Chaos Damage at (%d+)%% of its value"] = function(num)
5667+
return getSimpleConv({ "ColdResist", "ElementalResist" }, "ColdDamageConvertToChaos", "BASE", false, num / 100)
56595668
end,
56605669
["Passives granting Fire Resistance or all Elemental Resistances in Radius also grant Chance to Block Attack Damage at (%d+)%% of its value"] = function(num)
5661-
return getSimpleConv({ "FireResist","ElementalResist" }, "BlockChance", "BASE", false, num / 100)
5670+
return getSimpleConv({ "FireResist", "ElementalResist" }, "BlockChance", "BASE", false, num / 100)
56625671
end,
56635672
["Passives granting Fire Resistance or all Elemental Resistances in Radius also grant Chance to Block at (%d+)%% of its value"] = function(num)
5664-
return getSimpleConv({ "FireResist","ElementalResist" }, "BlockChance", "BASE", false, num / 100)
5673+
return getSimpleConv({ "FireResist", "ElementalResist" }, "BlockChance", "BASE", false, num / 100)
5674+
end,
5675+
["Passives granting Fire Resistance or all Elemental Resistances in Radius also grant increased Maximum Life at (%d+)%% of its value"] = function(num)
5676+
return getSimpleConv({ "FireResist", "ElementalResist" }, "Life", "INC", false, num / 100, "BASE")
5677+
end,
5678+
["Passives granting Fire Resistance or all Elemental Resistances in Radius also grant Fire Damage converted to Chaos Damage at (%d+)%% of its value"] = function(num)
5679+
return getSimpleConv({ "FireResist", "ElementalResist" }, "FireDamageConvertToChaos", "BASE", false, num / 100)
56655680
end,
56665681
["Melee and Melee Weapon Type modifiers in Radius are Transformed to Bow Modifiers"] = function(node, out, data)
56675682
if node then

0 commit comments

Comments
 (0)