From bc6d7ed040e3f00b04b338374ebe4f5f8392dd12 Mon Sep 17 00:00:00 2001 From: Jonathan Dang <77904634+Jonathan-Dang@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:06:49 -0800 Subject: [PATCH] Fixed Non-Damaging Ailment issue with Critical Mastery Fixed an issue where Critical Hits were not displaying the Critical Mastery Node increasing non-damaging ailment effect mod to critically strike enemies. --- src/Modules/CalcOffence.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index 6393f3f9a6..d47d3bdc42 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -3581,6 +3581,7 @@ function calcs.offence(env, actor, activeSkill) end end + -- Ailment + Non Damaging Ailment Section local ailmentData = data.nonDamagingAilment for _, ailment in ipairs(ailmentTypeList) do skillFlags[string.lower(ailment)] = false @@ -3650,6 +3651,7 @@ function calcs.offence(env, actor, activeSkill) output.PoisonChanceOnHit = m_min(100, skillModList:Sum("BASE", cfg, "PoisonChance") + enemyDB:Sum("BASE", nil, "SelfPoisonChance")) output.ChaosPoisonChance = m_min(100, skillModList:Sum("BASE", cfg, "ChaosPoisonChance")) end + -- Elemental Ailment Affliction Chance | Elemental Ailment Additionals for _, ailment in ipairs(elementalAilmentTypeList) do local chance = skillModList:Sum("BASE", cfg, "Enemy"..ailment.."Chance") + enemyDB:Sum("BASE", nil, "Self"..ailment.."Chance") if ailment == "Chill" then @@ -4698,6 +4700,7 @@ function calcs.offence(env, actor, activeSkill) local enemyTypeMult = isBoss and 7.68 or 1 local enemyThreshold = enemyAilmentThreshold * enemyTypeMult * enemyMapLifeMult * enemyDB:More(nil, "Life") * enemyMapAilmentMult * enemyDB:More(nil, "AilmentThreshold") + -- Defaulting ailments dictionary | Done to organize non-damaging ailments by type and have standardized effect and threshhold calcs local ailments = { ["Chill"] = { effList = { 10, 20 }, @@ -4730,6 +4733,7 @@ function calcs.offence(env, actor, activeSkill) ramping = false, }, } + -- Chilling Area like floor Frost has a different effect and must be done differently if activeSkill.skillTypes[SkillType.ChillingArea] or activeSkill.skillTypes[SkillType.NonHitChill] then skillFlags.chill = true local incChill = skillModList:Sum("INC", cfg, "EnemyChillEffect") @@ -4748,6 +4752,7 @@ function calcs.offence(env, actor, activeSkill) }) end end + -- Crit ailments are done differently for Freeze if (output.FreezeChanceOnHit + output.FreezeChanceOnCrit) > 0 then if globalBreakdown then globalBreakdown.FreezeDurationMod = { @@ -4764,6 +4769,7 @@ function calcs.offence(env, actor, activeSkill) end end end + -- Cycle through all non-damage ailments here, modifying them if needed for ailment, val in pairs(ailments) do if (output[ailment.."ChanceOnHit"] + output[ailment.."ChanceOnCrit"]) > 0 then if globalBreakdown then @@ -4771,12 +4777,21 @@ function calcs.offence(env, actor, activeSkill) s_format("Ailment mode: %s ^8(can be changed in the Configuration tab)", ailmentMode == "CRIT" and "Crits Only" or "Average Damage") } end + -- Sets the crit strike condition to match ailment mode. + if ailmentMode == "CRIT" then + cfg.skillCond["CriticalStrike"] = true + else + cfg.skillCond["CriticalStrike"] = false + end + local damage = calcAilmentDamage(ailment, output.CritChance, calcAverageSourceDamage(ailment)) * skillModList:More(cfg, ailment.."AsThoughDealing") + -- We check if there is a damage instance above 0 since if you deal 0 damage, you don't apply anything. if damage > 0 then skillFlags[string.lower(ailment)] = true local incDur = skillModList:Sum("INC", cfg, "Enemy"..ailment.."Duration", "EnemyElementalAilmentDuration", "EnemyAilmentDuration") + enemyDB:Sum("INC", nil, "Self"..ailment.."Duration", "SelfElementalAilmentDuration", "SelfAilmentDuration") local moreDur = skillModList:More(cfg, "Enemy"..ailment.."Duration", "EnemyElementalAilmentDuration", "EnemyAilmentDuration") * enemyDB:More(nil, "Self"..ailment.."Duration", "SelfElementalAilmentDuration", "SelfAilmentDuration") output[ailment.."Duration"] = ailmentData[ailment].duration * (1 + incDur / 100) * moreDur * debuffDurationMult + -- Line Controlls Crit Conditional for Crit Mastery output[ailment.."EffectMod"] = calcLib.mod(skillModList, cfg, "Enemy"..ailment.."Effect") if breakdown then local maximum = globalOutput["Maximum"..ailment] or ailmentData[ailment].max