Skip to content

Commit 3050d9f

Browse files
RegisleLocalIdentity
andauthored
Add support for Low Tolerance notable(#4792)
* add support for low tolerance * add config to override it * cap poison and add tooltip Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent a55b8ee commit 3050d9f

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed

src/Modules/CalcOffence.lua

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3370,6 +3370,22 @@ function calcs.offence(env, actor, activeSkill)
33703370
breakdown.PoisonFire = { damageTypes = { } }
33713371
breakdown.PoisonChaos = { damageTypes = { } }
33723372
end
3373+
local rateMod = calcLib.mod(skillModList, cfg, "PoisonFaster") + enemyDB:Sum("INC", nil, "SelfPoisonFaster") / 100
3374+
local durationBase
3375+
if skillData.poisonDurationIsSkillDuration then
3376+
durationBase = skillData.duration
3377+
else
3378+
durationBase = data.misc.PoisonDurationBase
3379+
end
3380+
local durationMod = calcLib.mod(skillModList, dotCfg, "EnemyPoisonDuration", "EnemyAilmentDuration", "SkillAndDamagingAilmentDuration", skillData.poisonIsSkillEffect and "Duration" or nil) * calcLib.mod(enemyDB, nil, "SelfPoisonDuration", "SelfAilmentDuration")
3381+
globalOutput.PoisonDuration = durationBase * durationMod / rateMod * debuffDurationMult
3382+
local PoisonStacks = globalOutput.PoisonDuration * (globalOutput.HitSpeed or globalOutput.Speed) * (skillData.dpsMultiplier or 1) * (skillData.stackMultiplier or 1) * quantityMultiplier
3383+
if PoisonStacks < 1 and (env.configInput.multiplierPoisonOnEnemy or 0) <= 1 then
3384+
skillModList:NewMod("Condition:SinglePoison", "FLAG", true, "poison")
3385+
end
3386+
if skillModList:Flag(nil, "Condition:SinglePoison") then
3387+
PoisonStacks = m_min(PoisonStacks, 1)
3388+
end
33733389
for sub_pass = 1, 2 do
33743390
if skillModList:Flag(dotCfg, "AilmentsAreNeverFromCrit") or sub_pass == 1 then
33753391
dotCfg.skillCond["CriticalStrike"] = false
@@ -3449,7 +3465,6 @@ function calcs.offence(env, actor, activeSkill)
34493465
end
34503466
end
34513467
local effectMod = calcLib.mod(skillModList, dotCfg, "AilmentEffect")
3452-
local rateMod = calcLib.mod(skillModList, cfg, "PoisonFaster") + enemyDB:Sum("INC", nil, "SelfPoisonFaster") / 100
34533468
local PoisonDPSUncapped = baseVal * effectMod * rateMod * effMult
34543469
local PoisonDPSCapped = m_min(PoisonDPSUncapped, data.misc.DotDpsCap)
34553470
output.PoisonDPS = PoisonDPSCapped
@@ -3468,20 +3483,15 @@ function calcs.offence(env, actor, activeSkill)
34683483
}
34693484
end
34703485
end
3471-
local durationBase
3472-
if skillData.poisonDurationIsSkillDuration then
3473-
durationBase = skillData.duration
3474-
else
3475-
durationBase = data.misc.PoisonDurationBase
3476-
end
3477-
local durationMod = calcLib.mod(skillModList, dotCfg, "EnemyPoisonDuration", "EnemyAilmentDuration", "SkillAndDamagingAilmentDuration", skillData.poisonIsSkillEffect and "Duration" or nil) * calcLib.mod(enemyDB, nil, "SelfPoisonDuration", "SelfAilmentDuration")
3478-
globalOutput.PoisonDuration = durationBase * durationMod / rateMod * debuffDurationMult
34793486
output.PoisonDamage = output.PoisonDPS * globalOutput.PoisonDuration
34803487
if skillData.showAverage then
34813488
output.TotalPoisonAverageDamage = output.HitChance / 100 * output.PoisonChance / 100 * output.PoisonDamage
34823489
output.TotalPoisonDPS = output.PoisonDPS
34833490
else
3484-
output.TotalPoisonStacks = output.HitChance / 100 * output.PoisonChance / 100 * globalOutput.PoisonDuration * (globalOutput.HitSpeed or globalOutput.Speed) * (skillData.dpsMultiplier or 1) * (skillData.stackMultiplier or 1) * quantityMultiplier
3491+
output.TotalPoisonStacks = output.HitChance / 100 * output.PoisonChance / 100 * PoisonStacks
3492+
if skillModList:Flag(nil, "Condition:SinglePoison") and (PoisonStacks >= 1) then
3493+
output.TotalPoisonStacks = 1
3494+
end
34853495
output.TotalPoisonDPS = m_min(PoisonDPSCapped * output.TotalPoisonStacks, data.misc.DotDpsCap)
34863496
end
34873497
if breakdown then
@@ -3555,6 +3565,9 @@ function calcs.offence(env, actor, activeSkill)
35553565
{ "%g ^8(quantity multiplier for this skill)", quantityMultiplier },
35563566
total = s_format("= %.1f", output.TotalPoisonStacks),
35573567
})
3568+
if skillModList:Flag(nil, "Condition:SinglePoison") then
3569+
t_insert(breakdown.TotalPoisonStacks, "Capped to 1")
3570+
end
35583571
end
35593572
end
35603573
end

