Skip to content

Commit a09659e

Browse files
author
LocalIdentity
committed
Fix Overwhelming Presence not limiting to 90%
Added support for limiting the mod to 90% Had to add support for negative value limiting
1 parent 16656fc commit a09659e

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

spec/System/TestItemMods_spec.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,16 @@ describe("TetsItemMods", function()
313313
runCallback("OnFrame")
314314
end)
315315

316+
it("negative limit mods after scaling", function()
317+
local baseModList = new("ModList")
318+
local scaledModList = new("ModList")
319+
baseModList:NewMod("EnemyAilmentThreshold", "INC", -35, "Test", 0, 0, { type = "Limit", limit = 90, neg = true })
320+
321+
scaledModList:ScaleAddList(baseModList, 4)
322+
323+
assert.are.equals(-90, scaledModList:Sum("INC", nil, "EnemyAilmentThreshold"))
324+
end)
325+
316326
it("Jarngreipr - strength satisfies melee weapons and skills", function()
317327
build.configTab.input.customMods = "+1000 Strength"
318328
build.configTab:BuildModList()

src/Classes/CalcBreakdownControl.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,11 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
490490
elseif tag.type == "GlobalEffect" then
491491
desc = self:FormatModName(tag.effectType)
492492
elseif tag.type == "Limit" then
493-
desc = "Limited to "..(tag.limitVar and self:FormatModName(tag.limitVar) or self:FormatModBase(row.mod, tag.limit))
493+
if tag.neg then
494+
desc = "Limited to "..(tag.limitVar and "-"..self:FormatModName(tag.limitVar) or self:FormatModBase(row.mod, -tag.limit))
495+
else
496+
desc = "Limited to "..(tag.limitVar and self:FormatModName(tag.limitVar) or self:FormatModBase(row.mod, tag.limit))
497+
end
494498
elseif tag.type == "MonsterTag" then
495499
desc = "Monster Tag: "..(tag.monsterTagList and table.concat(tag.monsterTagList, "/") or tag.monsterTag)
496500
else

src/Classes/ModStore.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
592592
end
593593
end
594594
elseif tag.type == "Limit" then
595-
value = m_min(value, tag.limit or GetMultiplier(self, tag.limitVar, cfg))
595+
local limit = tag.limit or GetMultiplier(self, tag.limitVar, cfg)
596+
value = tag.neg and m_max(value, -limit) or m_min(value, limit)
596597
elseif tag.type == "Condition" then
597598
local match = false
598599
local allOneH = ((self.actor.weaponData1 and self.actor.weaponData1.countsAsAll1H) and self.actor.weaponData1) or ((self.actor.weaponData2 and self.actor.weaponData2.countsAsAll1H) and self.actor.weaponData2)

src/Data/SkillStatMap.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,10 +1232,10 @@ return {
12321232
},
12331233
-- Ailments
12341234
["skill_overwhelming_pressure_aura_enemy_ailment_threshold_+%"] = {
1235-
mod("EnemyAilmentThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence"}),
1235+
mod("EnemyAilmentThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence" }, { type = "Limit", limit = 90, neg = true }),
12361236
},
12371237
["skill_overwhelming_pressure_aura_enemy_stun_threshold_+%"] = {
1238-
mod("EnemyStunThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence"}),
1238+
mod("EnemyStunThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence" }, { type = "Limit", limit = 90, neg = true }),
12391239
},
12401240
["bleed_on_hit_with_attacks_%"] = {
12411241
mod("BleedChance", "BASE", nil, ModFlag.Attack),

0 commit comments

Comments
 (0)