Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions spec/System/TestItemMods_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion src/Classes/CalcBreakdownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/Data/SkillStatMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading