Skip to content

Commit 063f09b

Browse files
vaisestLocalIdentity
andauthored
Fix Rathpith magnitude of Ailments per 100 Life not scaling Ailments properly (#2364)
* Fix rathpith per 100 life shock mod * Fix Bleed mod not getting scales In PR #1034 I changed the handling of the Rathpith mods so that they used ModFlag.Spell instead of Keyword flag That broke the handling of the ailments line though as it uses dotCfg and we specifically strip out the ModFlag.Spell from it so it doesn't get scaled by spell damage. This also stopped the Ailment mod from working though I made it use it's own full parsed line to be simpler and still use KeywordFlag so that the interaction works and the breakdown does too Also added a case so we don't accidentally break this down the line --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 5353b82 commit 063f09b

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

spec/System/TestSkills_spec.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,19 @@ describe("TestSkills", function()
894894
assert.True(avgDPS < lightningDPS)
895895
end)
896896

897+
it("scales spell bleed magnitude from maximum Life", function()
898+
build.configTab.input.customMods = [[
899+
+5000 to maximum Life
900+
100% chance to inflict Bleeding on Hit
901+
Non-Channelling Spells have 3% increased Magnitude of Ailments per 100 maximum Life
902+
]]
903+
build.configTab:BuildModList()
904+
build.skillsTab:PasteSocketGroup("Unearth 20/0 1")
905+
runCallback("OnFrame")
906+
907+
assert.are.equals(1 + math.floor(build.calcsTab.mainOutput.Life / 100) * 0.03, build.calcsTab.mainOutput.BleedMagnitudeEffect)
908+
end)
909+
897910
it("Test flicker strike scales with power charges", function()
898911
build.skillsTab:PasteSocketGroup("Flicker Strike 20/0 1")
899912
build.itemsTab:CreateDisplayItemFromRaw([[

src/Modules/CalcPerform.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,6 +3241,9 @@ function calcs.perform(env, skipEHP)
32413241
},
32423242
}
32433243

3244+
-- precalculate life for rathpith Spells have 3% increased Magnitude of Ailments per 100 maximum
3245+
-- Life cultivated mod
3246+
calcs.doActorLifeManaSpirit(env.player, true)
32443247
local hitFlag
32453248
if env.mode == "CALCS" then
32463249
hitFlag = env.player.mainSkill.activeEffect.statSetCalcs.skillFlags.hit
@@ -3265,9 +3268,9 @@ function calcs.perform(env, skipEHP)
32653268
-- if not, use the generic modifiers
32663269
-- Scorch/Sap/Brittle do not have guaranteed sources from hits, and therefore will only end up in this bit of code if it's not supposed to apply the skillModList, which is bad
32673270
if ailment ~= "Scorch" and ailment ~= "Sap" and ailment ~= "Brittle" and not env.player.mainSkill.skillModList:Flag(nil, "Cannot"..ailment) and hitFlag and modDB:Flag(nil, "ChecksHighestDamage") then
3268-
effect = effect * calcLib.mod(env.player.mainSkill.skillModList, env.player.mainSkill.skillModList.skillCfg, "Enemy"..ailment.."Magnitude", "AilmentMagnitude") * calcLib.mod(enemyDB, nil, "Self"..ailment.."Magnitude", "AilmentMagnitude")
3271+
effect = effect * calcLib.mod(env.player.mainSkill.skillModList, env.player.mainSkill.skillCfg, "Enemy" .. ailment .. "Magnitude", "AilmentMagnitude") * calcLib.mod(enemyDB, nil, "Self" .. ailment .. "Magnitude", "AilmentMagnitude")
32693272
else
3270-
effect = effect * calcLib.mod(env.player.mainSkill.skillModList, env.player.mainSkill.skillModList.skillCfg, "Enemy"..ailment.."Magnitude", "AilmentMagnitude") * calcLib.mod(enemyDB, nil, "Self"..ailment.."Magnitude", "AilmentMagnitude")
3273+
effect = effect * calcLib.mod(env.player.mainSkill.skillModList, env.player.mainSkill.skillCfg, "Enemy" .. ailment .. "Magnitude", "AilmentMagnitude") * calcLib.mod(enemyDB, nil, "Self" .. ailment .. "Magnitude", "AilmentMagnitude")
32713274
end
32723275
modDB:NewMod(ailment.."Override", "BASE", effect, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
32733276
if mod.name == ailment.."Minimum" then

src/Modules/ModParser.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3821,6 +3821,8 @@ local specialModList = {
38213821
mod("EnemyModifier", "LIST", { mod = mod("DamageTaken", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "Poisoned" }),
38223822
mod("EnemyModifier", "LIST", { mod = mod("DamageTaken", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "Electrocuted" }),
38233823
} end,
3824+
["non%-channelling spells have (%d+)%% increased magnitude of ailments per (%d+) maximum life"] = function(num, _, div) return { mod("AilmentMagnitude", "INC", num, nil, 0, KeywordFlag.Spell, { type = "SkillType", skillType = SkillType.Channel, neg = true }, { type = "PerStat", stat = "Life", div = tonumber(div) }) } end,
3825+
["non%-channelling spells have (%d+)%% reduced magnitude of ailments per (%d+) maximum life"] = function(num, _, div) return { mod("AilmentMagnitude", "INC", -num, nil, 0, KeywordFlag.Spell, { type = "SkillType", skillType = SkillType.Channel, neg = true }, { type = "PerStat", stat = "Life", div = tonumber(div) }) } end,
38243826
-- Elemental Ailments
38253827
["enemies take (%d+)%% increased damage for each elemental ailment type among your ailments on them"] = function(num) return {
38263828
mod("EnemyModifier", "LIST", { mod = mod("DamageTaken", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "Frozen" }),

0 commit comments

Comments
 (0)