Skip to content

Commit 71eeba7

Browse files
author
LocalIdentity
committed
Fix sort list
Remove gems from the list that cannot support the active skill Adds code in calc tools to grab the skillTypes from the base skill so any added skill types are ignored
1 parent 9803db6 commit 71eeba7

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

src/Classes/GemSelectControl.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function GemSelectClass:FilterSupport(gemId, gemData)
135135
end
136136

137137
if self.imbuedSelect then
138-
return (gemData.grantedEffect.support and not (gemData.tagString:match("Exceptional")))
138+
return gemData.grantedEffect.support and not gemData.tagString:match("Exceptional") and self.sortCache.canSupport[gemId]
139139
end
140140

141141
return (not gemData.grantedEffect.support
@@ -288,7 +288,7 @@ function GemSelectClass:UpdateSortCache()
288288
for gemId, gemData in pairs(self.gems) do
289289
if gemData.grantedEffect.support then
290290
for _, activeSkill in ipairs(self.skillsTab.displayGroup.displaySkillList) do
291-
if calcLib.canGrantedEffectSupportActiveSkill(gemData.grantedEffect, activeSkill) then
291+
if calcLib.canGrantedEffectSupportActiveSkill(gemData.grantedEffect, activeSkill, self.imbuedSelect) then
292292
sortCache.canSupport[gemId] = true
293293
break
294294
end
@@ -303,7 +303,7 @@ function GemSelectClass:UpdateSortCache()
303303
for gemId, gemData in pairs(self.gems) do
304304
if gemData.grantedEffect.support then
305305
for _, activeSkill in ipairs(group.displaySkillList) do
306-
if calcLib.canGrantedEffectSupportActiveSkill(gemData.grantedEffect, activeSkill) then
306+
if calcLib.canGrantedEffectSupportActiveSkill(gemData.grantedEffect, activeSkill, self.imbuedSelect) then
307307
sortCache.canSupport[gemId] = true
308308
break
309309
end
@@ -316,7 +316,7 @@ function GemSelectClass:UpdateSortCache()
316316
for gemId, gemData in pairs(self.gems) do
317317
if gemData.grantedEffect.support then
318318
for _, activeSkill in ipairs(group.displaySkillList) do
319-
if calcLib.canGrantedEffectSupportActiveSkill(gemData.grantedEffect, activeSkill) then
319+
if calcLib.canGrantedEffectSupportActiveSkill(gemData.grantedEffect, activeSkill, self.imbuedSelect) then
320320
sortCache.canSupport[gemId] = true
321321
break
322322
end

src/Modules/CalcTools.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function calcLib.doesTypeExpressionMatch(checkTypes, skillTypes, minionTypes)
8282
end
8383

8484
-- Check if given support skill can support the given active skill
85-
function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill)
85+
function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill, imbuedSupport)
8686
if grantedEffect.unsupported or activeSkill.activeEffect.grantedEffect.cannotBeSupported then
8787
return false
8888
end
@@ -95,8 +95,15 @@ function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill)
9595
return false
9696
end
9797

98-
local effectiveSkillTypes = activeSkill.summonSkill and activeSkill.summonSkill.skillTypes or activeSkill.skillTypes
99-
local effectiveMinionTypes = not grantedEffect.ignoreMinionTypes and (activeSkill.summonSkill and activeSkill.summonSkill.minionSkillTypes or activeSkill.minionSkillTypes)
98+
local effectiveSkillTypes
99+
local effectiveMinionTypes
100+
if imbuedSupport then -- Use the skillTypes from the gem so it ignores any support added types
101+
effectiveSkillTypes = activeSkill.summonSkill and activeSkill.summonSkill.activeEffect.grantedEffect.skillTypes or activeSkill.activeEffect.grantedEffect.skillTypes
102+
effectiveMinionTypes = not grantedEffect.ignoreMinionTypes and (activeSkill.summonSkill and activeSkill.summonSkill.activeEffect.grantedEffect.minionSkillTypes or activeSkill.activeEffect.grantedEffect.minionSkillTypes)
103+
else
104+
effectiveSkillTypes = activeSkill.summonSkill and activeSkill.summonSkill.skillTypes or activeSkill.skillTypes
105+
effectiveMinionTypes = not grantedEffect.ignoreMinionTypes and (activeSkill.summonSkill and activeSkill.summonSkill.minionSkillTypes or activeSkill.minionSkillTypes)
106+
end
100107

101108
-- if the activeSkill is a Minion's skill like "Default Attack", use minion's skillTypes instead for exclusions
102109
-- otherwise compare support to activeSkill directly

0 commit comments

Comments
 (0)