src/Modules/CalcSections.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,7 @@ return {
856856
{ breakdown = "MainHand.TotalPoisonStacks" },
857857
{ breakdown = "OffHand.TotalPoisonStacks" },
858858
{ breakdown = "TotalPoisonStacks" },
859+
{ label = "Capped to 1 poison", modName = "Condition:SinglePoison" },
859860
}, },
860861
} }
861862
} },

src/Modules/ConfigOptions.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,9 @@ Huge sets the radius to 11.
12621262
{ var = "multiplierPoisonOnEnemy", type = "count", label = "# of Poison on enemy:", implyCond = "Poisoned", apply = function(val, modList, enemyModList)
12631263
enemyModList:NewMod("Multiplier:PoisonStack", "BASE", val, "Config", { type = "Condition", var = "Effective" })
12641264
end },
1265+
{ var = "conditionSinglePoison", type = "check", label = "Cap to Single Poison on enemy?", ifCond = "SinglePoison", tooltip = "This is for low tolerance, but will limit you to only applying a single poison on the enemy", apply = function(val, modList, enemyModList)
1266+
modList:NewMod("Condition:SinglePoison", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1267+
end },
12651268
{ var = "multiplierCurseExpiredOnEnemy", type = "count", label = "#% of Curse Expired on enemy:", ifEnemyMult = "CurseExpired", apply = function(val, modList, enemyModList)
12661269
enemyModList:NewMod("Multiplier:CurseExpired", "BASE", val, "Config", { type = "Condition", var = "Effective" })
12671270
end },

src/Modules/ModParser.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,9 @@ local specialModList = {
26362636
["(%d+)%% chance for poisons inflicted with this weapon to deal (%d+)%% more damage"] = function(num, _, more) return {
26372637
mod("Damage", "MORE", tonumber(more) * num / 100, nil, 0, KeywordFlag.Poison, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }),
26382638
} end,
2639+
["poisons you inflict on non%-poisoned enemies deal (%d+)%% increased damage"] = function(num) return {
2640+
mod("Damage", "INC", num, nil, 0, KeywordFlag.Poison, { type = "Condition", var = "SinglePoison" })
2641+
} end,
26392642
["poisons on you expire (%d+)%% slower"] = function(num) return { mod("SelfPoisonDebuffExpirationRate", "BASE", -num)} end,
26402643
-- Suppression
26412644
["your chance to suppressed spell damage is lucky"] = { flag("SpellSuppressionChanceIsLucky") },

0 commit comments

Comments
 (0)