@@ -96,28 +96,31 @@ local function setRadiusJewelStats(radiusJewel, radiusJewelStats)
9696 local jewel = radiusJewel .item
9797 if jewel .title == " Against the Darkness" then
9898 radiusJewelStats .source = radiusJewel .data .modSource
99- local range = jewel .explicitModLines [jewel .variant ].range
99+
100+ local variant = jewel .variant or 1
101+ local range = jewel .explicitModLines [variant ].range
100102 local value = 0
101- jewel .explicitModLines [jewel . variant ].line :gsub (" %((%d+)%-(%d+)%)" ,
103+ jewel .explicitModLines [variant ].line :gsub (" %((%d+)%-(%d+)%)" ,
102104 function (num1 , num2 )
103- value = round (( num1 + num2 ) * range )
105+ value = round (num1 + ( num2 - num1 ) * range )
104106 end
105107 )
106108 radiusJewelStats [1 ] = {
107- isNotable = (jewel .explicitModLines [jewel . variant ].line :match (" ^(%S+)" ) == " Notable" ),
108- sd = jewel .explicitModLines [jewel . variant ].line :gsub (" .*grant " , " " ):gsub (" %(.-%)" , value )
109+ isNotable = (jewel .explicitModLines [variant ].line :match (" ^(%S+)" ) == " Notable" ),
110+ sd = jewel .explicitModLines [variant ].line :gsub (" .*grant " , " " ):gsub (" %(.-%)" , value )
109111 }
110-
111- local rangeAlt = jewel .explicitModLines [jewel .variant ].range
112+
113+ local variantAlt = jewel .variantAlt or 2
114+ local rangeAlt = jewel .explicitModLines [variantAlt ].range
112115 local valueAlt = 0
113- jewel .explicitModLines [jewel . variantAlt ].line :gsub (" %((%d+)%-(%d+)%)" ,
116+ jewel .explicitModLines [variantAlt ].line :gsub (" %((%d+)%-(%d+)%)" ,
114117 function (num1 , num2 )
115- valueAlt = round (( num1 + num2 ) * rangeAlt )
118+ valueAlt = round (num1 + ( num2 - num1 ) * rangeAlt )
116119 end
117120 )
118121 radiusJewelStats [2 ] = {
119- isNotable = (jewel .explicitModLines [jewel . variantAlt ].line :match (" ^(%S+)" ) == " Notable" ),
120- sd = jewel .explicitModLines [jewel . variantAlt ].line :gsub (" .*grant " , " " ):gsub (" %(.-%)" , valueAlt )
122+ isNotable = (jewel .explicitModLines [variantAlt ].line :match (" ^(%S+)" ) == " Notable" ),
123+ sd = jewel .explicitModLines [variantAlt ].line :gsub (" .*grant " , " " ):gsub (" %(.-%)" , valueAlt )
121124 }
122125 end
123126end
0 commit comments