diff --git a/spec/System/TestItemMods_spec.lua b/spec/System/TestItemMods_spec.lua index cd2a069d65..895b225524 100644 --- a/spec/System/TestItemMods_spec.lua +++ b/spec/System/TestItemMods_spec.lua @@ -313,6 +313,16 @@ describe("TetsItemMods", function() runCallback("OnFrame") end) + it("negative limit mods after scaling", function() + local baseModList = new("ModList") + local scaledModList = new("ModList") + baseModList:NewMod("EnemyAilmentThreshold", "INC", -35, "Test", 0, 0, { type = "Limit", limit = 90, neg = true }) + + scaledModList:ScaleAddList(baseModList, 4) + + assert.are.equals(-90, scaledModList:Sum("INC", nil, "EnemyAilmentThreshold")) + end) + it("Jarngreipr - strength satisfies melee weapons and skills", function() build.configTab.input.customMods = "+1000 Strength" build.configTab:BuildModList() diff --git a/src/Classes/CalcBreakdownControl.lua b/src/Classes/CalcBreakdownControl.lua index c9bac2b4a6..2792907444 100644 --- a/src/Classes/CalcBreakdownControl.lua +++ b/src/Classes/CalcBreakdownControl.lua @@ -490,7 +490,11 @@ function CalcBreakdownClass:AddModSection(sectionData, modList) elseif tag.type == "GlobalEffect" then desc = self:FormatModName(tag.effectType) elseif tag.type == "Limit" then - desc = "Limited to "..(tag.limitVar and self:FormatModName(tag.limitVar) or self:FormatModBase(row.mod, tag.limit)) + if tag.neg then + desc = "Limited to "..(tag.limitVar and "-"..self:FormatModName(tag.limitVar) or self:FormatModBase(row.mod, -tag.limit)) + else + desc = "Limited to "..(tag.limitVar and self:FormatModName(tag.limitVar) or self:FormatModBase(row.mod, tag.limit)) + end elseif tag.type == "MonsterTag" then desc = "Monster Tag: "..(tag.monsterTagList and table.concat(tag.monsterTagList, "/") or tag.monsterTag) else diff --git a/src/Classes/ModStore.lua b/src/Classes/ModStore.lua index ae2a41db2b..972c783749 100644 --- a/src/Classes/ModStore.lua +++ b/src/Classes/ModStore.lua @@ -592,7 +592,8 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits) end end elseif tag.type == "Limit" then - value = m_min(value, tag.limit or GetMultiplier(self, tag.limitVar, cfg)) + local limit = tag.limit or GetMultiplier(self, tag.limitVar, cfg) + value = tag.neg and m_max(value, -limit) or m_min(value, limit) elseif tag.type == "Condition" then local match = false 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) diff --git a/src/Data/SkillStatMap.lua b/src/Data/SkillStatMap.lua index c66490984c..b59ed904b2 100644 --- a/src/Data/SkillStatMap.lua +++ b/src/Data/SkillStatMap.lua @@ -1232,10 +1232,10 @@ return { }, -- Ailments ["skill_overwhelming_pressure_aura_enemy_ailment_threshold_+%"] = { - mod("EnemyAilmentThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence"}), + mod("EnemyAilmentThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence" }, { type = "Limit", limit = 90, neg = true }), }, ["skill_overwhelming_pressure_aura_enemy_stun_threshold_+%"] = { - mod("EnemyStunThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence"}), + mod("EnemyStunThreshold", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "AuraDebuff", effectName = "Overwhelming Presence" }, { type = "Limit", limit = 90, neg = true }), }, ["bleed_on_hit_with_attacks_%"] = { mod("BleedChance", "BASE", nil, ModFlag.Attack),