Skip to content

Commit

Permalink
Add support for enemy regen and sanctum x can y. (PathOfBuildingCommu…
Browse files Browse the repository at this point in the history
…nity#5565)

* x can y mods not currently supported

* start implementation of enemy regen

* Add full enemy regen support

* Fix Breaking Minions again :)
  • Loading branch information
QuickStick123 authored and Dullson committed Dec 6, 2023
1 parent 67bbcec commit 4cafa10
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 11 deletions.
8 changes: 7 additions & 1 deletion src/Data/Skills/act_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4599,11 +4599,17 @@ skills["FrostBomb"] = {
end,
statMap = {
["base_cold_damage_resistance_%"] = {
mod("ColdExposure", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff" }),
mod("ColdExposure", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Frost Bomb" }),
},
["frost_bomb_damage_+%_final_per_100ms_duration"] = {
skill("frostBombDamagePer100ms", nil),
},
["life_regeneration_rate_+%"] = {
mod("LifeRegen", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Frost Bomb" }),
},
["energy_shield_regeneration_rate_+%"] = {
mod("EnergyShieldRegen", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Frost Bomb" }),
},
},
baseFlags = {
spell = true,
Expand Down
8 changes: 7 additions & 1 deletion src/Export/Skills/act_int.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1042,11 +1042,17 @@ local skills, mod, flag, skill = ...
end,
statMap = {
["base_cold_damage_resistance_%"] = {
mod("ColdExposure", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff" }),
mod("ColdExposure", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Frost Bomb" }),
},
["frost_bomb_damage_+%_final_per_100ms_duration"] = {
skill("frostBombDamagePer100ms", nil),
},
["life_regeneration_rate_+%"] = {
mod("LifeRegen", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Frost Bomb" }),
},
["energy_shield_regeneration_rate_+%"] = {
mod("EnergyShieldRegen", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Frost Bomb" }),
},
},
#baseMod skill("debuffSecondary", true)
#baseMod skill("radius", 24)
Expand Down
5 changes: 5 additions & 0 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2739,6 +2739,11 @@ function calcs.offence(env, actor, activeSkill)
output.ManaOnKill = not skillModList:Flag(cfg, "CannotGainMana") and (m_floor(skillModList:Sum("BASE", cfg, "ManaOnKill"))) or 0
end

-- Enemy Regeneration Rate
output.EnemyLifeRegen = enemyDB:Sum("INC", cfg, "LifeRegen")
output.EnemyManaRegen = enemyDB:Sum("INC", cfg, "ManaRegen")
output.EnemyEnergyShieldRegen = enemyDB:Sum("INC", cfg, "EnergyShieldRegen")

-- Calculate average damage and final DPS
output.AverageHit = totalHitAvg * (1 - output.CritChance / 100) + totalCritAvg * output.CritChance / 100
output.AverageDamage = output.AverageHit * output.HitChance / 100
Expand Down
7 changes: 3 additions & 4 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1269,13 +1269,12 @@ return {
{ modName = "EnemyKnockbackDistance", cfg = "weapon2" },
}, },
{ label = "Maximum Rage", haveOutput = "MaximumRage", { format = "{0:output:MaximumRage}", { modName = "MaximumRage" }, }, },
{ label = "Rage Regen", haveOutput = "RageRegen", { format = "{2:output:RageRegen}",
{ breakdown = "RageRegen" },
{ modName = "RageRegen" },
}, },
{ label = "Inc. Item Quantity", { format = "{0:mod:1}%", { modName = "LootQuantity", modType = "INC", cfg = "skill" }, }, },
{ label = "Inc. Item Rarity", { format = "{0:mod:1}%", { modName = "LootRarity", modType = "INC", cfg = "skill" }, }, },
{ label = "Culling Strike", haveOutput = "CullPercent", { format = "{0:output:CullPercent}%", { modName = { "CullPercent", "CriticalCullPercent" }, cfg = "skill" } } },
{ label = "Enemy Life Regen", haveOutput = "EnemyLifeRegen", { format = "{0:output:EnemyLifeRegen}%", { modName = "LifeRegen", modType = "INC", enemy = true }, }, },
{ label = "Enemy Mana Regen", haveOutput = "EnemyManaRegen", { format = "{0:output:EnemyManaRegen}%", { modName = "ManaRegen", modType = "INC", enemy = true }, }, },
{ label = "Enemy ES Regen", haveOutput = "EnemyEnergyShieldRegen", { format = "{0:output:EnemyEnergyShieldRegen}%", { modName = "EnergyShieldRegen", modType = "INC", enemy = true }, }, },
} }
} },
--misc
Expand Down
29 changes: 24 additions & 5 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,15 @@ local preFlagList = {
["^enemies (%a+) by you have "] = function(cond)
return { tag = { type = "Condition", var = cond:gsub("^%a", string.upper) }, applyToEnemy = true }
end,
["^while a pinnacle atlas boss is in your presence, enemies you've hit recently have "] = function(cond)
return { playerTagList = { { type = "Condition", var = "HitRecently" }, { type = "ActorCondition", actor = "enemy", var = "RareOrUnique" } }, applyToEnemy = true }
end,
["^while a unique enemy is in your presence, enemies you've hit recently have "] = function(cond)
return { playerTagList = { { type = "Condition", var = "HitRecently" }, { type = "ActorCondition", actor = "enemy", var = "PinnacleBoss" } }, applyToEnemy = true }
end,
["^enemies you've hit recently have "] = function(cond)
return { playerTag = { type = "Condition", var = "HitRecently" }, applyToEnemy = true }
end,
["^hits against enemies (%a+) by you have "] = function(cond)
return { tag = { type = "ActorCondition", actor = "enemy", var = cond:gsub("^%a", string.upper) } }
end,
Expand Down Expand Up @@ -2518,6 +2527,7 @@ local specialModList = {
["your shocks can increase damage taken by up to a maximum of (%d+)%%"] = function(num) return { mod("ShockMax", "OVERRIDE", num) } end,
["%+(%d+)%% to maximum effect of shock"] = function(num) return { mod("ShockMax", "BASE", num) } end,
["your elemental damage can shock"] = { flag("ColdCanShock"), flag("FireCanShock") },
["your fire damage can shock"] = { flag("FireCanShock") },
["all y?o?u?r? ?damage can freeze"] = { flag("PhysicalCanFreeze"), flag("LightningCanFreeze"), flag("FireCanFreeze"), flag("ChaosCanFreeze") },
["all damage with maces and sceptres inflicts chill"] = { mod("EnemyModifier", "LIST", { mod = flag("Condition:Chilled") }, { type = "Condition", var = "UsingMace" }) },
["your cold damage can ignite"] = { flag("ColdCanIgnite") },
Expand All @@ -2533,6 +2543,7 @@ local specialModList = {
["your physical damage can chill"] = { flag("PhysicalCanChill") },
["your physical damage can shock"] = { flag("PhysicalCanShock") },
["your physical damage can freeze"] = { flag("PhysicalCanFreeze") },
["your lightning damage can freeze"] = { flag("LightningCanFreeze") },
["you always ignite while burning"] = { mod("EnemyIgniteChance", "BASE", 100, { type = "Condition", var = "Burning" }) },
["critical strikes do not a?l?w?a?y?s?i?n?h?e?r?e?n?t?l?y? freeze"] = { flag("CritsDontAlwaysFreeze") },
["cannot inflict elemental ailments"] = {
Expand Down Expand Up @@ -4733,13 +4744,14 @@ local function parseMod(line, order)
elseif misc.addToMinion then
-- Minion modifiers
for i, effectMod in ipairs(modList) do
local tagList = { misc.playerTag }
local tagList = { }
if misc.playerTag then t_insert(tagList, misc.playerTag) end
if misc.addToMinionTag then t_insert(tagList, misc.addToMinionTag) end
if misc.playerTagList then
for i, tag in ipairs(misc.playerTagList) do
tagList[i] = tag
for _, tag in ipairs(misc.playerTagList) do
t_insert(tagList, tag)
end
end
t_insert(tagList, misc.addToMinionTag)
modList[i] = mod("MinionModifier", "LIST", { mod = effectMod }, unpack(tagList))
end
elseif misc.addToSkill then
Expand All @@ -4749,12 +4761,19 @@ local function parseMod(line, order)
end
elseif misc.applyToEnemy then
for i, effectMod in ipairs(modList) do
local tagList = { }
if misc.playerTag then t_insert(tagList, misc.playerTag) end
if misc.playerTagList then
for _, tag in ipairs(misc.playerTagList) do
t_insert(tagList, tag)
end
end
local newMod = effectMod
if effectMod[1] and type(effectMod) == "table" and misc.actorEnemy then
newMod = copyTable(effectMod)
newMod[1]["actor"] = "enemy"
end
modList[i] = mod("EnemyModifier", "LIST", { mod = newMod })
modList[i] = mod("EnemyModifier", "LIST", { mod = newMod }, unpack(tagList))
end
end
end
Expand Down

0 comments on commit 4cafa10

Please sign in to comment.