Skip to content

Commit edb2422

Browse files
authored
fix viper strike of mamba poison (#8253)
1 parent 9d01152 commit edb2422

File tree

2 files changed

+61
-30
lines changed

2 files changed

+61
-30
lines changed

src/Modules/CalcOffence.lua

Lines changed: 56 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,24 +1870,46 @@ function calcs.offence(env, actor, activeSkill)
18701870
if output.MainHand[stat] and output.OffHand[stat] then
18711871
local mainChance = output.MainHand[...] * output.MainHand.HitChance
18721872
local offChance = output.OffHand[...] * output.OffHand.HitChance
1873-
local mainPortion = mainChance / (mainChance + offChance)
1874-
local offPortion = offChance / (mainChance + offChance)
1875-
output[stat] = output.MainHand[stat] * mainPortion + output.OffHand[stat] * offPortion
1876-
if breakdown then
1877-
if not breakdown[stat] then
1878-
breakdown[stat] = { }
1873+
if skillData.doubleHitsWhenDualWielding then
1874+
mainChance = mainChance / 10000
1875+
offChance = offChance / 10000
1876+
output[stat] = output.MainHand[stat] * mainChance + output.OffHand[stat] * offChance
1877+
if breakdown then
1878+
if not breakdown[stat] then
1879+
breakdown[stat] = { }
1880+
end
1881+
t_insert(breakdown[stat], "Contribution from Main Hand:")
1882+
t_insert(breakdown[stat], s_format("%.1f", output.MainHand[stat]))
1883+
t_insert(breakdown[stat], s_format("x %.3f ^8(chance of main hand)", mainChance))
1884+
t_insert(breakdown[stat], s_format("= %.1f", output.MainHand[stat] * mainChance))
1885+
t_insert(breakdown[stat], "Contribution from Off Hand:")
1886+
t_insert(breakdown[stat], s_format("%.1f", output.OffHand[stat]))
1887+
t_insert(breakdown[stat], s_format("x %.3f ^8(chance of off hand)", offChance))
1888+
t_insert(breakdown[stat], s_format("= %.1f", output.OffHand[stat] * offChance))
1889+
t_insert(breakdown[stat], "Total:")
1890+
t_insert(breakdown[stat], s_format("%.1f + %.1f", output.MainHand[stat] * mainChance, output.OffHand[stat] * offChance))
1891+
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
1892+
end
1893+
else
1894+
local mainPortion = mainChance / (mainChance + offChance)
1895+
local offPortion = offChance / (mainChance + offChance)
1896+
output[stat] = output.MainHand[stat] * mainPortion + output.OffHand[stat] * offPortion
1897+
if breakdown then
1898+
if not breakdown[stat] then
1899+
breakdown[stat] = { }
1900+
end
1901+
t_insert(breakdown[stat], "Contribution from Main Hand:")
1902+
t_insert(breakdown[stat], s_format("%.1f", output.MainHand[stat]))
1903+
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by main hand)", mainPortion))
1904+
t_insert(breakdown[stat], s_format("= %.1f", output.MainHand[stat] * mainPortion))
1905+
t_insert(breakdown[stat], "Contribution from Off Hand:")
1906+
t_insert(breakdown[stat], s_format("%.1f", output.OffHand[stat]))
1907+
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by off hand)", offPortion))
1908+
t_insert(breakdown[stat], s_format("= %.1f", output.OffHand[stat] * offPortion))
1909+
t_insert(breakdown[stat], "Total:")
1910+
t_insert(breakdown[stat], s_format("%.1f + %.1f", output.MainHand[stat] * mainPortion, output.OffHand[stat] * offPortion))
1911+
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
18791912
end
1880-
t_insert(breakdown[stat], "Contribution from Main Hand:")
1881-
t_insert(breakdown[stat], s_format("%.1f", output.MainHand[stat]))
1882-
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by main hand)", mainPortion))
1883-
t_insert(breakdown[stat], s_format("= %.1f", output.MainHand[stat] * mainPortion))
1884-
t_insert(breakdown[stat], "Contribution from Off Hand:")
1885-
t_insert(breakdown[stat], s_format("%.1f", output.OffHand[stat]))
1886-
t_insert(breakdown[stat], s_format("x %.3f ^8(portion of instances created by off hand)", offPortion))
1887-
t_insert(breakdown[stat], s_format("= %.1f", output.OffHand[stat] * offPortion))
1888-
t_insert(breakdown[stat], "Total:")
1889-
t_insert(breakdown[stat], s_format("%.1f + %.1f", output.MainHand[stat] * mainPortion, output.OffHand[stat] * offPortion))
1890-
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
18911913
end
18921914
else
18931915
output[stat] = output.MainHand[stat] or output.OffHand[stat]
@@ -1908,14 +1930,14 @@ function calcs.offence(env, actor, activeSkill)
19081930
t_insert(breakdown[stat], s_format(""))
19091931
t_insert(breakdown[stat], s_format("%.2f%% of ailment stacks use maximum damage", maxInstanceStacks * 100))
19101932
t_insert(breakdown[stat], s_format("Max Damage comes from %s", output.MainHand[stat] >= output.OffHand[stat] and "Main Hand" or "Off Hand"))
1911-
t_insert(breakdown[stat], s_format("= %.1f", maxInstance * maxInstanceStacks))
1912-
if maxInstanceStacks < 1 then
1913-
t_insert(breakdown[stat], s_format("%.2f%% of ailment stacks use non-maximum damage", (1-maxInstanceStacks) * 100))
1914-
t_insert(breakdown[stat], s_format("= %.1f", minInstance * (1 - maxInstanceStacks)))
1915-
end
1916-
t_insert(breakdown[stat], "")
1917-
t_insert(breakdown[stat], "Total:")
1918-
if maxInstanceStacks < 1 then
1933+
t_insert(breakdown[stat], s_format("= %.1f", maxInstance * maxInstanceStacks))
1934+
if maxInstanceStacks < 1 then
1935+
t_insert(breakdown[stat], s_format("%.2f%% of ailment stacks use non-maximum damage", (1-maxInstanceStacks) * 100))
1936+
t_insert(breakdown[stat], s_format("= %.1f", minInstance * (1 - maxInstanceStacks)))
1937+
end
1938+
t_insert(breakdown[stat], "")
1939+
t_insert(breakdown[stat], "Total:")
1940+
if maxInstanceStacks < 1 then
19191941
t_insert(breakdown[stat], s_format("%.1f + %.1f", maxInstance * maxInstanceStacks, minInstance * (1 - maxInstanceStacks)))
19201942
end
19211943
t_insert(breakdown[stat], s_format("= %.1f", output[stat]))
@@ -4267,14 +4289,14 @@ function calcs.offence(env, actor, activeSkill)
42674289
if groundMult > 0 then
42684290
local CausticGroundDPSUncapped = baseVal * effectMod * rateMod * effMult * groundMult / 100
42694291
local CausticGroundDPSCapped = m_min(CausticGroundDPSUncapped, data.misc.DotDpsCap)
4270-
globalOutput.CausticGroundDPS = CausticGroundDPSCapped
4292+
output.CausticGroundDPS = CausticGroundDPSCapped
42714293
globalOutput.CausticGroundFromPoison = true
4272-
if globalBreakdown then
4273-
globalBreakdown.CausticGroundDPS = {
4294+
if breakdown then
4295+
breakdown.CausticGroundDPS = {
42744296
s_format("%.1f ^8(single poison damage per second)", baseVal * effectMod * rateMod),
42754297
s_format("* %.1f%% ^8(percent as Caustic ground)", groundMult),
42764298
s_format("* %.3f ^8(effect mult)", effMult),
4277-
s_format("= %.1f ^8per second", globalOutput.CausticGroundDPS)
4299+
s_format("= %.1f ^8per second", output.CausticGroundDPS)
42784300
}
42794301
end
42804302
end
@@ -5025,6 +5047,7 @@ function calcs.offence(env, actor, activeSkill)
50255047
combineStat("BleedDPS", "CHANCE_AILMENT", "BleedChance")
50265048
combineStat("PoisonChance", "AVERAGE")
50275049
combineStat("PoisonDPS", "CHANCE", "PoisonChance")
5050+
combineStat("CausticGroundDPS", "CHANCE", "PoisonChance")
50285051
combineStat("TotalPoisonDPS", "DPS")
50295052
combineStat("PoisonDamage", "CHANCE", "PoisonChance")
50305053
if skillData.showAverage then
@@ -5502,6 +5525,10 @@ function calcs.offence(env, actor, activeSkill)
55025525
output.WithBleedDPS = baseDPS
55035526
end
55045527
if skillFlags.impale then
5528+
if skillFlags.attack and skillData.doubleHitsWhenDualWielding and skillFlags.bothWeaponAttack then
5529+
-- due to how its being combined
5530+
output.ImpaleModifier = output.ImpaleModifier / 2
5531+
end
55055532
output.ImpaleDPS = output.impaleStoredHitAvg * ((output.ImpaleModifier or 1) - 1) * output.HitChance / 100 * skillData.dpsMultiplier
55065533
if skillData.showAverage then
55075534
output.WithImpaleDPS = output.AverageDamage + output.ImpaleDPS

src/Modules/CalcSections.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,11 @@ return {
926926
{ breakdown = "MainHand.PoisonDPS" },
927927
{ breakdown = "OffHand.PoisonDPS" },
928928
}, },
929-
{ label = "Caustic Ground", haveOutput = "CausticGroundFromPoison", { format = "{0:output:CausticGroundDPS}", { breakdown = "CausticGroundDPS" } } },
929+
{ label = "Caustic Ground", haveOutput = "CausticGroundFromPoison", { format = "{0:output:CausticGroundDPS}",
930+
{ breakdown = "CausticGroundDPS" },
931+
{ breakdown = "MainHand.CausticGroundDPS" },
932+
{ breakdown = "OffHand.CausticGroundDPS" },
933+
}, },
930934
{ label = "Poison Duration", { format = "{2:output:PoisonDuration}s",
931935
{ breakdown = "PoisonDuration" },
932936
{ label = "Player modifiers", modName = { "EnemyPoisonDuration", "EnemyAilmentDuration", "SkillAndDamagingAilmentDuration", "PoisonFaster" }, cfg = "poison" },

0 commit comments

Comments
 (0)