Skip to content

Commit 5bdfa3e

Browse files
Refactored wither to apply strongest wither effect (#4525)
Fixes #4101
1 parent 7ef2e0f commit 5bdfa3e

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/Modules/CalcPerform.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,11 @@ local function doActorMisc(env, actor)
967967
modDB:NewMod("AvoidChaosDamageChance", "BASE", m_floor(15 * effect), "Elusive")
968968
modDB:NewMod("MovementSpeed", "INC", m_floor(30 * effect), "Elusive")
969969
end
970+
if modDB:Max(nil, "WitherEffectStack") then
971+
modDB:NewMod("Condition:CanWither", "FLAG", true, "Config")
972+
local effect = modDB:Max(nil, "WitherEffectStack")
973+
enemyDB:NewMod("ChaosDamageTaken", "INC", effect, "Withered", { type = "Multiplier", var = "WitheredStack", limit = 15 } )
974+
end
970975
if modDB:Flag(nil, "Blind") then
971976
if not modDB:Flag(nil, "IgnoreBlindHitChance") then
972977
local effect = 1 + modDB:Sum("INC", nil, "BlindEffect", "BuffEffectOnSelf") / 100
@@ -1232,14 +1237,9 @@ function calcs.perform(env, avoidCache)
12321237
end
12331238
end
12341239
end
1235-
if activeSkill.skillModList:Flag(nil, "Condition:CanWither") and not modDB:Flag(nil, "AlreadyWithered") then
1236-
modDB:NewMod("Condition:CanWither", "FLAG", true, "Config")
1240+
if activeSkill.skillModList:Flag(nil, "Condition:CanWither") then
12371241
local effect = activeSkill.minion and 6 or m_floor(6 * (1 + modDB:Sum("INC", nil, "WitherEffect") / 100))
1238-
enemyDB:NewMod("ChaosDamageTaken", "INC", effect, "Withered", { type = "Multiplier", var = "WitheredStack", limit = 15 } )
1239-
if modDB:Flag(nil, "Condition:CanElementalWithered") then
1240-
enemyDB:NewMod("ElementalDamageTaken", "INC", 4, "Withered", ModFlag.Hit, { type = "Multiplier", var = "WitheredStack", limit = 15 } )
1241-
end
1242-
modDB:NewMod("AlreadyWithered", "FLAG", true, "Config") -- Prevents effect from applying multiple times
1242+
modDB:NewMod("WitherEffectStack", "MAX", effect)
12431243
end
12441244
if activeSkill.skillFlags.warcry and not modDB:Flag(nil, "AlreadyGlobalWarcryCooldown") then
12451245
local cooldown = calcSkillCooldown(activeSkill.skillModList, activeSkill.skillCfg, activeSkill.skillData)

src/Modules/ModParser.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,8 +2596,7 @@ local specialModList = {
25962596
["(%d+)%% chance to inflict withered for (%d+) seconds on hit with this weapon"] = { flag("Condition:CanWither") },
25972597
["(%d+)%% chance to inflict withered for two seconds on hit if there are (%d+) or fewer withered debuffs on enemy"] = { flag("Condition:CanWither") },
25982598
["inflict withered for (%d+) seconds on hit with this weapon"] = { flag("Condition:CanWither") },
2599-
["enemies take (%d+)%% increased elemental damage from your hits for"] = { flag("Condition:CanElementalWithered") },
2600-
["each withered you have inflicted on them"] = { },
2599+
["enemies take (%d+)%% increased elemental damage from your hits for each withered you have inflicted on them"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("ElementalDamageTaken", "INC", num, { type = "Multiplier", var = "WitheredStack" }) }) } end,
26012600
["your hits cannot penetrate or ignore elemental resistances"] = { flag("CannotElePenIgnore") },
26022601
["nearby enemies have malediction"] = { mod("EnemyModifier", "LIST", { mod = flag("HasMalediction") }) },
26032602
["elemental damage you deal with hits is resisted by lowest elemental resistance instead"] = { flag("ElementalDamageUsesLowestResistance") },

0 commit comments

Comments
 (0)