From 3f4550f6e22bee6a4f377480d1a1949adf68e5f5 Mon Sep 17 00:00:00 2001 From: unrealdreamz <132005717+unrealdreamz@users.noreply.github.com> Date: Mon, 18 May 2026 20:38:13 -0400 Subject: [PATCH] Use highest weapon set maximum Rage cap --- spec/System/TestSkills_spec.lua | 13 ++++++++++++- src/Modules/CalcPerform.lua | 17 ++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/spec/System/TestSkills_spec.lua b/spec/System/TestSkills_spec.lua index 3afa41ce0..8d641effb 100644 --- a/spec/System/TestSkills_spec.lua +++ b/spec/System/TestSkills_spec.lua @@ -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") @@ -245,4 +256,4 @@ describe("TestSkills", function() assert.True(build.calcsTab.calcsOutput.Cooldown == 10) end) -end) \ No newline at end of file +end) diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index 29e111f29..c248c2184 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -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 @@ -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)