Skip to content

Commit e4193ee

Browse files
Andrew-KlotzAndrew KlotzLocalIdentity
authored
Fix increased Enemy damage taken mods doubling their affect in Ailment calcs (PathOfBuildingCommunity#1819)
* Added de-duping to ailment type caculation to fix double counting in bleed and poison. * Better fix The mod was only there to handle elemental damage taken mods so now it is simplified Also adds a test to make sure it works correctly --------- Co-authored-by: Andrew Klotz <andrewsklotz@gamil.com> Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 75bae0d commit e4193ee

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

spec/System/TestAilments_spec.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,18 @@ describe("TestAilments", function()
1414
--TODO: Shock not supported currently
1515
--it("bleed is buffed by bleed chance", function()
1616
--end)
17-
end)
17+
18+
it("does not double count chaos damage taken for chaos poison", function()
19+
build.skillsTab:PasteSocketGroup("Chaos Bolt 1/0 1\nPoison I 1/0 1\n")
20+
runCallback("OnFrame")
21+
22+
local baseEffMult = build.calcsTab.mainOutput.PoisonEffMult
23+
assert.True(baseEffMult and baseEffMult > 0)
24+
25+
build.configTab.input.customMods = "Nearby enemies take 10% increased Chaos Damage"
26+
build.configTab:BuildModList()
27+
runCallback("OnFrame")
28+
29+
assert.are.equals(1.1, build.calcsTab.mainOutput.PoisonEffMult)
30+
end)
31+
end)

src/Modules/CalcOffence.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4882,8 +4882,9 @@ function calcs.offence(env, actor, activeSkill)
48824882
end
48834883
else
48844884
local resist = calcResistForType(ailmentDamageType, dotCfg)
4885-
local takenInc = enemyDB:Sum("INC", dotCfg, "DamageTaken", "DamageTakenOverTime", ailmentDamageType .. "DamageTaken", ailmentDamageType .. "DamageTakenOverTime", ailmentTypeMod .. "DamageTaken")
4886-
local takenMore = enemyDB:More(dotCfg, "DamageTaken", "DamageTakenOverTime", ailmentDamageType .. "DamageTaken", ailmentDamageType .. "DamageTakenOverTime", ailmentTypeMod .. "DamageTaken")
4885+
local elementalDamageTaken = isElemental[ailmentDamageType] and "ElementalDamageTaken" or nil
4886+
local takenInc = enemyDB:Sum("INC", dotCfg, "DamageTaken", "DamageTakenOverTime", ailmentDamageType .. "DamageTaken", ailmentDamageType .. "DamageTakenOverTime", elementalDamageTaken)
4887+
local takenMore = enemyDB:More(dotCfg, "DamageTaken", "DamageTakenOverTime", ailmentDamageType .. "DamageTaken", ailmentDamageType .. "DamageTakenOverTime", elementalDamageTaken)
48874888
effMult = (1 - resist / 100) * (1 + takenInc / 100) * takenMore
48884889
globalOutput[ailment .. "EffMult"] = effMult
48894890
if breakdown and effMult ~= 1 then

0 commit comments

Comments
 (0)