Skip to content

Commit e2ca9ba

Browse files
author
nofate121
committed
Fix spectre buffs global effects applying just by existing in the spectre library
1 parent b439e04 commit e2ca9ba

File tree

1 file changed

+48
-36
lines changed

1 file changed

+48
-36
lines changed

src/Modules/CalcPerform.lua

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,54 +2032,66 @@ function calcs.perform(env, skipEHP)
20322032
local allyBuffs = env.partyMembers["Aura"]
20332033
local buffExports = { Aura = {}, Curse = {}, Warcry = {}, Link = {}, EnemyMods = {}, EnemyConditions = {}, PlayerMods = {} }
20342034
local hasActiveSpectreSkill = false
2035+
local activeSprectreList = { }
20352036
for _, activeSkill in ipairs(env.player.activeSkillList) do
20362037
if not activeSkill.skillFlags.disable then
20372038
local skillId = activeSkill.activeEffect.grantedEffect.id
20382039
if skillId and skillId:match("^RaiseSpectre") then
20392040
hasActiveSpectreSkill = true
2040-
break
2041+
if activeSkill.minion and activeSkill.minion.type then
2042+
t_insert(activeSprectreList, activeSkill.minion.type)
2043+
end
20412044
end
20422045
end
20432046
end
20442047
if hasActiveSpectreSkill then
20452048
for spectreId = 1, #env.spec.build.spectreList do
2046-
local spectreData = data.minions[env.spec.build.spectreList[spectreId]]
2047-
if not modDB.conditions["HaveBeastSpectre"] then
2048-
-- Change to grab from monster family using CorpseTypeTags.dat if other monster families are needed in the future
2049-
for _, tagName in ipairs(spectreData.monsterTags) do
2050-
if tagName == "beast" then
2051-
modDB.conditions["HaveBeastSpectre"] = true
2052-
break
2053-
end
2049+
local isThisSpectreActive = false
2050+
for _, spectreType in ipairs(activeSprectreList) do
2051+
if env.spec.build.spectreList[spectreId] == spectreType then
2052+
isThisSpectreActive = true
2053+
break
20542054
end
20552055
end
2056-
for modId = 1, #spectreData.modList do
2057-
local modData = spectreData.modList[modId]
2058-
if modData.name == "EnemyCurseLimit" then
2059-
minionCurses.limit = modData.value + 1
2060-
break
2061-
elseif modData.name == "AllyModifier" and modData.type == "LIST" then
2062-
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2063-
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
2064-
for _, modValue in pairs(modData.value) do
2065-
local copyModValue = copyTable(modValue)
2066-
copyModValue.source = "Spectre:"..spectreData.name
2067-
t_insert(minionBuffs["Spectre"], copyModValue)
2068-
t_insert(buffs["Spectre"], copyModValue)
2069-
end
2070-
elseif modData.name == "MinionModifier" and modData.type == "LIST" then
2071-
minionBuffs["Spectre"] = minionBuffs["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(minionBuffs["Spectre"], copyModValue)
2076-
end
2077-
elseif modData.name == "PlayerModifier" and modData.type == "LIST" then
2078-
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2079-
for _, modValue in pairs(modData.value) do
2080-
local copyModValue = copyTable(modValue)
2081-
copyModValue.source = "Spectre:"..spectreData.name
2082-
t_insert(buffs["Spectre"], copyModValue)
2056+
if isThisSpectreActive then
2057+
local spectreData = data.minions[env.spec.build.spectreList[spectreId]]
2058+
if not modDB.conditions["HaveBeastSpectre"] then
2059+
-- Change to grab from monster family using CorpseTypeTags.dat if other monster families are needed in the future
2060+
for _, tagName in ipairs(spectreData.monsterTags) do
2061+
if tagName == "beast" then
2062+
modDB.conditions["HaveBeastSpectre"] = true
2063+
break
2064+
end
2065+
end
2066+
end
2067+
for modId = 1, #spectreData.modList do
2068+
local modData = spectreData.modList[modId]
2069+
if modData.name == "EnemyCurseLimit" then
2070+
minionCurses.limit = modData.value + 1
2071+
break
2072+
elseif modData.name == "AllyModifier" and modData.type == "LIST" then
2073+
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2074+
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
2075+
for _, modValue in pairs(modData.value) do
2076+
local copyModValue = copyTable(modValue)
2077+
copyModValue.source = "Spectre:"..spectreData.name
2078+
t_insert(minionBuffs["Spectre"], copyModValue)
2079+
t_insert(buffs["Spectre"], copyModValue)
2080+
end
2081+
elseif modData.name == "MinionModifier" and modData.type == "LIST" then
2082+
minionBuffs["Spectre"] = minionBuffs["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(minionBuffs["Spectre"], copyModValue)
2087+
end
2088+
elseif modData.name == "PlayerModifier" and modData.type == "LIST" then
2089+
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
2090+
for _, modValue in pairs(modData.value) do
2091+
local copyModValue = copyTable(modValue)
2092+
copyModValue.source = "Spectre:"..spectreData.name
2093+
t_insert(buffs["Spectre"], copyModValue)
2094+
end
20832095
end
20842096
end
20852097
end

0 commit comments

Comments
 (0)