Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Passes to only always, never or average crit chance #8270

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2907,8 +2907,8 @@ function calcs.offence(env, actor, activeSkill)
output.EnergyShieldLeechInstant = 0
output.ManaLeech = 0
output.ManaLeechInstant = 0
output.impaleStoredHitAvg = 0
for pass = 1, 2 do
output.impaleStoredHitAvg = 0
for _, pass in ipairs(output.CritChance == 100 and { 1 } or output.CritChance == 0 and { 2 } or { 1, 2 }) do
-- Pass 1 is critical strike damage, pass 2 is non-critical strike
cfg.skillCond["CriticalStrike"] = (pass == 1)
local lifeLeechTotal = 0
Expand Down Expand Up @@ -3077,15 +3077,15 @@ function calcs.offence(env, actor, activeSkill)
if env.mode == "CALCS" then
output[damageType.."EffMult"] = effMult
end
if pass == 2 and breakdown and (effMult ~= 1 or sourceRes ~= damageType) and skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then
if breakdown and (pass == 2 or output.CritChance == 100) and (effMult ~= 1 or sourceRes ~= damageType) and skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then
t_insert(breakdown[damageType], s_format("x %.3f ^8(effective DPS modifier)", effMult))
breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, 0, takenInc, effMult, takenMore, sourceRes, useRes, invertChance)
elseif pass == 2 and breakdown and (effMult ~= 1 or sourceRes ~= damageType) then
elseif breakdown and (pass == 2 or output.CritChance == 100) and (effMult ~= 1 or sourceRes ~= damageType) then
t_insert(breakdown[damageType], s_format("x %.3f ^8(effective DPS modifier)", effMult))
breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, pen, takenInc, effMult, takenMore, sourceRes, useRes, invertChance)
end
end
if pass == 2 and breakdown then
if breakdown and (pass == 2 or output.CritChance == 100) then
t_insert(breakdown[damageType], s_format("= %d to %d", damageTypeHitMin, damageTypeHitMax))
end

Expand Down Expand Up @@ -3128,12 +3128,13 @@ function calcs.offence(env, actor, activeSkill)
}
end
end
if pass == 1 then
if pass == 1 or output.CritChance == 0 then
output[damageType.."CritAverage"] = damageTypeHitAvg
totalCritAvg = totalCritAvg + damageTypeHitAvg
totalCritMin = totalCritMin + damageTypeHitMin
totalCritMax = totalCritMax + damageTypeHitMax
else
end
if pass == 2 or output.CritChance == 100 then
if env.mode == "CALCS" then
output[damageType.."Min"] = damageTypeHitMin
output[damageType.."Max"] = damageTypeHitMax
Expand Down Expand Up @@ -5527,4 +5528,15 @@ function calcs.offence(env, actor, activeSkill)
output.CullingDPS = output.CombinedDPS * (bestCull - 1)
output.ReservationDPS = output.CombinedDPS * (output.ReservationDpsMultiplier - 1)
output.CombinedDPS = output.CombinedDPS * bestCull * output.ReservationDpsMultiplier


