@@ -107,36 +107,15 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
107107 activeSkill .effectList = { activeEffect }
108108 local rejectedSupportsIndices = {}
109109
110- -- Return first compatible support grantedEffect plus a flag indicating the support has a support component
111- local function getGrantedSupportEffect (supportEffect )
112- local hasSupport = false
113- if supportEffect .gemData then
114- for _ , grantedEffect in ipairs (supportEffect .gemData .grantedEffectList ) do
115- if grantedEffect and grantedEffect .support then
116- hasSupport = true
117- if calcLib .canGrantedEffectSupportActiveSkill (grantedEffect , activeSkill ) then
118- return grantedEffect , true
119- end
120- end
121- end
122- elseif supportEffect .grantedEffect then
123- hasSupport = true
124- if calcLib .canGrantedEffectSupportActiveSkill (supportEffect .grantedEffect , activeSkill ) then
125- return supportEffect .grantedEffect , true
126- end
127- end
128- return nil , hasSupport
129- end
130-
131110 for index , supportEffect in ipairs (supportList ) do
132- -- Loop through grantedEffectList until we find a support gem if the gem has an active and support component e.g. Autoexertion
133- local grantedSupportEffect , hasSupport = getGrantedSupportEffect ( supportEffect )
134- if grantedSupportEffect then
135- -- Pass 1: Add skill types from compatible supports
136- for _ , skillType in pairs ( grantedSupportEffect . addSkillTypes ) do
137- activeSkill . skillTypes [ skillType ] = true
111+ -- Pass 1: Add skill types from compatible supports
112+ if supportEffect . grantedEffect . support then
113+ if calcLib . canGrantedEffectSupportActiveSkill ( supportEffect . grantedEffect , activeSkill ) then
114+ for _ , skillType in pairs ( supportEffect . grantedEffect . addSkillTypes ) do
115+ activeSkill . skillTypes [ skillType ] = true
116+ end
138117 end
139- elseif hasSupport then
118+ else
140119 t_insert (rejectedSupportsIndices , index )
141120 end
142121 end
@@ -148,29 +127,31 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
148127 notAddedNewSupport = true
149128 for index , supportEffectIndex in ipairs (rejectedSupportsIndices ) do
150129 local supportEffect = supportList [supportEffectIndex ]
151- local grantedSupportEffect = getGrantedSupportEffect (supportEffect )
152- if grantedSupportEffect then
153- notAddedNewSupport = false
154- rejectedSupportsIndices [index ] = nil
155- for _ , skillType in pairs (grantedSupportEffect .addSkillTypes ) do
156- activeSkill .skillTypes [skillType ] = true
130+ if supportEffect .grantedEffect .support then
131+ if calcLib .canGrantedEffectSupportActiveSkill (supportEffect .grantedEffect , activeSkill ) then
132+ notAddedNewSupport = false
133+ rejectedSupportsIndices [index ] = nil
134+ for _ , skillType in pairs (supportEffect .grantedEffect .addSkillTypes ) do
135+ activeSkill .skillTypes [skillType ] = true
136+ end
157137 end
158138 end
159139 end
160140 until (notAddedNewSupport )
161141
162142 for _ , supportEffect in ipairs (supportList ) do
163143 -- Pass 2: Add all compatible supports
164- local grantedSupportEffect = getGrantedSupportEffect (supportEffect )
165- if grantedSupportEffect then
166- t_insert (activeSkill .effectList , supportEffect )
167- if supportEffect .isSupporting and activeEffect .srcInstance then
168- supportEffect .isSupporting [activeEffect .srcInstance ] = true
169- end
170- if grantedSupportEffect .addFlags and not summonSkill then
171- -- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
172- for k in pairs (grantedSupportEffect .addFlags ) do
173- skillFlags [k ] = true
144+ if supportEffect .grantedEffect .support then
145+ if calcLib .canGrantedEffectSupportActiveSkill (supportEffect .grantedEffect , activeSkill ) then
146+ t_insert (activeSkill .effectList , supportEffect )
147+ if supportEffect .isSupporting and activeEffect .srcInstance then
148+ supportEffect .isSupporting [activeEffect .srcInstance ] = true
149+ end
150+ if supportEffect .grantedEffect .addFlags and not summonSkill then
151+ -- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
152+ for k in pairs (supportEffect .grantedEffect .addFlags ) do
153+ skillFlags [k ] = true
154+ end
174155 end
175156 end
176157 end
0 commit comments