From 00c1693f32f6d42d7a2773bc7d286cf7aa4ec619 Mon Sep 17 00:00:00 2001 From: PJacek Date: Sun, 3 Mar 2019 00:50:19 +0100 Subject: [PATCH] Add support for various mods --- Modules/CalcOffence-3_0.lua | 2 ++ Modules/CalcSections-3_0.lua | 3 +++ Modules/ConfigOptions.lua | 6 ++++++ Modules/ModParser-3_0.lua | 25 ++++++++++++++++++++++++- 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Modules/CalcOffence-3_0.lua b/Modules/CalcOffence-3_0.lua index 9f07df26..f4653294 100644 --- a/Modules/CalcOffence-3_0.lua +++ b/Modules/CalcOffence-3_0.lua @@ -966,6 +966,8 @@ function calcs.offence(env, actor, activeSkill) resist = resist + enemyDB:Sum("BASE", nil, "ElementalResist") pen = skillModList:Sum("BASE", cfg, damageType.."Penetration", "ElementalPenetration") taken = taken + enemyDB:Sum("INC", nil, "ElementalDamageTaken") + elseif damageType == "Chaos" then + pen = skillModList:Sum("BASE", cfg, "ChaosPenetration") end resist = m_min(resist, 75) end diff --git a/Modules/CalcSections-3_0.lua b/Modules/CalcSections-3_0.lua index fa5dad9c..f2a7dfd2 100644 --- a/Modules/CalcSections-3_0.lua +++ b/Modules/CalcSections-3_0.lua @@ -110,6 +110,7 @@ return { }, { format = "x {3:output:ChaosEffMult}", { breakdown = "ChaosEffMult" }, + { label = "Player modifiers", modName = "ChaosPenetration", cfg = "skill" }, { label = "Enemy modifiers", modName = chaosHitTaken, enemy = true, cfg = "skill" }, }, }, @@ -176,6 +177,7 @@ return { }, { format = "x {3:output:MainHand.ChaosEffMult}", { breakdown = "MainHand.ChaosEffMult" }, + { label = "Player modifiers", modName = "ChaosPenetration", cfg = "weapon1" }, { label = "Enemy modifiers", modName = chaosHitTaken, enemy = true, cfg = "weapon1" }, }, }, @@ -242,6 +244,7 @@ return { }, { format = "x {3:output:OffHand.ChaosEffMult}", { breakdown = "OffHand.ChaosEffMult" }, + { label = "Player modifiers", modName = "ChaosPenetration", cfg = "weapon2" }, { label = "Enemy modifiers", modName = chaosHitTaken, enemy = true, cfg = "weapon2" }, }, }, diff --git a/Modules/ConfigOptions.lua b/Modules/ConfigOptions.lua index 08aff533..dd1958d2 100644 --- a/Modules/ConfigOptions.lua +++ b/Modules/ConfigOptions.lua @@ -229,6 +229,9 @@ return { enemyModList:NewMod("SelfCritMultiplier", "INC", -val, "Config") end end }, + { var = "multiplierSextant", type = "count", label = "# of Sextants affecting the area", ifMult = "Sextant", apply = function(val, modList, enemyModList) + modList:NewMod("Multiplier:Sextant", "BASE", m_min(val, 5), "Config") + end }, { label = "Player is cursed by:" }, { var = "playerCursedWithAssassinsMark", type = "count", label = "Assassin's Mark:", tooltip = "Sets the level of Assassin's Mark to apply to the player.", apply = function(val, modList, enemyModList) modList:NewMod("ExtraCurse", "LIST", { skillId = "AssassinsMark", level = val, applyToPlayer = true }) @@ -536,6 +539,9 @@ return { modList:NewMod("Condition:UsedVaalSkillRecently", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) modList:NewMod("Condition:UsedSkillRecently", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) end }, + { var = "conditionSoulGainPrevention", type = "check", label = "Do you have Soul Gain Prevention?", ifCond = "SoulGainPrevention", apply = function(val, modList, enemyModList) + modList:NewMod("Condition:SoulGainPrevention", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) + end }, { var = "conditionUsedWarcryRecently", type = "check", label = "Have you used a Warcry Recently?", ifCond = "UsedWarcryRecently", implyCond = "UsedSkillRecently", tooltip = "This also implies that you have used a Skill Recently.", apply = function(val, modList, enemyModList) modList:NewMod("Condition:UsedWarcryRecently", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) modList:NewMod("Condition:UsedSkillRecently", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) diff --git a/Modules/ModParser-3_0.lua b/Modules/ModParser-3_0.lua index 9b24bd34..18318d65 100644 --- a/Modules/ModParser-3_0.lua +++ b/Modules/ModParser-3_0.lua @@ -389,6 +389,7 @@ local modNameList = { ["duration of elemental ailments"] = { "EnemyShockDuration", "EnemyFreezeDuration", "EnemyChillDuration", "EnemyIgniteDuration" }, ["duration of elemental status ailments"] = { "EnemyShockDuration", "EnemyFreezeDuration", "EnemyChillDuration", "EnemyIgniteDuration" }, ["duration of ailments"] = { "EnemyShockDuration", "EnemyFreezeDuration", "EnemyChillDuration", "EnemyIgniteDuration", "EnemyPoisonDuration", "EnemyBleedDuration" }, + ["duration of ailments you inflict"] = { "EnemyShockDuration", "EnemyFreezeDuration", "EnemyChillDuration", "EnemyIgniteDuration", "EnemyPoisonDuration", "EnemyBleedDuration" }, -- Other ailments ["to poison"] = "PoisonChance", ["to cause poison"] = "PoisonChance", @@ -633,8 +634,11 @@ local modTagList = { ["per shaper item equipped"] = { tag = { type = "Multiplier", var = "ShaperItem" } }, ["per elder or shaper item equipped"] = { tag = { type = "Multiplier", varList = { "ElderItem", "ShaperItem" } } }, ["for each equipped corrupted item"] = { tag = { type = "Multiplier", var = "CorruptedItem" } }, + ["for each corrupted item equipped"] = { tag = { type = "Multiplier", var = "CorruptedItem" } }, + ["for each uncorrupted item equipped"] = { tag = { type = "Multiplier", var = "NonCorruptedItem" } }, ["per abyssa?l? jewel affecting you"] = { tag = { type = "Multiplier", var = "AbyssJewel" } }, ["for each type of abyssa?l? jewel affecting you"] = { tag = { type = "Multiplier", var = "AbyssJewelType" } }, + ["per sextant affecting the area"] = { tag = { type = "Multiplier", var = "Sextant" } }, ["per buff on you"] = { tag = { type = "Multiplier", var = "BuffOnSelf" } }, ["per curse on enemy"] = { tag = { type = "Multiplier", var = "CurseOnEnemy" } }, ["per curse on you"] = { tag = { type = "Multiplier", var = "CurseOnSelf" } }, @@ -775,6 +779,7 @@ local modTagList = { ["while cursed"] = { tag = { type = "Condition", var = "Cursed" } }, ["while not cursed"] = { tag = { type = "Condition", var = "Cursed", neg = true } }, ["while there is only one nearby enemy"] = { tag = { type = "Condition", var = "OnlyOneNearbyEnemy" } }, + ["while t?h?e?r?e? ?i?s? ?a rare or unique enemy i?s? ?nearby"] = { tag = { type = "Condition", var = "EnemyRareOrUnique" } }, ["if you[' ]h?a?ve hit recently"] = { tag = { type = "Condition", var = "HitRecently" } }, ["if you[' ]h?a?ve crit recently"] = { tag = { type = "Condition", var = "CritRecently" } }, ["if you[' ]h?a?ve dealt a critical strike recently"] = { tag = { type = "Condition", var = "CritRecently" } }, @@ -826,6 +831,7 @@ local modTagList = { ["if you[' ]h?a?ve used a minion skill recently"] = { tag = { type = "Condition", var = "UsedMinionSkillRecently" } }, ["if you[' ]h?a?ve used a movement skill recently"] = { tag = { type = "Condition", var = "UsedMovementSkillRecently" } }, ["if you[' ]h?a?ve used a vaal skill recently"] = { tag = { type = "Condition", var = "UsedVaalSkillRecently" } }, + ["during soul gain prevention"] = { tag = { type = "Condition", var = "SoulGainPrevention" } }, ["if you detonated mines recently"] = { tag = { type = "Condition", var = "DetonatedMinesRecently" } }, ["if energy shield recharge has started recently"] = { tag = { type = "Condition", var = "EnergyShieldRechargeRecently" } }, ["when cast on frostbolt"] = { tag = { type = "Condition", var = "CastOnFrostbolt" } }, @@ -1077,6 +1083,7 @@ local specialModList = { ["hits can't be evaded"] = { flag("CannotBeEvaded", { type = "Condition", var = "{Hand}Attack" }) }, ["causes bleeding on hit"] = { mod("BleedChance", "BASE", 100, { type = "Condition", var = "{Hand}Attack" }) }, ["poisonous hit"] = { mod("PoisonChance", "BASE", 100, { type = "Condition", var = "{Hand}Attack" }) }, + ["attacks with this weapon deal double damage"] = { mod("Damage", "MORE", 100, nil, ModFlag.Hit, { type = "Condition", var = "{Hand}Attack" }) }, ["attacks with this weapon deal double damage to chilled enemies"] = { mod("Damage", "MORE", 100, nil, ModFlag.Hit, { type = "Condition", var = "{Hand}Attack" }, { type = "ActorCondition", actor = "enemy", var = "Chilled" }) }, ["life leech from hits with this weapon applies instantly"] = { flag("InstantLifeLeech", { type = "Condition", var = "{Hand}Attack" }) }, ["gain life from leech instantly from hits with this weapon"] = { flag("InstantLifeLeech", { type = "Condition", var = "{Hand}Attack" }) }, @@ -1114,7 +1121,7 @@ local specialModList = { ["trigger level (%d+) (.+) when you consume a corpse"] = function(num, _, skill) return extraSkill(skill, num) end, ["%d+%% chance to attack with level (%d+) (.+) on melee hit"] = function(num, _, skill) return extraSkill(skill, num) end, ["%d+%% chance to trigger level (%d+) (.+) on melee hit"] = function(num, _, skill) return extraSkill(skill, num) end, - ["%d+%% chance to trigger level (%d+) (.+) on kill"] = function(num, _, skill) return extraSkill(skill, num) end, + ["%d+%% chance to trigger level (%d+) (.+) [ow][nh]e?n? ?y?o?u? kill ?a?n? ?e?n?e?m?y?"] = function(num, _, skill) return extraSkill(skill, num) end, ["%d+%% chance to trigger level (%d+) (.+) when you use a socketed skill"] = function(num, _, skill) return extraSkill(skill, num) end, ["%d+%% chance to trigger level (%d+) (.+) when you gain avian's might or avian's flight"] = function(num, _, skill) return extraSkill(skill, num) end, ["%d+%% chance to [ct][ar][si][tg]g?e?r? level (%d+) (.+) on %a+"] = function(num, _, skill) return extraSkill(skill, num) end, @@ -1132,6 +1139,14 @@ local specialModList = { ["trigger (.+) on critical strike"] = function( _, skill) return extraSkill(skill, 1, true) end, ["triggers? (.+) when you take a critical strike"] = function( _, skill) return extraSkill(skill, 1, true) end, ["socketed [%a+]* ?gems a?r?e? ?supported by level (%d+) (.+)"] = function(num, _, support) return { mod("ExtraSupport", "LIST", { skillId = gemIdLookup[support] or gemIdLookup[support:gsub("^increased ","")] or "Unknown", level = num }, { type = "SocketedIn", slotName = "{SlotName}" }) } end, + ["trigger level (%d+) (.+) every (%d+) seconds"] = function(num, _, skill) return extraSkill(skill, num) end, + ["trigger level (%d+) (.+), (.+) or (.+) every (%d+) seconds"] = function(num, _, skill1, skill2, skill3) return { + mod("ExtraSkill", "LIST", { skillId = gemIdLookup[skill1], level = num }), + mod("ExtraSkill", "LIST", { skillId = gemIdLookup[skill2], level = num }), + mod("ExtraSkill", "LIST", { skillId = gemIdLookup[skill3], level = num }) + } end, + ["offering skills triggered this way also affect you"] = { mod("ExtraSkillMod", "LIST", { mod = mod("SkillData", "LIST", { key = "buffNotPlayer", value = false }) }, { type = "SkillName", skillNameList = { "Bone Offering", "Flesh Offering", "Spirit Offering" } }, { type = "SocketedIn", slotName = "{SlotName}" }) }, + ["trigger level (%d+) (.+) after spending a total of (%d+) mana"] = function(num, _, skill) return extraSkill(skill, num) end, -- Conversion ["increases and reductions to minion damage also affects? you"] = { flag("MinionDamageAppliesToPlayer") }, ["increases and reductions to minion attack speed also affects? you"] = { flag("MinionAttackSpeedAppliesToPlayer") }, @@ -1156,6 +1171,7 @@ local specialModList = { } end, -- Crit ["your critical strike chance is lucky"] = { flag("CritChanceLucky") }, + ["your critical strike chance is lucky while focussed"] = { flag("CritChanceLucky", { type = "Condition", var = "Focused"}) }, ["your critical strikes do not deal extra damage"] = { flag("NoCritMultiplier") }, ["critical strikes deal no damage"] = { mod("Damage", "MORE", -100, { type = "Condition", var = "CriticalStrike" }) }, ["critical strike chance is increased by uncapped lightning resistance"] = { mod("CritChance", "INC", 1, { type = "PerStat", stat = "LightningResistTotal", div = 1 }) }, @@ -1188,6 +1204,10 @@ local specialModList = { ["ignited enemies burn (%d+)%% faster"] = function(num) return { mod("IgniteBurnFaster", "INC", num) } end, ["ignited enemies burn (%d+)%% slower"] = function(num) return { mod("IgniteBurnSlower", "INC", num) } end, ["enemies ignited by an attack burn (%d+)%% faster"] = function(num) return { mod("IgniteBurnFaster", "INC", num, nil, ModFlag.Attack) } end, + ["enemies ignited by you during flask effect take (%d+)%% increased damage"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("DamageTaken", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "Ignited" }) } end, + ["cannot inflict ignite"] = { flag("CannotIgnite") }, + ["cannot inflict freeze or chill"] = { flag("CannotFreeze"), flag("CannotChill") }, + ["cannot inflict shock"] = { flag("CannotShock") }, -- Bleed ["melee attacks cause bleeding"] = { mod("BleedChance", "BASE", 100, nil, ModFlag.Melee) }, ["attacks cause bleeding when hitting cursed enemies"] = { mod("BleedChance", "BASE", 100, nil, ModFlag.Attack, { type = "ActorCondition", actor = "enemy", var = "Cursed" }) }, @@ -1241,6 +1261,8 @@ local specialModList = { ["you are cursed with level (%d+) (%D+)"] = function(num, _, name) return { mod("ExtraCurse", "LIST", { skillId = gemIdLookup[name], level = num, applyToPlayer = true }) } end, ["you count as on low life while you are cursed with vulnerability"] = { flag("Condition:LowLife", { type = "Condition", var = "AffectedByVulnerability" }) }, ["if you consumed a corpse recently, you and nearby allies regenerate (%d+)%% of life per second"] = function (num) return { mod("ExtraAura", "LIST", { mod = mod("LifeRegenPercent", "BASE", num) }, { type = "Condition", var = "ConsumedCorpseRecently" }) } end, + ["if you have blocked recently, you and nearby allies regenerate (%d+)%% of life per second"] = function (num) return { mod("ExtraAura", "LIST", { mod = mod("LifeRegenPercent", "BASE", num) }, { type = "Condition", var = "BlockedRecently" }) } end, + ["(%d+)%% of evasion rating is regenerated as life per second while focussed"] = function(num) return { mod("LifeRegen", "BASE", num / 100, { type = "PerStat", stat = "Evasion"}, { type = "Condition", var = "Focused" }) } end, -- Traps, Mines and Totems ["traps and mines deal (%d+)%-(%d+) additional physical damage"] = function(_, min, max) return { mod("PhysicalMin", "BASE", tonumber(min), nil, 0, bor(KeywordFlag.Trap, KeywordFlag.Mine)), mod("PhysicalMax", "BASE", tonumber(max), nil, 0, bor(KeywordFlag.Trap, KeywordFlag.Mine)) } end, ["traps and mines deal (%d+) to (%d+) additional physical damage"] = function(_, min, max) return { mod("PhysicalMin", "BASE", tonumber(min), nil, 0, bor(KeywordFlag.Trap, KeywordFlag.Mine)), mod("PhysicalMax", "BASE", tonumber(max), nil, 0, bor(KeywordFlag.Trap, KeywordFlag.Mine)) } end, @@ -1568,6 +1590,7 @@ local penTypes = { ["fire resistance"] = "FirePenetration", ["elemental resistance"] = "ElementalPenetration", ["elemental resistances"] = "ElementalPenetration", + ["chaos resistance"] = "ChaosPenetration", } local regenTypes = { ["life"] = "LifeRegen",