Skip to content

Commit abc32ee

Browse files
author
David Medgyesy
committed
Apply an explicit zero for Corrupting Blood, Cruelty and Herald config values
The six options now use countAllowZero, so an entered 0 is applied instead of falling back to the default. Zero Corrupting Cry or Bloodsoaked Banner stacks leaves the skill's Corrupting Blood unapplied.
1 parent bfee69d commit abc32ee

3 files changed

Lines changed: 73 additions & 13 deletions

File tree

‎spec/System/TestOffence_spec.lua‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,4 +445,50 @@ describe("TestOffence", function()
445445
-- "Buff grants 10% increased Attack Speed" at 20% quality: (1 + 1 + 0.1) / (1 + 1)
446446
assertNearRelative(1.05, attackSpeed(20) / attackSpeed(0), 0.0001)
447447
end)
448+
449+
it("Corrupting Cry with 0 stacks on the enemy deals no Corrupting Blood damage", function()
450+
build.skillsTab:PasteSocketGroup("Enduring Cry 20/0 1\nCorrupting Cry 20/0 1\n")
451+
runCallback("OnFrame")
452+
local oneStack = build.calcsTab.mainOutput.CorruptingBloodDPS
453+
assert.True(oneStack > 0)
454+
455+
build.configTab.input.conditionCorruptingCryStages = 0
456+
build.configTab:BuildModList()
457+
runCallback("OnFrame")
458+
459+
assert.are.equals(0, build.calcsTab.mainOutput.CorruptingBloodDPS or 0)
460+
assert.are.equals(0, build.calcsTab.mainEnv.modDB:Sum("BASE", nil, "Multiplier:CorruptingCryStageAfterFirst"))
461+
end)
462+
463+
it("distinguishes zero Bloodsoaked Banner stacks from the default and a positive override", function()
464+
build.skillsTab:PasteSocketGroup("War Banner 20/0 1\nBloodsoaked Banner 20/0 1\n")
465+
build.configTab.input.bannerPlanted = true
466+
build.configTab.input.bannerValour = 50
467+
build.configTab:BuildModList()
468+
runCallback("OnFrame")
469+
local oneStack = build.calcsTab.mainOutput.CorruptingBloodDPS
470+
assert.is_true(oneStack > 0)
471+
472+
build.configTab.input.bloodsoakedBannerStages = 5
473+
build.configTab:BuildModList()
474+
runCallback("OnFrame")
475+
assertNearRelative(5 * oneStack, build.calcsTab.mainOutput.CorruptingBloodDPS, 0.0001)
476+
477+
build.configTab.input.bloodsoakedBannerStages = 0
478+
build.configTab:BuildModList()
479+
runCallback("OnFrame")
480+
assert.are.equal(0, build.calcsTab.mainOutput.CorruptingBloodDPS)
481+
end)
482+
483+
it("treats zero Cruelty effect as an explicit override", function()
484+
build.skillsTab:PasteSocketGroup("Exsanguinate 20/0 1\nCruelty 20/0 1\n")
485+
runCallback("OnFrame")
486+
local maxCrueltyDot = build.calcsTab.mainOutput.TotalDot
487+
assert.is_true(maxCrueltyDot > 0)
488+
489+
build.configTab.input.overrideCruelty = 0
490+
build.configTab:BuildModList()
491+
runCallback("OnFrame")
492+
assertNearRelative(maxCrueltyDot / 1.4, build.calcsTab.mainOutput.TotalDot, 0.0001)
493+
end)
448494
end)

‎src/Modules/CalcOffence.lua‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5856,13 +5856,17 @@ function calcs.offence(env, actor, activeSkill)
58565856

58575857
runSkillFunc("preDotFunc")
58585858

5859+
-- Config can state that the enemy has no Corrupting Blood stacks from this skill; the debuff then simply is not
5860+
-- applied, so its DoT is skipped instead of being modelled as a -100% more multiplier.
5861+
local noCorruptingBlood = skillModList:Flag(nil, "dotIsCorruptingBlood") and skillModList:Flag(skillCfg, "NoCorruptingBloodStacks")
5862+
58595863
---Section Handles Generic Damage over time [DOT]
58605864
for _, damageType in ipairs(dmgTypeList) do
58615865
local dotTypeCfg = copyTable(dotCfg, true)
58625866
dotTypeCfg.keywordFlags = bor(dotTypeCfg.keywordFlags, KeywordFlag[damageType.."Dot"])
58635867
activeSkill["dot"..damageType.."Cfg"] = dotTypeCfg
58645868
local baseVal
5865-
if canDeal[damageType] then
5869+
if canDeal[damageType] and not noCorruptingBlood then
58665870
baseVal = skillData[damageType.."Dot"] or 0
58675871
else
58685872
baseVal = 0

