From 361c944fb2244d3557c4f185110e4229d928be66 Mon Sep 17 00:00:00 2001 From: cupkax Date: Mon, 24 Aug 2026 23:26:56 +1000 Subject: [PATCH 1/3] Fix Mana-infused staff being able to be supported by arrogance --- src/Modules/CalcTools.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Modules/CalcTools.lua b/src/Modules/CalcTools.lua index 3c17791bc5..fdd6c09a11 100644 --- a/src/Modules/CalcTools.lua +++ b/src/Modules/CalcTools.lua @@ -91,6 +91,11 @@ function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill, return false end + -- Mana-Infused Staff cannot be supported by Arrogance in game + if grantedEffect.id == "SupportArrogance" and activeSkill.activeEffect.grantedEffect.id == "ManaInfusedStaff" then + return false + end + -- Special case for things like Forbidden Shako or Hungry Loop with for example Prismatic Burst and another compatible support if not appliesToGrantedSkills and grantedEffect.fromItem and grantedEffect.support and (activeSkill.activeEffect.grantedEffect.fromItem or activeSkill.activeEffect.grantedEffect.modSource:sub(1, #"Item") == "Item" or (activeSkill.activeEffect.srcInstance and activeSkill.activeEffect.srcInstance.fromItem)) then return false From f23669eaabc18d9d87fba12ac054620365c5cfab Mon Sep 17 00:00:00 2001 From: cupkax Date: Mon, 24 Aug 2026 23:45:30 +1000 Subject: [PATCH 2/3] Prevent life reservation for mana-infused staff --- src/Modules/CalcPerform.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index 77b61b3971..f4ee530dab 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -1968,7 +1968,14 @@ function calcs.perform(env, skipEHP) breakdown.ManaReserved = { reservations = { } } end for _, activeSkill in ipairs(env.player.activeSkillList) do - if (activeSkill.skillTypes[SkillType.HasReservation] or activeSkill.skillData.triggeredByAutoexertion ) and not activeSkill.skillTypes[SkillType.ReservationBecomesCost] then + -- Mana-Infused Staff does nothing unless it actually reserves mana + local noManaReservation = activeSkill.activeEffect.grantedEffect.id == "ManaInfusedStaff" + and (activeSkill.skillModList:Flag(activeSkill.skillCfg, "BloodMagicReserved") or (output.Mana or 0) == 0) + if noManaReservation then + activeSkill.skillFlags.disable = true + activeSkill.disableReason = "This skill requires reserving Mana" + end + if (activeSkill.skillTypes[SkillType.HasReservation] or activeSkill.skillData.triggeredByAutoexertion ) and not activeSkill.skillTypes[SkillType.ReservationBecomesCost] and not noManaReservation then local skillModList = activeSkill.skillModList local skillCfg = activeSkill.skillCfg local mult = floor(skillModList:More(skillCfg, "SupportManaMultiplier"), 4) From 294bb4c825494c18e631fc75335cbc86db4b67b8 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Wed, 26 Aug 2026 22:35:28 +1000 Subject: [PATCH 3/3] Simplify implementation --- spec/System/TestSkills_spec.lua | 23 +++++++++++++++++++++++ src/Modules/CalcPerform.lua | 15 ++++++--------- src/Modules/CalcTools.lua | 5 ----- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/spec/System/TestSkills_spec.lua b/spec/System/TestSkills_spec.lua index 92e2a3a868..5359edf503 100644 --- a/spec/System/TestSkills_spec.lua +++ b/spec/System/TestSkills_spec.lua @@ -89,6 +89,29 @@ describe("TestSkills", function() assert.True(build.calcsTab.mainOutput.MirageDPS ~= nil) end) + + it("keeps forced mana reservations on mana", function() + build.itemsTab:CreateDisplayItemFromRaw("Test Staff\nJudgement Staff") + build.itemsTab:AddDisplayItem() + build.skillsTab:PasteSocketGroup("Mana-Infused Staff 20/0 1\nArrogance 20/0 1\n") + runCallback("OnFrame") + + local activeSkill = build.calcsTab.mainEnv.player.mainSkill + assert.are.equals("SupportArrogance", activeSkill.effectList[2].grantedEffect.id) + assert.is_nil(activeSkill.skillFlags.disable) + assert.are.equals(30, build.calcsTab.mainEnv.player.output.ManaReservedPercent) + assert.are.equals(0, build.calcsTab.mainEnv.player.output.LifeReserved) + + build.configTab.input.customMods = "Removes all mana\nSkills Reserve Life instead of Mana" + build.configTab:BuildModList() + runCallback("OnFrame") + + activeSkill = build.calcsTab.mainEnv.player.mainSkill + assert.is_true(activeSkill.skillFlags.disable) + assert.are.equals("This skill requires reserving Mana", activeSkill.disableReason) + assert.are.equals(0, activeSkill.skillData.ManaReservedBase) + assert.is_nil(activeSkill.skillData.LifeReservedBase) + end) it("Test Scorching ray applying exposure at max stages", function() build.skillsTab:PasteSocketGroup("Scorching Ray 20/0 1\n") diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index f4ee530dab..3276bdc175 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -1968,14 +1968,7 @@ function calcs.perform(env, skipEHP) breakdown.ManaReserved = { reservations = { } } end for _, activeSkill in ipairs(env.player.activeSkillList) do - -- Mana-Infused Staff does nothing unless it actually reserves mana - local noManaReservation = activeSkill.activeEffect.grantedEffect.id == "ManaInfusedStaff" - and (activeSkill.skillModList:Flag(activeSkill.skillCfg, "BloodMagicReserved") or (output.Mana or 0) == 0) - if noManaReservation then - activeSkill.skillFlags.disable = true - activeSkill.disableReason = "This skill requires reserving Mana" - end - if (activeSkill.skillTypes[SkillType.HasReservation] or activeSkill.skillData.triggeredByAutoexertion ) and not activeSkill.skillTypes[SkillType.ReservationBecomesCost] and not noManaReservation then + if (activeSkill.skillTypes[SkillType.HasReservation] or activeSkill.skillData.triggeredByAutoexertion ) and not activeSkill.skillTypes[SkillType.ReservationBecomesCost] and not activeSkill.skillFlags.disable then local skillModList = activeSkill.skillModList local skillCfg = activeSkill.skillCfg local mult = floor(skillModList:More(skillCfg, "SupportManaMultiplier"), 4) @@ -1990,7 +1983,7 @@ function calcs.perform(env, skipEHP) pool.Life.baseFlat = skillModList:Sum("BASE", skillCfg, "LifeCostBase") + (activeSkill.activeEffect.grantedEffectLevel.cost.Life or 0) end pool.Life.basePercent = activeSkill.skillData.lifeReservationPercent or activeSkill.activeEffect.grantedEffectLevel.lifeReservationPercent or 0 - if skillModList:Flag(skillCfg, "BloodMagicReserved") then + if skillModList:Flag(skillCfg, "BloodMagicReserved") and not activeSkill.skillData.ManaReservationPercentForced then pool.Life.baseFlat = pool.Life.baseFlat + pool.Mana.baseFlat pool.Mana.baseFlat = 0 activeSkill.skillData["LifeReservationFlatForced"] = activeSkill.skillData["ManaReservationFlatForced"] @@ -2080,6 +2073,10 @@ function calcs.perform(env, skipEHP) env.player["uncancellable_"..name.."Reservation"] = env.player["uncancellable_"..name.."Reservation"] + values.reservedPercent end end + if activeSkill.skillData.ManaReservationPercentForced and activeSkill.skillData.ManaReservedBase == 0 then + activeSkill.skillFlags.disable = true + activeSkill.disableReason = "This skill requires reserving Mana" + end end end diff --git a/src/Modules/CalcTools.lua b/src/Modules/CalcTools.lua index fdd6c09a11..3c17791bc5 100644 --- a/src/Modules/CalcTools.lua +++ b/src/Modules/CalcTools.lua @@ -91,11 +91,6 @@ function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill, return false end - -- Mana-Infused Staff cannot be supported by Arrogance in game - if grantedEffect.id == "SupportArrogance" and activeSkill.activeEffect.grantedEffect.id == "ManaInfusedStaff" then - return false - end - -- Special case for things like Forbidden Shako or Hungry Loop with for example Prismatic Burst and another compatible support if not appliesToGrantedSkills and grantedEffect.fromItem and grantedEffect.support and (activeSkill.activeEffect.grantedEffect.fromItem or activeSkill.activeEffect.grantedEffect.modSource:sub(1, #"Item") == "Item" or (activeSkill.activeEffect.srcInstance and activeSkill.activeEffect.srcInstance.fromItem)) then return false