@@ -3596,6 +3596,7 @@ function calcs.offence(env, actor, activeSkill)
35963596 end
35973597 end
35983598
3599+ -- Ailment + Non Damaging Ailment Section
35993600 local ailmentData = data .nonDamagingAilment
36003601 for _ , ailment in ipairs (ailmentTypeList ) do
36013602 skillFlags [string.lower (ailment )] = false
@@ -3665,6 +3666,7 @@ function calcs.offence(env, actor, activeSkill)
36653666 output .PoisonChanceOnHit = m_min (100 , skillModList :Sum (" BASE" , cfg , " PoisonChance" ) + enemyDB :Sum (" BASE" , nil , " SelfPoisonChance" ))
36663667 output .ChaosPoisonChance = m_min (100 , skillModList :Sum (" BASE" , cfg , " ChaosPoisonChance" ))
36673668 end
3669+ -- Elemental Ailment Affliction Chance | Elemental Ailment Additionals
36683670 for _ , ailment in ipairs (elementalAilmentTypeList ) do
36693671 local chance = skillModList :Sum (" BASE" , cfg , " Enemy" .. ailment .. " Chance" ) + enemyDB :Sum (" BASE" , nil , " Self" .. ailment .. " Chance" )
36703672 if ailment == " Chill" then
@@ -4713,6 +4715,7 @@ function calcs.offence(env, actor, activeSkill)
47134715 local enemyTypeMult = isBoss and 7.68 or 1
47144716 local enemyThreshold = enemyAilmentThreshold * enemyTypeMult * enemyMapLifeMult * enemyDB :More (nil , " Life" ) * enemyMapAilmentMult * enemyDB :More (nil , " AilmentThreshold" )
47154717
4718+ -- Defaulting ailments dictionary | Done to organize non-damaging ailments by type and have standardized effect and threshhold calcs
47164719 local ailments = {
47174720 [" Chill" ] = {
47184721 effList = { 10 , 20 },
@@ -4745,6 +4748,7 @@ function calcs.offence(env, actor, activeSkill)
47454748 ramping = false ,
47464749 },
47474750 }
4751+ -- Chilling Area like floor Frost has a different effect and must be done differently
47484752 if activeSkill .skillTypes [SkillType .ChillingArea ] or activeSkill .skillTypes [SkillType .NonHitChill ] then
47494753 skillFlags .chill = true
47504754 local incChill = skillModList :Sum (" INC" , cfg , " EnemyChillEffect" )
@@ -4763,6 +4767,7 @@ function calcs.offence(env, actor, activeSkill)
47634767 })
47644768 end
47654769 end
4770+ -- Crit ailments are done differently for Freeze
47664771 if (output .FreezeChanceOnHit + output .FreezeChanceOnCrit ) > 0 then
47674772 if globalBreakdown then
47684773 globalBreakdown .FreezeDurationMod = {
@@ -4779,19 +4784,29 @@ function calcs.offence(env, actor, activeSkill)
47794784 end
47804785 end
47814786 end
4787+ -- Cycle through all non-damage ailments here, modifying them if needed
47824788 for ailment , val in pairs (ailments ) do
47834789 if (output [ailment .. " ChanceOnHit" ] + output [ailment .. " ChanceOnCrit" ]) > 0 then
47844790 if globalBreakdown then
47854791 globalBreakdown [ailment .. " EffectMod" ] = {
47864792 s_format (" Ailment mode: %s ^8(can be changed in the Configuration tab)" , ailmentMode == " CRIT" and " Crits Only" or " Average Damage" )
47874793 }
47884794 end
4795+ -- Sets the crit strike condition to match ailment mode.
4796+ if ailmentMode == " CRIT" then
4797+ cfg .skillCond [" CriticalStrike" ] = true
4798+ else
4799+ cfg .skillCond [" CriticalStrike" ] = false
4800+ end
4801+
47894802 local damage = calcAilmentDamage (ailment , output .CritChance , calcAverageSourceDamage (ailment )) * skillModList :More (cfg , ailment .. " AsThoughDealing" )
4803+ -- We check if there is a damage instance above 0 since if you deal 0 damage, you don't apply anything.
47904804 if damage > 0 then
47914805 skillFlags [string.lower (ailment )] = true
47924806 local incDur = skillModList :Sum (" INC" , cfg , " Enemy" .. ailment .. " Duration" , " EnemyElementalAilmentDuration" , " EnemyAilmentDuration" ) + enemyDB :Sum (" INC" , nil , " Self" .. ailment .. " Duration" , " SelfElementalAilmentDuration" , " SelfAilmentDuration" )
47934807 local moreDur = skillModList :More (cfg , " Enemy" .. ailment .. " Duration" , " EnemyElementalAilmentDuration" , " EnemyAilmentDuration" ) * enemyDB :More (nil , " Self" .. ailment .. " Duration" , " SelfElementalAilmentDuration" , " SelfAilmentDuration" )
47944808 output [ailment .. " Duration" ] = ailmentData [ailment ].duration * (1 + incDur / 100 ) * moreDur * debuffDurationMult
4809+ -- Line Controlls Crit Conditional for Crit Mastery
47954810 output [ailment .. " EffectMod" ] = calcLib .mod (skillModList , cfg , " Enemy" .. ailment .. " Effect" )
47964811 if breakdown then
47974812 local maximum = globalOutput [" Maximum" .. ailment ] or ailmentData [ailment ].max
0 commit comments