@@ -90,6 +90,57 @@ function calcs.initModDB(env, modDB)
90
90
modDB .conditions [" Effective" ] = env .mode_effective
91
91
end
92
92
93
+ -- grab the stat lines from the selected variants on the jewel to add to the nodes
94
+ -- e.g. Against the Darkness
95
+ local function setRadiusJewelStats (radiusJewel , radiusJewelStats )
96
+ local jewel = radiusJewel .item
97
+ if jewel .title == " Against the Darkness" then
98
+ radiusJewelStats .source = radiusJewel .data .modSource
99
+ local range = jewel .explicitModLines [jewel .variant ].range
100
+ local value = 0
101
+ jewel .explicitModLines [jewel .variant ].line :gsub (" %((%d+)%-(%d+)%)" ,
102
+ function (num1 , num2 )
103
+ value = round ((num1 + num2 )* range )
104
+ end
105
+ )
106
+ radiusJewelStats [1 ] = {
107
+ isNotable = (jewel .explicitModLines [jewel .variant ].line :match (" ^(%S+)" ) == " Notable" ),
108
+ sd = jewel .explicitModLines [jewel .variant ].line :gsub (" .*grant " , " " ):gsub (" %(.-%)" , value )
109
+ }
110
+
111
+ local rangeAlt = jewel .explicitModLines [jewel .variant ].range
112
+ local valueAlt = 0
113
+ jewel .explicitModLines [jewel .variantAlt ].line :gsub (" %((%d+)%-(%d+)%)" ,
114
+ function (num1 , num2 )
115
+ valueAlt = round ((num1 + num2 )* rangeAlt )
116
+ end
117
+ )
118
+ radiusJewelStats [2 ] = {
119
+ isNotable = (jewel .explicitModLines [jewel .variantAlt ].line :match (" ^(%S+)" ) == " Notable" ),
120
+ sd = jewel .explicitModLines [jewel .variantAlt ].line :gsub (" .*grant " , " " ):gsub (" %(.-%)" , valueAlt )
121
+ }
122
+ end
123
+ end
124
+
125
+ local function addStatsFromJewelToNode (jewel , node , spec )
126
+ -- reset node stats to base or override for attributes
127
+ if spec .hashOverrides and spec .hashOverrides [node .id ] then
128
+ node .sd = copyTable (spec .hashOverrides [node .id ].sd , true )
129
+ else
130
+ node .sd = copyTable (spec .tree .nodes [node .id ].sd , true )
131
+ end
132
+
133
+ local radiusJewelStats = { }
134
+ setRadiusJewelStats (jewel , radiusJewelStats )
135
+ for _ , stat in ipairs (radiusJewelStats ) do
136
+ -- the node and jewelStat types match, add sd to node if it's not already there
137
+ if not isValueInTable (node .sd , stat .sd ) and ((node .type == " Notable" and stat .isNotable ) or (node .type ~= " Notable" and not stat .isNotable )) then
138
+ t_insert (node .sd , stat .sd )
139
+ end
140
+ end
141
+ spec .tree :ProcessStats (node )
142
+ end
143
+
93
144
function calcs .buildModListForNode (env , node , incSmallPassiveSkill )
94
145
local modList = new (" ModList" )
95
146
if node .type == " Keystone" then
@@ -118,7 +169,11 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
118
169
-- Run first pass radius jewels
119
170
for _ , rad in pairs (env .radiusJewelList ) do
120
171
if rad .type == " Other" and rad .nodes [node .id ] and rad .nodes [node .id ].type ~= " Mastery" then
121
- rad .func (node , modList , rad .data )
172
+ if rad .item .title ~= " Against the Darkness" then
173
+ rad .func (node , modList , rad .data )
174
+ else
175
+ addStatsFromJewelToNode (rad , node , env .build .spec )
176
+ end
122
177
end
123
178
end
124
179
@@ -137,7 +192,11 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
137
192
-- Run second pass radius jewels
138
193
for _ , rad in pairs (env .radiusJewelList ) do
139
194
if rad .nodes [node .id ] and rad .nodes [node .id ].type ~= " Mastery" and (rad .type == " Threshold" or (rad .type == " Self" and env .allocNodes [node .id ]) or (rad .type == " SelfUnalloc" and not env .allocNodes [node .id ])) then
140
- rad .func (node , modList , rad .data )
195
+ if rad .item .title ~= " Against the Darkness" then
196
+ rad .func (node , modList , rad .data )
197
+ else
198
+ addStatsFromJewelToNode (rad , node , env .build .spec )
199
+ end
141
200
end
142
201
end
143
202
0 commit comments