Skip to content

Commit b7933fc

Browse files
PeecheyLocalIdentity
andauthored
Refactor JewelOtherFuncs into capture groups (#9260)
* refactor capture groups for JewelOtherFuncs in ModParser * Formatting --------- Co-authored-by: LocalIdentity <[email protected]>
1 parent 18f39b9 commit b7933fc

File tree

1 file changed

+56
-32
lines changed

1 file changed

+56
-32
lines changed

src/Modules/ModParser.lua

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5633,22 +5633,36 @@ local jewelOtherFuncs = {
56335633
["Dexterity from Passives in Radius is Transformed to Intelligence"] = getSimpleConv({ "Dex" }, "Int", "BASE", true),
56345634
["Intelligence from Passives in Radius is Transformed to Dexterity"] = getSimpleConv({ "Int" }, "Dex", "BASE", true),
56355635
["Increases and Reductions to Life in Radius are Transformed to apply to Energy Shield"] = getSimpleConv({ "Life" }, "EnergyShield", "INC", true),
5636-
["Increases and Reductions to Energy Shield in Radius are Transformed to apply to Armour at 200% of their value"] = getSimpleConv({ "EnergyShield" }, "Armour", "INC", true, 2),
5637-
["Increases and Reductions to Life in Radius are Transformed to apply to Mana at 200% of their value"] = getSimpleConv({ "Life" }, "Mana", "INC", true, 2),
5636+
["Increases and Reductions to Energy Shield in Radius are Transformed to apply to Armour at (%d+)%% of their value"] = function(num)
5637+
return getSimpleConv({ "EnergyShield" }, "Armour", "INC", true, num / 100)
5638+
end,
5639+
["Increases and Reductions to Life in Radius are Transformed to apply to Mana at (%d+)%% of their value"] = function(num)
5640+
return getSimpleConv({ "Life" }, "Mana", "INC", true, num / 100)
5641+
end,
56385642
["Increases and Reductions to Physical Damage in Radius are Transformed to apply to Cold Damage"] = getSimpleConv({ "PhysicalDamage" }, "ColdDamage", "INC", true),
56395643
["Increases and Reductions to Cold Damage in Radius are Transformed to apply to Physical Damage"] = getSimpleConv({ "ColdDamage" }, "PhysicalDamage", "INC", true),
56405644
["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),
5641-
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant Chance to Block Spells at 35% of its value"] = getSimpleConv({ "LightningResist","ElementalResist" }, "SpellBlockChance", "BASE", false, 0.35),
5642-
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant Chance to Block Spell Damage at 35% of its value"] = getSimpleConv({ "LightningResist","ElementalResist" }, "SpellBlockChance", "BASE", false, 0.35),
5643-
["Passives granting Lightning Resistance or all Elemental Resistances in Radius also grant Chance to Block Spell Damage at 50% of its value"] = getSimpleConv({ "LightningResist","ElementalResist" }, "SpellBlockChance", "BASE", false, 0.5),
5644-
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Dodge Attacks at 35% of its value"] = getSimpleConv({ "ColdResist","ElementalResist" }, "AttackDodgeChance", "BASE", false, 0.35),
5645-
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Dodge Attack Hits at 35% of its value"] = getSimpleConv({ "ColdResist","ElementalResist" }, "AttackDodgeChance", "BASE", false, 0.35),
5646-
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Suppress Spell Damage at 35% of its value"] = getSimpleConv({ "ColdResist","ElementalResist" }, "SpellSuppressionChance", "BASE", false, 0.35),
5647-
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Suppress Spell Damage at 50% of its value"] = getSimpleConv({ "ColdResist","ElementalResist" }, "SpellSuppressionChance", "BASE", false, 0.5),
5648-
["Passives granting Cold Resistance or all Elemental Resistances in Radius also grant Chance to Suppress Spell Damage at 70% of its value"] = getSimpleConv({ "ColdResist","ElementalResist" }, "SpellSuppressionChance", "BASE", false, 0.7),
5649-
["Passives granting Fire Resistance or all Elemental Resistances in Radius also grant Chance to Block Attack Damage at 35% of its value"] = getSimpleConv({ "FireResist","ElementalResist" }, "BlockChance", "BASE", false, 0.35),
5650-
["Passives granting Fire Resistance or all Elemental Resistances in Radius also grant Chance to Block Attack Damage at 50% of its value"] = getSimpleConv({ "FireResist","ElementalResist" }, "BlockChance", "BASE", false, 0.5),
5651-
["Passives granting Fire Resistance or all Elemental Resistances in Radius also grant Chance to Block at 35% of its value"] = getSimpleConv({ "FireResist","ElementalResist" }, "BlockChance", "BASE", false, 0.35),
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)
5647+
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)
5650+
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)
5653+
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)
5656+
end,
5657+
["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)
5659+
end,
5660+
["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)
5662+
end,
5663+
["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)
5665+
end,
56525666
["Melee and Melee Weapon Type modifiers in Radius are Transformed to Bow Modifiers"] = function(node, out, data)
56535667
if node then
56545668
local mask1 = bor(ModFlag.Axe, ModFlag.Claw, ModFlag.Dagger, ModFlag.Mace, ModFlag.Staff, ModFlag.Sword, ModFlag.Melee)
@@ -5678,19 +5692,23 @@ local jewelOtherFuncs = {
56785692
end
56795693
end
56805694
end,
5681-
["50% increased Effect of non-Keystone Passive Skills in Radius"] = function(node, out, data)
5682-
if node and node.type ~= "Keystone" and node.type ~= "ClassStart" then
5683-
out:NewMod("PassiveSkillEffect", "INC", 50, data.modSource)
5695+
["(%d+)%% increased Effect of non%-Keystone Passive Skills in Radius"] = function(num)
5696+
return function(node, out, data)
5697+
if node and node.type ~= "Keystone" and node.type ~= "ClassStart" then
5698+
out:NewMod("PassiveSkillEffect", "INC", num, data.modSource)
5699+
end
56845700
end
56855701
end,
56865702
["Notable Passive Skills in Radius grant nothing"] = function(node, out, data)
56875703
if node and node.type == "Notable" then
56885704
out:NewMod("PassiveSkillHasNoEffect", "FLAG", true, data.modSource)
56895705
end
56905706
end,
5691-
["100% increased effect of Tattoos in Radius"] = function(node, out, data)
5692-
if node and node.isTattoo then
5693-
out:NewMod("PassiveSkillEffect", "INC", 100, data.modSource)
5707+
["(%d+)%% increased effect of Tattoos in Radius"] = function(num)
5708+
return function(node, out, data)
5709+
if node and node.isTattoo then
5710+
out:NewMod("PassiveSkillEffect", "INC", num, data.modSource)
5711+
end
56945712
end
56955713
end,
56965714
["Allocated Small Passive Skills in Radius grant nothing"] = function(node, out, data)
@@ -5779,23 +5797,29 @@ local jewelOtherFuncs = {
57795797
end
57805798
end
57815799
end,
5782-
["Notable Passive Skills in Radius are Transformed to instead grant: 10% increased Mana Cost of Skills and 20% increased Spell Damage"] = function(node, out, data)
5783-
if node and node.type == "Notable" then
5784-
out:NewMod("PassiveSkillHasOtherEffect", "FLAG", true, data.modSource)
5785-
out:NewMod("NodeModifier", "LIST", { mod = mod("ManaCost", "INC", 10, data.modSource) }, data.modSource)
5786-
out:NewMod("NodeModifier", "LIST", { mod = mod("Damage", "INC", 20, data.modSource, ModFlag.Spell) }, data.modSource)
5800+
["Notable Passive Skills in Radius are Transformed to instead grant: (%d+)%% increased Mana Cost of Skills and (%d+)%% increased Spell Damage"] = function(num1, num2)
5801+
return function(node, out, data)
5802+
if node and node.type == "Notable" then
5803+
out:NewMod("PassiveSkillHasOtherEffect", "FLAG", true, data.modSource)
5804+
out:NewMod("NodeModifier", "LIST", { mod = mod("ManaCost", "INC", tonumber(num1), data.modSource) }, data.modSource)
5805+
out:NewMod("NodeModifier", "LIST", { mod = mod("Damage", "INC", tonumber(num2), data.modSource, ModFlag.Spell) }, data.modSource)
5806+
end
57875807
end
57885808
end,
5789-
["Notable Passive Skills in Radius are Transformed to instead grant: Minions take 20% increased Damage"] = function(node, out, data)
5790-
if node and node.type == "Notable" then
5791-
out:NewMod("PassiveSkillHasOtherEffect", "FLAG", true, data.modSource)
5792-
out:NewMod("NodeModifier", "LIST", { mod = mod("MinionModifier", "LIST", { mod = mod("DamageTaken", "INC", 20, data.modSource) }) }, data.modSource)
5809+
["Notable Passive Skills in Radius are Transformed to instead grant: Minions take (%d+)%% increased Damage"] = function(num)
5810+
return function(node, out, data)
5811+
if node and node.type == "Notable" then
5812+
out:NewMod("PassiveSkillHasOtherEffect", "FLAG", true, data.modSource)
5813+
out:NewMod("NodeModifier", "LIST", { mod = mod("MinionModifier", "LIST", { mod = mod("DamageTaken", "INC", tonumber(num), data.modSource) }) }, data.modSource)
5814+
end
57935815
end
57945816
end,
5795-
["Notable Passive Skills in Radius are Transformed to instead grant: Minions have 25% reduced Movement Speed"] = function(node, out, data)
5796-
if node and node.type == "Notable" then
5797-
out:NewMod("PassiveSkillHasOtherEffect", "FLAG", true, data.modSource)
5798-
out:NewMod("NodeModifier", "LIST", { mod = mod("MinionModifier", "LIST", { mod = mod("MovementSpeed", "INC", -25, data.modSource) }) }, data.modSource)
5817+
["Notable Passive Skills in Radius are Transformed to instead grant: Minions have (%d+)%% reduced Movement Speed"] = function(num)
5818+
return function(node, out, data)
5819+
if node and node.type == "Notable" then
5820+
out:NewMod("PassiveSkillHasOtherEffect", "FLAG", true, data.modSource)
5821+
out:NewMod("NodeModifier", "LIST", { mod = mod("MinionModifier", "LIST", { mod = mod("MovementSpeed", "INC", -num, data.modSource) }) }, data.modSource)
5822+
end
57995823
end
58005824
end,
58015825
}

0 commit comments

Comments
 (0)