if output.CritChance == 100 then
skillCfg.skillCond["CriticalStrike"] = true
end
if output.MainHand and output.MainHand.CritChance == 100 then
activeSkill.weapon1Cfg.skillCond["CriticalStrike"] = true
end
if output.OffHand and output.OffHand.CritChance == 100 then
activeSkill.weapon2Cfg.skillCond["CriticalStrike"] = true
end
end
22 changes: 11 additions & 11 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ return {
},
{ format = "x {3:output:LightningEffMult}",
{ breakdown = "LightningEffMult" },
{ label = "Player modifiers", modName = { "LightningPenetration", "ElementalPenetration", "IgnoreLightningResistance" }, cfg = "skill" },
{ label = "Player modifiers", modName = { "LightningPenetration", "ElementalPenetration", "IgnoreLightningResistance", "IgnoreElementalResistances" }, cfg = "skill" },
{ label = "Enemy modifiers", modName = lightningHitTaken, enemy = true, cfg = "skill" },
},
{ format = "x {3:output:ColdEffMult}",
{ breakdown = "ColdEffMult" },
{ label = "Player modifiers", modName = { "ColdPenetration", "ElementalPenetration", "IgnoreColdResistance" }, cfg = "skill" },
{ label = "Player modifiers", modName = { "ColdPenetration", "ElementalPenetration", "IgnoreColdResistance", "IgnoreElementalResistances" }, cfg = "skill" },
{ label = "Enemy modifiers", modName = coldHitTaken, enemy = true, cfg = "skill" },
},
{ format = "x {3:output:FireEffMult}",
{ breakdown = "FireEffMult" },
{ label = "Player modifiers", modName = { "FirePenetration", "ElementalPenetration", "IgnoreFireResistance" }, cfg = "skill" },
{ label = "Player modifiers", modName = { "FirePenetration", "ElementalPenetration", "IgnoreFireResistance", "IgnoreElementalResistances" }, cfg = "skill" },
{ label = "Enemy modifiers", modName = fireHitTaken, enemy = true, cfg = "skill" },
},
{ format = "x {3:output:ChaosEffMult}",
Expand Down Expand Up @@ -197,22 +197,22 @@ return {
},
{ format = "x {3:output:MainHand.LightningEffMult}",
{ breakdown = "MainHand.LightningEffMult" },
{ label = "Player modifiers", modName = { "LightningPenetration", "ElementalPenetration" }, cfg = "weapon1" },
{ label = "Player modifiers", modName = { "LightningPenetration", "ElementalPenetration", "IgnoreLightningResistance", "IgnoreElementalResistances" }, cfg = "weapon1" },
{ label = "Enemy modifiers", modName = lightningHitTaken, enemy = true, cfg = "weapon1" },
},
{ format = "x {3:output:MainHand.ColdEffMult}",
{ breakdown = "MainHand.ColdEffMult" },
{ label = "Player modifiers", modName = { "ColdPenetration", "ElementalPenetration" }, cfg = "weapon1" },
{ label = "Player modifiers", modName = { "ColdPenetration", "ElementalPenetration", "IgnoreColdResistance", "IgnoreElementalResistances" }, cfg = "weapon1" },
{ label = "Enemy modifiers", modName = coldHitTaken, enemy = true, cfg = "weapon1" },
},
{ format = "x {3:output:MainHand.FireEffMult}",
{ breakdown = "MainHand.FireEffMult" },
{ label = "Player modifiers", modName = { "FirePenetration", "ElementalPenetration" }, cfg = "weapon1" },
{ label = "Player modifiers", modName = { "FirePenetration", "ElementalPenetration", "IgnoreFireResistance", "IgnoreElementalResistances" }, cfg = "weapon1" },
{ label = "Enemy modifiers", modName = fireHitTaken, enemy = true, cfg = "weapon1" },
},
{ format = "x {3:output:MainHand.ChaosEffMult}",
{ breakdown = "MainHand.ChaosEffMult" },
{ label = "Player modifiers", modName = "ChaosPenetration", cfg = "weapon1" },
{ label = "Player modifiers", modName = {"ChaosPenetration", "IgnoreChaosResistance"}, cfg = "weapon1" },
{ label = "Enemy modifiers", modName = chaosHitTaken, enemy = true, cfg = "weapon1" },
},
},
Expand Down Expand Up @@ -268,22 +268,22 @@ return {
},
{ format = "x {3:output:OffHand.LightningEffMult}",
{ breakdown = "OffHand.LightningEffMult" },
{ label = "Player modifiers", modName = { "LightningPenetration", "ElementalPenetration" }, cfg = "weapon2" },
{ label = "Player modifiers", modName = { "LightningPenetration", "ElementalPenetration", "IgnoreLightningResistance", "IgnoreElementalResistances" }, cfg = "weapon2" },
{ label = "Enemy modifiers", modName = lightningHitTaken, enemy = true, cfg = "weapon2" },
},
{ format = "x {3:output:OffHand.ColdEffMult}",
{ breakdown = "OffHand.ColdEffMult" },
{ label = "Player modifiers", modName = { "ColdPenetration", "ElementalPenetration" }, cfg = "weapon2" },
{ label = "Player modifiers", modName = { "ColdPenetration", "ElementalPenetration", "IgnoreColdResistance", "IgnoreElementalResistances" }, cfg = "weapon2" },
{ label = "Enemy modifiers", modName = coldHitTaken, enemy = true, cfg = "weapon2" },
},
{ format = "x {3:output:OffHand.FireEffMult}",
{ breakdown = "OffHand.FireEffMult" },
{ label = "Player modifiers", modName = { "FirePenetration", "ElementalPenetration" }, cfg = "weapon2" },
{ label = "Player modifiers", modName = { "FirePenetration", "ElementalPenetration", "IgnoreFireResistance", "IgnoreElementalResistances" }, cfg = "weapon2" },
{ label = "Enemy modifiers", modName = fireHitTaken, enemy = true, cfg = "weapon2" },
},
{ format = "x {3:output:OffHand.ChaosEffMult}",
{ breakdown = "OffHand.ChaosEffMult" },
{ label = "Player modifiers", modName = "ChaosPenetration", cfg = "weapon2" },
{ label = "Player modifiers", modName = {"ChaosPenetration", "IgnoreChaosResistance"}, cfg = "weapon2" },
{ label = "Enemy modifiers", modName = chaosHitTaken, enemy = true, cfg = "weapon2" },
},
},
Expand Down
Loading