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

Fix Viper Strike of Mamba poison #8253

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
85 changes: 56 additions & 29 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1869,24 +1869,46 @@ function calcs.offence(env, actor, activeSkill)
if output.MainHand[stat] and output.OffHand[stat] then
local mainChance = output.MainHand[...] * output.MainHand.HitChance
local offChance = output.OffHand[...] * output.OffHand.HitChance
local mainPortion = mainChance / (mainChance + offChance)
local offPortion = offChance / (mainChance + offChance)
output[stat] = output.MainHand[stat] * mainPortion + output.OffHand[stat] * offPortion
if breakdown then
if not breakdown[stat] then
breakdown[stat] = { }
if skillData.doubleHitsWhenDualWielding then
mainChance = mainChance / 10000
offChance = offChance / 10000
output[stat] = output.MainHand[stat] * mainChance + output.OffHand[stat] * offChance
if breakdown then
if not breakdown[stat] then
breakdown[stat] = { }
end
t_insert(breakdown[stat], "Contribution from Main Hand:")
t_insert(breakdown[stat], s_format("%.1f", output.MainHand[stat]))
t_insert(breakdown[stat], s_format("x %.3f ^8(chance of main hand)", mainChance))
t_insert(breakdown[stat], s_format("= %.1f", output.MainHand[stat] * mainChance))
t_insert(breakdown[stat], "Contribution from Off Hand:")
t_insert(breakdown[stat], s_format("%.1f", output.OffHand[stat]))
t_insert(breakdown[stat], s_format("x %.3f ^8(chance of off hand)", offChance))
t_insert(breakdown[stat], s_format("= %.1f", output.OffHand[stat] * offChance))
t_insert(breakdown[stat], "Total:")
t_insert(breakdown[stat], s_format("%.1f + %.1f", output.MainHand[stat] * mainChance, output.OffHand[stat] * offChance))
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
end
else
local mainPortion = mainChance / (mainChance + offChance)
local offPortion = offChance / (mainChance + offChance)
output[stat] = output.MainHand[stat] * mainPortion + output.OffHand[stat] * offPortion
if breakdown then
if not breakdown[stat] then
breakdown[stat] = { }
end
t_insert(breakdown[stat], "Contribution from Main Hand:")
t_insert(breakdown[stat], s_format("%.1f", output.MainHand[stat]))
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by main hand)", mainPortion))
t_insert(breakdown[stat], s_format("= %.1f", output.MainHand[stat] * mainPortion))
t_insert(breakdown[stat], "Contribution from Off Hand:")
t_insert(breakdown[stat], s_format("%.1f", output.OffHand[stat]))
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by off hand)", offPortion))
t_insert(breakdown[stat], s_format("= %.1f", output.OffHand[stat] * offPortion))
t_insert(breakdown[stat], "Total:")
t_insert(breakdown[stat], s_format("%.1f + %.1f", output.MainHand[stat] * mainPortion, output.OffHand[stat] * offPortion))
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
end
t_insert(breakdown[stat], "Contribution from Main Hand:")
t_insert(breakdown[stat], s_format("%.1f", output.MainHand[stat]))
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by main hand)", mainPortion))
t_insert(breakdown[stat], s_format("= %.1f", output.MainHand[stat] * mainPortion))
t_insert(breakdown[stat], "Contribution from Off Hand:")
t_insert(breakdown[stat], s_format("%.1f", output.OffHand[stat]))
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by off hand)", offPortion))
t_insert(breakdown[stat], s_format("= %.1f", output.OffHand[stat] * offPortion))
t_insert(breakdown[stat], "Total:")
t_insert(breakdown[stat], s_format("%.1f + %.1f", output.MainHand[stat] * mainPortion, output.OffHand[stat] * offPortion))
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
end
else
output[stat] = output.MainHand[stat] or output.OffHand[stat]
Expand All @@ -1907,14 +1929,14 @@ function calcs.offence(env, actor, activeSkill)
t_insert(breakdown[stat], s_format(""))
t_insert(breakdown[stat], s_format("%.2f%% of ailment stacks use maximum damage", maxInstanceStacks * 100))
t_insert(breakdown[stat], s_format("Max Damage comes from %s", output.MainHand[stat] >= output.OffHand[stat] and "Main Hand" or "Off Hand"))
t_insert(breakdown[stat], s_format("= %.1f", maxInstance * maxInstanceStacks))
if maxInstanceStacks < 1 then
t_insert(breakdown[stat], s_format("%.2f%% of ailment stacks use non-maximum damage", (1-maxInstanceStacks) * 100))
t_insert(breakdown[stat], s_format("= %.1f", minInstance * (1 - maxInstanceStacks)))
end
t_insert(breakdown[stat], "")
t_insert(breakdown[stat], "Total:")
if maxInstanceStacks < 1 then
t_insert(breakdown[stat], s_format("= %.1f", maxInstance * maxInstanceStacks))
if maxInstanceStacks < 1 then
t_insert(breakdown[stat], s_format("%.2f%% of ailment stacks use non-maximum damage", (1-maxInstanceStacks) * 100))
t_insert(breakdown[stat], s_format("= %.1f", minInstance * (1 - maxInstanceStacks)))
end
t_insert(breakdown[stat], "")
t_insert(breakdown[stat], "Total:")
if maxInstanceStacks < 1 then
t_insert(breakdown[stat], s_format("%.1f + %.1f", maxInstance * maxInstanceStacks, minInstance * (1 - maxInstanceStacks)))
end
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
Expand Down Expand Up @@ -4248,14 +4270,14 @@ function calcs.offence(env, actor, activeSkill)
if groundMult > 0 then
local CausticGroundDPSUncapped = baseVal * effectMod * rateMod * effMult * groundMult / 100
local CausticGroundDPSCapped = m_min(CausticGroundDPSUncapped, data.misc.DotDpsCap)
globalOutput.CausticGroundDPS = CausticGroundDPSCapped
output.CausticGroundDPS = CausticGroundDPSCapped
globalOutput.CausticGroundFromPoison = true
if globalBreakdown then
globalBreakdown.CausticGroundDPS = {
if breakdown then
breakdown.CausticGroundDPS = {
s_format("%.1f ^8(single poison damage per second)", baseVal * effectMod * rateMod),
s_format("* %.1f%% ^8(percent as Caustic ground)", groundMult),
s_format("* %.3f ^8(effect mult)", effMult),
s_format("= %.1f ^8per second", globalOutput.CausticGroundDPS)
s_format("= %.1f ^8per second", output.CausticGroundDPS)
}
end
end
Expand Down Expand Up @@ -4993,6 +5015,7 @@ function calcs.offence(env, actor, activeSkill)
combineStat("BleedDPS", "CHANCE_AILMENT", "BleedChance")
combineStat("PoisonChance", "AVERAGE")
combineStat("PoisonDPS", "CHANCE", "PoisonChance")
combineStat("CausticGroundDPS", "CHANCE", "PoisonChance")
combineStat("TotalPoisonDPS", "DPS")
combineStat("PoisonDamage", "CHANCE", "PoisonChance")
if skillData.showAverage then
Expand Down Expand Up @@ -5445,6 +5468,10 @@ function calcs.offence(env, actor, activeSkill)
output.WithBleedDPS = baseDPS
end
if skillFlags.impale then
if skillFlags.attack and skillData.doubleHitsWhenDualWielding and skillFlags.bothWeaponAttack then
-- due to how its being combined
output.ImpaleModifier = output.ImpaleModifier / 2
end
output.ImpaleDPS = output.impaleStoredHitAvg * ((output.ImpaleModifier or 1) - 1) * output.HitChance / 100 * skillData.dpsMultiplier
if skillData.showAverage then
output.WithImpaleDPS = output.AverageDamage + output.ImpaleDPS
Expand Down
6 changes: 5 additions & 1 deletion src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,11 @@ return {
{ breakdown = "MainHand.PoisonDPS" },
{ breakdown = "OffHand.PoisonDPS" },
}, },
{ label = "Caustic Ground", haveOutput = "CausticGroundFromPoison", { format = "{0:output:CausticGroundDPS}", { breakdown = "CausticGroundDPS" } } },
{ label = "Caustic Ground", haveOutput = "CausticGroundFromPoison", { format = "{0:output:CausticGroundDPS}",
{ breakdown = "CausticGroundDPS" },
{ breakdown = "MainHand.CausticGroundDPS" },
{ breakdown = "OffHand.CausticGroundDPS" },
}, },
{ label = "Poison Duration", { format = "{2:output:PoisonDuration}s",
{ breakdown = "PoisonDuration" },
{ label = "Player modifiers", modName = { "EnemyPoisonDuration", "EnemyAilmentDuration", "SkillAndDamagingAilmentDuration", "PoisonFaster" }, cfg = "poison" },
Expand Down
Loading