From c9f73b60d052772a5001389352a5d7d61e3afaba Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Tue, 28 Jul 2026 21:15:24 +1000 Subject: [PATCH] Fix Communion Support counting temporary minions Now only counts minions that have the permanentMinion skillFlag Now stat map the infinite duration stat to grant the `permanentMinion` flag --- spec/System/TestOffence_spec.lua | 20 ++++++++++++++++++++ src/Data/SkillStatMap.lua | 3 +++ src/Data/Skills/sup_int.lua | 4 ++-- src/Export/Skills/sup_int.txt | 4 ++-- src/Modules/CalcPerform.lua | 6 ++++++ src/Modules/ConfigOptions.lua | 3 +++ 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/spec/System/TestOffence_spec.lua b/spec/System/TestOffence_spec.lua index 36b67ddc53..0e8066f900 100644 --- a/spec/System/TestOffence_spec.lua +++ b/spec/System/TestOffence_spec.lua @@ -13,6 +13,26 @@ describe("TestOffence", function() string.format("%s: expected ~%.2f (within %.1f%%), got %.2f", msg, expected, tolerance * 100, actual)) end + it("counts only permanent minions for Communion", function() + build.skillsTab:PasteSocketGroup("Fireball 20/0 1\nCommunion 3/0 1") + build.skillsTab:PasteSocketGroup("Summon Reaper 20/0 1") + build.skillsTab:PasteSocketGroup("Summon Raging Spirit 20/0 1") + runCallback("OnFrame") + + local modDB = build.calcsTab.calcsEnv.player.modDB + assert.is_true(modDB:Sum("BASE", nil, "Multiplier:SummonedMinion") > 1) + assert.are.equals(1, modDB:Sum("BASE", nil, "Multiplier:PermanentMinion")) + assert.is_true(build.calcsTab.calcsOutput.PhysicalMin > 0) + + newBuild() + build.skillsTab:PasteSocketGroup("Fireball 20/0 1\nCommunion 3/0 1") + build.skillsTab:PasteSocketGroup("Summon Raging Spirit 20/0 1") + runCallback("OnFrame") + + assert.are.equals(0, build.calcsTab.calcsEnv.player.modDB:Sum("BASE", nil, "Multiplier:PermanentMinion")) + assert.are.equals(0, build.calcsTab.calcsOutput.PhysicalMin or 0) + end) + it("parses more/less/increased/reduced minimum and maximum damage of every type", function() build.itemsTab:CreateDisplayItemFromRaw([[ New Item diff --git a/src/Data/SkillStatMap.lua b/src/Data/SkillStatMap.lua index 795acd976c..d65129f608 100644 --- a/src/Data/SkillStatMap.lua +++ b/src/Data/SkillStatMap.lua @@ -21,6 +21,9 @@ return { skill("durationTertiary", nil), div = 1000, }, +["infinite_minion_duration"] = { + skillFlag = "permanentMinion", +}, ["spell_minimum_base_physical_damage"] = { skill("PhysicalMin", nil), }, diff --git a/src/Data/Skills/sup_int.lua b/src/Data/Skills/sup_int.lua index 6b41387e98..8f6bcc7b02 100644 --- a/src/Data/Skills/sup_int.lua +++ b/src/Data/Skills/sup_int.lua @@ -4995,10 +4995,10 @@ skills["SupportMinionPact"] = { statDescriptionScope = "gem_stat_descriptions", statMap = { ["spell_minimum_added_physical_damage_per_active_permanent_minion"] = { - mod("PhysicalMin", "BASE", nil, 0, 0, { type = "Multiplier", var = "SummonedMinion" }), + mod("PhysicalMin", "BASE", nil, 0, 0, { type = "Multiplier", var = "PermanentMinion" }), }, ["spell_maximum_added_physical_damage_per_active_permanent_minion"] = { - mod("PhysicalMax", "BASE", nil, 0, 0, { type = "Multiplier", var = "SummonedMinion" }), + mod("PhysicalMax", "BASE", nil, 0, 0, { type = "Multiplier", var = "PermanentMinion" }), }, }, qualityStats = { diff --git a/src/Export/Skills/sup_int.txt b/src/Export/Skills/sup_int.txt index 8c23944f72..f69e71fd77 100644 --- a/src/Export/Skills/sup_int.txt +++ b/src/Export/Skills/sup_int.txt @@ -668,10 +668,10 @@ local skills, mod, flag, skill = ... #skill SupportMinionPact statMap = { ["spell_minimum_added_physical_damage_per_active_permanent_minion"] = { - mod("PhysicalMin", "BASE", nil, 0, 0, { type = "Multiplier", var = "SummonedMinion" }), + mod("PhysicalMin", "BASE", nil, 0, 0, { type = "Multiplier", var = "PermanentMinion" }), }, ["spell_maximum_added_physical_damage_per_active_permanent_minion"] = { - mod("PhysicalMax", "BASE", nil, 0, 0, { type = "Multiplier", var = "SummonedMinion" }), + mod("PhysicalMax", "BASE", nil, 0, 0, { type = "Multiplier", var = "PermanentMinion" }), }, }, #mods diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index f70d31ff8f..4758820317 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -1414,6 +1414,9 @@ function calcs.perform(env, skipEHP) if not activeSkill.skillTypes[SkillType.Vaal] then counts.nonVaal = m_max(count, counts.nonVaal or 0) end + if activeSkill.skillFlags.permanentMinion then + counts.permanent = m_max(count, counts.permanent or 0) + end minionCounts[key] = counts end end @@ -1455,6 +1458,9 @@ function calcs.perform(env, skipEHP) if counts.nonVaal then modDB:NewMod("Multiplier:NonVaalSummonedMinion", "BASE", counts.nonVaal, "Config", { type = "Condition", var = "Combat" }) end + if counts.permanent then + modDB:NewMod("Multiplier:PermanentMinion", "BASE", counts.permanent, "Config", { type = "Condition", var = "Combat" }) + end end -- Companionship only works while exactly one Minion is summoned. diff --git a/src/Modules/ConfigOptions.lua b/src/Modules/ConfigOptions.lua index 3f99f89b3d..c3045ef923 100644 --- a/src/Modules/ConfigOptions.lua +++ b/src/Modules/ConfigOptions.lua @@ -1126,6 +1126,9 @@ Huge sets the radius to 11. { var = "multiplierNonVaalSummonedMinion", type = "count", label = "# of non-vaal skill Summoned Minions:", ifMult = "NonVaalSummonedMinion", tooltip = "Use this to override the count if you do not have all your minions summoned", apply = function(val, modList, enemyModList) modList:NewMod("Multiplier:NonVaalSummonedMinion", "OVERRIDE", val, "Config", { type = "Condition", var = "Combat" }) end }, + { var = "multiplierPermanentMinion", type = "count", label = "# of Permanent Minions (if not maximum):", ifMult = "PermanentMinion", tooltip = "Use this to override the count if you do not have all your permanent minions summoned", apply = function(val, modList, enemyModList) + modList:NewMod("Multiplier:PermanentMinion", "OVERRIDE", val, "Config", { type = "Condition", var = "Combat" }) + end }, { var = "conditionOnConsecratedGround", type = "check", label = "Are you on Consecrated Ground?", tooltip = "In addition to allowing any 'while on Consecrated Ground' modifiers to apply,\nConsecrated Ground grants 5% ^xE05030Life ^7Regeneration to players and allies.", apply = function(val, modList, enemyModList) modList:NewMod("Condition:OnConsecratedGround", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) modList:NewMod("MinionModifier", "LIST", { mod = modLib.createMod("Condition:OnConsecratedGround", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) })