Skip to content

Commit 6ac11ea

Browse files
LocalIdentityLocalIdentity
andauthored
Fix Spectre corpse buffs applying when no Spectre gem is in build (#9306)
If you add a Spectre like a Perfect Spirit of Fortune for the Lucky Hits buff, it will always apply the effect if you have it in your Spectre list, even if you remove a spectre gem from the build It now checks to make sure you have at least 1 Spectre gem in your build before applying the corpse buffs Co-authored-by: LocalIdentity <[email protected]>
1 parent acb4744 commit 6ac11ea

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

src/Modules/CalcPerform.lua

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,35 +1954,47 @@ function calcs.perform(env, skipEHP)
19541954
local linkSkills = { }
19551955
local allyBuffs = env.partyMembers["Aura"]
19561956
local buffExports = { Aura = {}, Curse = {}, Warcry = {}, Link = {}, EnemyMods = {}, EnemyConditions = {}, PlayerMods = {} }
1957-
for spectreId = 1, #env.spec.build.spectreList do
1958-
local spectreData = data.minions[env.spec.build.spectreList[spectreId]]
1959-
for modId = 1, #spectreData.modList do
1960-
local modData = spectreData.modList[modId]
1961-
if modData.name == "EnemyCurseLimit" then
1962-
minionCurses.limit = modData.value + 1
1957+
local hasActiveSpectreSkill = false
1958+
for _, activeSkill in ipairs(env.player.activeSkillList) do
1959+
if not activeSkill.skillFlags.disable then
1960+
local skillId = activeSkill.activeEffect.grantedEffect.id
1961+
if skillId and skillId:match("^RaiseSpectre") then
1962+
hasActiveSpectreSkill = true
19631963
break
1964-
elseif modData.name == "AllyModifier" and modData.type == "LIST" then
1965-
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
1966-
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
1967-
for _, modValue in pairs(modData.value) do
1968-
local copyModValue = copyTable(modValue)
1969-
copyModValue.source = "Spectre:"..spectreData.name
1970-
t_insert(minionBuffs["Spectre"], copyModValue)
1971-
t_insert(buffs["Spectre"], copyModValue)
1972-
end
1973-
elseif modData.name == "MinionModifier" and modData.type == "LIST" then
1974-
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
1975-
for _, modValue in pairs(modData.value) do
1976-
local copyModValue = copyTable(modValue)
1977-
copyModValue.source = "Spectre:"..spectreData.name
1978-
t_insert(minionBuffs["Spectre"], copyModValue)
1979-
end
1980-
elseif modData.name == "PlayerModifier" and modData.type == "LIST" then
1981-
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
1982-
for _, modValue in pairs(modData.value) do
1983-
local copyModValue = copyTable(modValue)
1984-
copyModValue.source = "Spectre:"..spectreData.name
1985-
t_insert(buffs["Spectre"], copyModValue)
1964+
end
1965+
end
1966+
end
1967+
if hasActiveSpectreSkill then
1968+
for spectreId = 1, #env.spec.build.spectreList do
1969+
local spectreData = data.minions[env.spec.build.spectreList[spectreId]]
1970+
for modId = 1, #spectreData.modList do
1971+
local modData = spectreData.modList[modId]
1972+
if modData.name == "EnemyCurseLimit" then
1973+
minionCurses.limit = modData.value + 1
1974+
break
1975+
elseif modData.name == "AllyModifier" and modData.type == "LIST" then
1976+
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
1977+
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
1978+
for _, modValue in pairs(modData.value) do
1979+
local copyModValue = copyTable(modValue)
1980+
copyModValue.source = "Spectre:"..spectreData.name
1981+
t_insert(minionBuffs["Spectre"], copyModValue)
1982+
t_insert(buffs["Spectre"], copyModValue)
1983+
end
1984+
elseif modData.name == "MinionModifier" and modData.type == "LIST" then
1985+
minionBuffs["Spectre"] = minionBuffs["Spectre"] or new("ModList")
1986+
for _, modValue in pairs(modData.value) do
1987+
local copyModValue = copyTable(modValue)
1988+
copyModValue.source = "Spectre:"..spectreData.name
1989+
t_insert(minionBuffs["Spectre"], copyModValue)
1990+
end
1991+
elseif modData.name == "PlayerModifier" and modData.type == "LIST" then
1992+
buffs["Spectre"] = buffs["Spectre"] or new("ModList")
1993+
for _, modValue in pairs(modData.value) do
1994+
local copyModValue = copyTable(modValue)
1995+
copyModValue.source = "Spectre:"..spectreData.name
1996+
t_insert(buffs["Spectre"], copyModValue)
1997+
end
19861998
end
19871999
end
19882000
end

0 commit comments

Comments
 (0)