Skip to content
Closed
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
13 changes: 12 additions & 1 deletion spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ describe("TestSkills", function()
assert.True(baseLeapSlamHit < build.calcsTab.mainOutput.AverageDamage)
end)

it("Test maximum Rage can use the highest weapon set cap", function()
build.configTab.input.multiplierRage = 48
build.configTab:BuildModList()
build.configTab.modList:NewMod("Condition:CanGainRage", "FLAG", true, "Test")
build.configTab.modList:NewMod("MaximumRage", "BASE", 18, "Weapon Set 2 Test", { type = "Condition", var = "WeaponSet2" })
runCallback("OnFrame")

assert.are.equals(48, build.calcsTab.mainOutput.MaximumRage)
assert.are.equals(48, build.calcsTab.mainOutput.Rage)
end)

it("Test stacking persistent buff supports of same category", function()
build.skillsTab:PasteSocketGroup("Arctic Armour 20/0 1\nClarity I 1/0 1")
build.skillsTab:PasteSocketGroup("Time of Need 20/0 1\nClarity II 1/0 1")
Expand Down Expand Up @@ -245,4 +256,4 @@ describe("TestSkills", function()

assert.True(build.calcsTab.calcsOutput.Cooldown == 10)
end)
end)
end)
17 changes: 16 additions & 1 deletion src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,21 @@ local function doActorMisc(env, actor)
local output = actor.output
local condList = modDB.conditions

local function getMaximumRageWithWeaponSetCaps(baseCfg)
local maxStacks = modDB:Sum("BASE", baseCfg, "MaximumRage")
if actor == env.player then
for weaponSet = 1, 2 do
local weaponSetCfg = baseCfg and copyTable(baseCfg) or { }
weaponSetCfg.overrideCond = setmetatable({
WeaponSet1 = weaponSet == 1,
WeaponSet2 = weaponSet == 2,
}, { __index = baseCfg and baseCfg.overrideCond })
maxStacks = m_max(maxStacks, modDB:Sum("BASE", weaponSetCfg, "MaximumRage"))
end
end
return maxStacks
end

-- Add misc buffs/debuffs
if env.mode_combat then
if env.player.mainSkill.baseSkillModList:Flag(nil, "Cruelty") then
Expand Down Expand Up @@ -665,7 +680,7 @@ local function doActorMisc(env, actor)
condList["LeechingEnergyShield"] = true
end
if modDB:Flag(nil, "Condition:CanGainRage") or modDB:Sum("BASE", nil, "RageRegen") > 0 then
local maxStacks = modDB:Sum("BASE", skillCfg, "MaximumRage")
local maxStacks = getMaximumRageWithWeaponSetCaps(skillCfg)
local minStacks = m_min(modDB:Sum("BASE", nil, "MinimumRage"), maxStacks)
local rageConfig = modDB:Sum("BASE", nil, "Multiplier:RageStack")
local stacks = m_max(m_min(rageConfig, maxStacks), (minStacks > 0 and minStacks) or 0)
Expand Down