‎src/Modules/ConfigOptions.lua‎

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,15 @@ return {
323323
modList:NewMod("Condition:BladestormInSandstorm", "FLAG", true, "Config", { type = "SkillName", skillName = "Bladestorm", includeTransfigured = true })
324324
end },
325325
{ label = "Bloodsoaked Banner:", ifSkill = "Bloodsoaked Banner" },
326-
{ var = "bloodsoakedBannerStages", type = "count", label = "# of Bloodsoaked Banner stacks on enemy", ifSkill = "Bloodsoaked Banner", defaultState = 1, apply = function(val, modList, enemyModList)
326+
{ var = "bloodsoakedBannerStages", type = "countAllowZero", label = "# of Bloodsoaked Banner stacks on enemy", ifSkill = "Bloodsoaked Banner", defaultState = 1, apply = function(val, modList, enemyModList)
327327
-- 10 is the maximum amount of Corrupting Blood Stages. modList does not contain skill base mods at this point so hard coding it here is the cleanest way to handle the cap.
328328
-- It's set to 9 here with val -1 to so that it defaults to 1 stage and has max 10 stages.
329-
modList:NewMod("Multiplier:BloodsoakedBannerStageAfterFirst", "BASE", m_min(val-1, 9), "Config", { type = "Condition", var = "Effective" })
329+
-- 0 stacks means the enemy has no Corrupting Blood from the banner: flag the DoT as not applied (see CalcOffence) instead of emitting a -1 multiplier.
330+
if val <= 0 then
331+
modList:NewMod("NoCorruptingBloodStacks", "FLAG", true, "Config", { type = "SkillType", skillType = SkillType.Banner }, { type = "Condition", var = "Effective" })
332+
else
333+
modList:NewMod("Multiplier:BloodsoakedBannerStageAfterFirst", "BASE", m_min(val-1, 9), "Config", { type = "Condition", var = "Effective" })
334+
end
330335
end },
331336
{ label = "Blood Sacrament:", ifSkill = "Blood Sacrament" },
332337
{ var = "bloodSacramentReservationEHP", type = "check", label = "Count Skill Reservation towards eHP?", ifSkill = "Blood Sacrament", tooltip = "Use this option to disable the skill reservation factoring into eHP calculations",apply = function(val, modList, enemyModList)
@@ -378,14 +383,19 @@ return {
378383
modList:NewMod("CooldownRecovery", "OVERRIDE", 0, "Config", { type = "SkillName", skillName = "Consecrated Path of Endurance" })
379384
end },
380385
{ label = "Corrupting Cry:", ifSkill = "Corrupting Cry" },
381-
{ var = "conditionCorruptingCryStages", type = "count", label = "# of Corrupting Cry stacks on enemy", ifSkill = "Corrupting Cry", defaultState = 1, apply = function(val, modList, enemyModList)
386+
{ var = "conditionCorruptingCryStages", type = "countAllowZero", label = "# of Corrupting Cry stacks on enemy", ifSkill = "Corrupting Cry", defaultState = 1, apply = function(val, modList, enemyModList)
382387
-- 10 is the maximum amount of Corrupting Blood Stages. modList does not contain skill base mods at this point so hard coding it here is the cleanest way to handle the cap.
383388
-- It's set to 9 here with val -1 to so that it defaults to 1 stage and has max 10 stages.
384-
modList:NewMod("Multiplier:CorruptingCryStageAfterFirst", "BASE", m_min(val-1, 9), "Config", { type = "Condition", var = "Effective" })
389+
-- 0 stacks means the enemy has no Corrupting Blood from the warcry: flag the DoT as not applied (see CalcOffence) instead of emitting a -1 multiplier.
390+
if val <= 0 then
391+
modList:NewMod("NoCorruptingBloodStacks", "FLAG", true, "Config", { type = "SkillType", skillType = SkillType.Warcry }, { type = "Condition", var = "Effective" })
392+
else
393+
modList:NewMod("Multiplier:CorruptingCryStageAfterFirst", "BASE", m_min(val-1, 9), "Config", { type = "Condition", var = "Effective" })
394+
end
385395
end },
386396
{ label = "Cruelty:", ifSkill = "Cruelty" },
387-
{ var = "overrideCruelty", type = "count", label = "Damage % (if not maximum):", ifSkill = "Cruelty", tooltip = "Cruelty is a buff provided by Cruelty Support which grants\nup to 40% more damage over time to the skills it supports.", apply = function(val, modList, enemyModList)
388-
modList:NewMod("Cruelty", "OVERRIDE", m_min(val, 40), "Config", { type = "Condition", var = "Combat" })
397+
{ var = "overrideCruelty", type = "countAllowZero", label = "Damage % (if not maximum):", ifSkill = "Cruelty", tooltip = "Cruelty is a buff provided by Cruelty Support which grants\nup to 40% more damage over time to the skills it supports.", apply = function(val, modList, enemyModList)
398+
modList:NewMod("Cruelty", "OVERRIDE", m_max(m_min(val, 40), 0), "Config", { type = "Condition", var = "Combat" })
389399
end },
390400
{ label = "Cyclone:", ifSkill = "Cyclone", includeTransfigured = true },
391401
{ var = "channellingCycloneCheck", type = "check", label = "Are you Channelling Cyclone?", ifSkill = "Cyclone", includeTransfigured = true, apply = function(val, modList, enemyModList)
@@ -492,16 +502,16 @@ return {
492502
modList:NewMod("Multiplier:HexDoomStack", "BASE", val, "Config")
493503
end },
494504
{ label = "Herald of Agony:", ifSkill = "Herald of Agony" },
495-
{ var = "heraldOfAgonyVirulenceStack", type = "count", label = "# of Virulence Stacks:", ifSkill = "Herald of Agony", apply = function(val, modList, enemyModList)
496-
modList:NewMod("Multiplier:VirulenceStack", "BASE", val, "Config")
505+
{ var = "heraldOfAgonyVirulenceStack", type = "countAllowZero", label = "# of Virulence Stacks:", ifSkill = "Herald of Agony", apply = function(val, modList, enemyModList)
506+
modList:NewMod("Multiplier:VirulenceStack", "BASE", m_max(val, 0), "Config")
497507
end },
498508
{ label = "Herald of Ash:", ifSkill = "Herald of Ash" },
499-
{ var = "hoaOverkill", type = "count", label = "Overkill damage:", tooltip = "Herald of Ash's base ^xB97123Burning ^7damage is equal to 25% of Overkill damage.", ifSkill = "Herald of Ash", apply = function(val, modList, enemyModList)
500-
modList:NewMod("SkillData", "LIST", { key = "hoaOverkill", value = val }, "Config", { type = "SkillName", skillName = "Herald of Ash" })
509+
{ var = "hoaOverkill", type = "countAllowZero", label = "Overkill damage:", tooltip = "Herald of Ash's base ^xB97123Burning ^7damage is equal to 25% of Overkill damage.", ifSkill = "Herald of Ash", apply = function(val, modList, enemyModList)
510+
modList:NewMod("SkillData", "LIST", { key = "hoaOverkill", value = m_max(val, 0) }, "Config", { type = "SkillName", skillName = "Herald of Ash" })
501511
end },
502512
{ label = "Herald of the Hive:", ifSkill = "Herald of the Hive" },
503-
{ var = "heraldOfTheHivePressure", type = "count", label = "# of Otherworldly Pressure Stacks:", ifSkill = "Herald of the Hive", apply = function(val, modList, enemyModList)
504-
modList:NewMod("Multiplier:OtherworldlyPressure", "BASE", val, "Config")
513+
{ var = "heraldOfTheHivePressure", type = "countAllowZero", label = "# of Otherworldly Pressure Stacks:", ifSkill = "Herald of the Hive", apply = function(val, modList, enemyModList)
514+
modList:NewMod("Multiplier:OtherworldlyPressure", "BASE", m_max(val, 0), "Config")
505515
end },
506516
{ label = "Invention:", ifSkill = "Invention" },
507517
{ var = "inventionMineTrapPlacedDuration", type = "count", label = "Placed duration of Mine / Traps:", ifSkill = "Invention", apply = function(val, modList, enemyModList)

0 commit comments

Comments
 (0)