Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 66 additions & 18 deletions src/Modules/CalcActiveSkill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,29 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
local rejectedSupportsIndices = {}

for index, supportEffect in ipairs(supportList) do
-- Pass 1: Add skill types from compatible supports
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
for _, skillType in pairs(supportEffect.grantedEffect.addSkillTypes) do
activeSkill.skillTypes[skillType] = true
-- Loop through grantedEffectList until we find a support gem if the gem has an active and support component e.g. Autoexertion
if supportEffect.gemData then
for _, grantedEffect in ipairs(supportEffect.gemData.grantedEffectList) do
if grantedEffect.support then
-- Pass 1: Add skill types from compatible supports
if calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) then
for _, skillType in pairs(grantedEffect.addSkillTypes) do
activeSkill.skillTypes[skillType] = true
end
else
t_insert(rejectedSupportsIndices, index)
end
end
end
else
t_insert(rejectedSupportsIndices, index)
-- Skill with no GemData e.g. Item granted supports
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
for _, skillType in pairs(supportEffect.grantedEffect.addSkillTypes) do
activeSkill.skillTypes[skillType] = true
end
else
t_insert(rejectedSupportsIndices, index)
end
end
end

Expand All @@ -125,27 +141,59 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
notAddedNewSupport = true
for index, supportEffectIndex in ipairs(rejectedSupportsIndices) do
local supportEffect = supportList[supportEffectIndex]
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
notAddedNewSupport = false
rejectedSupportsIndices[index] = nil
for _, skillType in pairs(supportEffect.grantedEffect.addSkillTypes) do
activeSkill.skillTypes[skillType] = true
if supportEffect.gemData then
for _, grantedEffect in ipairs(supportEffect.gemData.grantedEffectList) do
if grantedEffect.support then
if calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) then
notAddedNewSupport = false
rejectedSupportsIndices[index] = nil
for _, skillType in pairs(grantedEffect.addSkillTypes) do
activeSkill.skillTypes[skillType] = true
end
end
end
end
else
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
notAddedNewSupport = false
rejectedSupportsIndices[index] = nil
for _, skillType in pairs(supportEffect.grantedEffect.addSkillTypes) do
activeSkill.skillTypes[skillType] = true
end
end
end
end
until (notAddedNewSupport)

for _, supportEffect in ipairs(supportList) do
-- Pass 2: Add all compatible supports
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
t_insert(activeSkill.effectList, supportEffect)
if supportEffect.isSupporting and activeEffect.srcInstance then
supportEffect.isSupporting[activeEffect.srcInstance] = true
if supportEffect.gemData then
for _, grantedEffect in ipairs(supportEffect.gemData.grantedEffectList) do
if grantedEffect.support then
if calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) then
t_insert(activeSkill.effectList, supportEffect)
if supportEffect.isSupporting and activeEffect.srcInstance then
supportEffect.isSupporting[activeEffect.srcInstance] = true
end
if grantedEffect.addFlags and not summonSkill then
-- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
for k in pairs(grantedEffect.addFlags) do
skillFlags[k] = true
end
end
end
end
end
if supportEffect.grantedEffect.addFlags and not summonSkill then
-- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
for k in pairs(supportEffect.grantedEffect.addFlags) do
skillFlags[k] = true
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
t_insert(activeSkill.effectList, supportEffect)
if supportEffect.isSupporting and activeEffect.srcInstance then
supportEffect.isSupporting[activeEffect.srcInstance] = true
end
if supportEffect.grantedEffect.addFlags and not summonSkill then
-- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
for k in pairs(supportEffect.grantedEffect.addFlags) do
skillFlags[k] = true
end
end
end
end
Expand Down
10 changes: 7 additions & 3 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1563,10 +1563,14 @@ function calcs.initEnv(build, mode, override, specEnv)
if supportLists[slotName] then
-- add socketed supports from other socketGroups
for _, otherSocketGroup in ipairs(build.skillsTab.socketGroupList) do
if otherSocketGroup.slot and otherSocketGroup.slot == group.slot then
if otherSocketGroup.slot and otherSocketGroup.slot == group.slot and not (otherSocketGroup.source and otherSocketGroup.source == group.source) then
for _, gem in ipairs(otherSocketGroup.gemList) do
if gem.gemData and gem.gemData.grantedEffect and gem.gemData.grantedEffect.support then
t_insert(group.displayGemList, gem)
if gem.gemData and gem.gemData.grantedEffectList then
for _, grantedEffect in ipairs(gem.gemData.grantedEffectList) do
if grantedEffect.support then
t_insert(group.displayGemList, gem)
end
end
end
end
end
Expand Down
Loading