@@ -194,7 +194,7 @@ let BestDealHelper = {
194194 if ( me . price > Game . cookies ) {
195195 me . timeToTargetCookie = ( me . price - Game . cookies ) / Game . cookiesPs + target . price / me . newCookiesPs ;
196196 } else {
197- me . timeToTargetCookie = ( target . price - ( Game . cookies - me . price ) ) / me . newCookiesPs ;
197+ me . timeToTargetCookie = ( target . price + me . price - Game . cookies ) / me . newCookiesPs ;
198198 }
199199 } ) ;
200200 helpers . sort ( ( a , b ) => a . timeToTargetCookie - b . timeToTargetCookie ) ;
@@ -212,7 +212,7 @@ let BestDealHelper = {
212212 span . innerHTML = "" ;
213213 for ( let i = 0 ; i < text . length ; i ++ ) {
214214 let charElem = document . createElement ( "span" ) ;
215- charElem . style . color = "hsl(" + ( 360 * i / text . length ) + ",80%,50 %)" ;
215+ charElem . style . color = "hsl(" + ( 360 * i / text . length ) + ",90%,80 %)" ;
216216 charElem . innerHTML = text [ i ] ;
217217 span . appendChild ( charElem ) ;
218218 }
@@ -255,7 +255,7 @@ let BestDealHelper = {
255255 }
256256 rank ++ ;
257257 if ( rank < all . length ) {
258- palette . unshift ( "#64007c " ) ;
258+ palette . unshift ( "#d82aff " ) ;
259259 domain . unshift ( all [ all . length - 1 ] . cpsAcceleration ) ;
260260 }
261261
@@ -266,27 +266,51 @@ let BestDealHelper = {
266266 if ( allAcc . length === 0 ) return ;
267267 const avg = allAcc . reduce ( ( a , b ) => a + b , 0 ) / allAcc . length ;
268268
269+ // Calculate waiting times
270+ all . forEach ( function ( me ) {
271+ me . waitingTime = "" ;
272+ if ( me . price < Game . cookies ) return ;
273+
274+ const seconds = ( me . price - Game . cookies ) / Game . cookiesPs ;
275+ let a = [
276+ Math . floor ( seconds / 60 / 60 / 24 / 365 ) + "y" ,
277+ Math . floor ( seconds / 60 / 60 / 24 % 365 ) + "d" ,
278+ Math . floor ( seconds / 60 / 60 % 24 ) + "h" ,
279+ Math . floor ( seconds / 60 % 60 ) + "m" ,
280+ Math . floor ( seconds % 60 ) + "s" ] ;
281+ while ( a . length && [ "0y" , "0d" , "0m" , "0h" ] . includes ( a [ 0 ] ) ) a . shift ( ) ;
282+ if ( Math . floor ( seconds / 60 / 60 / 24 / 365 ) > 100 ) {
283+ me . waitingTime = ">100y" ;
284+ } else {
285+ me . waitingTime = a . slice ( 0 , 2 ) ;
286+ }
287+ } ) ;
288+
269289 // Notation for upgrades
270290 for ( const i in upgrades ) {
271291 let me = upgrades [ i ] ;
272292 me . l = document . querySelector ( "#upgrade" + i ) ;
293+ // Node
273294 let span = document . querySelector ( "#upgradeAcc" + i ) ;
274295 if ( ! span ) {
275296 span = document . createElement ( "span" ) ;
276297 span . id = "upgradeAcc" + i ;
277298 span . style . fontWeight = "bolder" ;
278299 span . style . position = "absolute" ;
279300 span . style . bottom = "0px" ;
280- span . style . left = "-2px " ;
301+ span . style . left = "-5px " ;
281302 span . style . textShadow = "0px 2px 6px #000, 0px 1px 1px #000" ;
282303 span . style . transform = "scale(0.8,1)" ;
283304 l ( "upgrade" + i ) . appendChild ( span ) ;
284305 }
306+
307+ // Text
285308 if ( me . cpsAcceleration === 0 ) {
286309 span . textContent = "" ;
287310 continue ;
288311 }
289312 span . textContent = Beautify ( me . cpsAcceleration * 100 / avg , 1 ) + "%" ;
313+ if ( me . waitingTime ) span . innerHTML = me . waitingTime + "<br>" + span . textContent ;
290314 if ( me . isBestHelper ) {
291315 MOD . rainbow ( span ) ;
292316 } else {
@@ -296,6 +320,7 @@ let BestDealHelper = {
296320 // Notation for buildings
297321 for ( const i in buildings ) {
298322 let me = buildings [ i ] ;
323+ // Node
299324 let span = document . querySelector ( "#productAcc" + me . id ) ;
300325 if ( ! span ) {
301326 span = document . createElement ( "span" ) ;
@@ -304,11 +329,14 @@ let BestDealHelper = {
304329 span . style . display = "block" ;
305330 MOD . insertAfter ( span , l ( "productPrice" + me . id ) ) ;
306331 }
332+
333+ // Text
307334 if ( me . cpsAcceleration === 0 ) {
308335 span . textContent = "" ;
309336 continue ;
310337 }
311338 span . textContent = " 💹" + Beautify ( me . cpsAcceleration * 100 / avg , 2 ) + "%" ;
339+ if ( me . waitingTime ) span . textContent += " ⏳" + me . waitingTime ;
312340 if ( me . isBestHelper ) {
313341 MOD . rainbow ( span ) ;
314342 } else {
0 commit comments