Skip to content

Commit 2e37639

Browse files
nofate121nofate121
andauthored
Fix spectre buffs global effects applying just by existing in the spectre library (#9667)
Co-authored-by: nofate121 <nofate121@abc.def>
1 parent f629d8d commit 2e37639

1 file changed

Lines changed: 48 additions & 36 deletions

File tree

src/Modules/CalcPerform.lua

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,54 +2025,66 @@ function calcs.perform(env, skipEHP)
20252025
local allyBuffs = env.partyMembers["Aura"]
20262026
local buffExports = { Aura = {}, Curse = {}, Warcry = {}, Link = {}, EnemyMods = {}, EnemyConditions = {}, PlayerMods = {} }
20272027
local hasActiveSpectreSkill = false
2028+
local activeSpectreList = { }
20282029
for _, activeSkill in ipairs(env.player.activeSkillList) do
20292030
if not activeSkill.skillFlags.disable then
20302031
local skillId = activeSkill.activeEffect.grantedEffect.id
20312032
if skillId and skillId:match("^RaiseSpectre") then
20322033
hasActiveSpectreSkill = true
2033-
break
2034+
if activeSkill.minion and activeSkill.minion.type then
2035+
t_insert(activeSpectreList, activeSkill.minion.type)
2036+
end
20342037
end
20352038
end
20362039
end
20372040
if hasActiveSpectreSkill then
20382041
for spectreId = 1, #env.spec.build.spectreList do
2039-
local spectreData = data.minions[env.spec.build.spectreList[spectreId]]
2040-
if not modDB.conditions["HaveBeastSpectre"] then
2041-
-- Change to grab from monster family using CorpseTypeTags.dat if other monster families are needed in the future
2042-
for _, tagName in ipairs(spectreData.monsterTags) do
2043-
if tagName == "beast" then
2044-
modDB.conditions["HaveBeastSpectre"] = true
2045-
break
2046-
end
2042+
local isThisSpectreActive = false
2043+
for _, spectreType in ipairs(activeSpectreList) do
2044+
if env.spec.build.spectreList[spectreId] == spectreType then
2045+
isThisSpectreActive = true
2046+
break
20472047
end
20482048
end
2049-
for modId = 1, #spectreData.modList do
2050-
local modData = spectreData.modList[modId]
2051-
if modData.name == "EnemyCurseLimit" then
2052-
minionCurses.limit = modData.value + 1
2053-
break
2054-
elseif modData.name == "AllyModifier" and modData.type == "LIST" then
2055-
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2056-
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
2057-
for _, modValue in pairs(modData.value) do
2058-
local copyModValue = copyTable(modValue)
2059-
copyModValue.source = "Spectre:"..spectreData.name
2060-
t_insert(minionBuffs["Spectre"], copyModValue)
2061-
t_insert(buffs["Spectre"], copyModValue)
2062-
end
2063-
elseif modData.name == "MinionModifier" and modData.type == "LIST" then
2064-
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
2065-
for _, modValue in pairs(modData.value) do
2066-
local copyModValue = copyTable(modValue)
2067-
copyModValue.source = "Spectre:"..spectreData.name
2068-
t_insert(minionBuffs["Spectre"], copyModValue)
2069-
end
2070-
elseif modData.name == "PlayerModifier" and modData.type == "LIST" then
2071-
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2072-
for _, modValue in pairs(modData.value) do
2073-
local copyModValue = copyTable(modValue)
2074-
copyModValue.source = "Spectre:"..spectreData.name
2075-
t_insert(buffs["Spectre"], copyModValue)
2049+
if isThisSpectreActive then
2050+
local spectreData = data.minions[env.spec.build.spectreList[spectreId]]
2051+
if not modDB.conditions["HaveBeastSpectre"] then
2052+
-- Change to grab from monster family using CorpseTypeTags.dat if other monster families are needed in the future
2053+
for _, tagName in ipairs(spectreData.monsterTags) do
2054+
if tagName == "beast" then
2055+
modDB.conditions["HaveBeastSpectre"] = true
2056+
break
2057+
end
2058+
end
2059+
end
2060+
for modId = 1, #spectreData.modList do
2061+
local modData = spectreData.modList[modId]
2062+
if modData.name == "EnemyCurseLimit" then
2063+
minionCurses.limit = modData.value + 1
2064+
break
2065+
elseif modData.name == "AllyModifier" and modData.type == "LIST" then
2066+
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2067+
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
2068+
for _, modValue in pairs(modData.value) do
2069+
local copyModValue = copyTable(modValue)
2070+
copyModValue.source = "Spectre:"..spectreData.name
2071+
t_insert(minionBuffs["Spectre"], copyModValue)
2072+
t_insert(buffs["Spectre"], copyModValue)
2073+
end
2074+
elseif modData.name == "MinionModifier" and modData.type == "LIST" then
2075+
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
2076+
for _, modValue in pairs(modData.value) do
2077+
local copyModValue = copyTable(modValue)
2078+
copyModValue.source = "Spectre:"..spectreData.name
2079+
t_insert(minionBuffs["Spectre"], copyModValue)
2080+
end
2081+
elseif modData.name == "PlayerModifier" and modData.type == "LIST" then
2082+
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2083+
for _, modValue in pairs(modData.value) do
2084+
local copyModValue = copyTable(modValue)
2085+
copyModValue.source = "Spectre:"..spectreData.name
2086+
t_insert(buffs["Spectre"], copyModValue)
2087+
end
20762088
end
20772089
end
20782090
end

0 commit comments

Comments
 (0)