import { CacheHCPerSecond, CacheLastHeavenlyChips, CacheTimeTillNextPrestige, } from '../../Cache/VariablesAndData'; import { CMOptions } from '../../Config/VariablesAndData'; import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting'; /** * This function creates a header object for tooltips. * @param {string} text Title of header * @returns {object} div An object containing the stylized header */ export default function ReplaceAscendTooltip() { const cookiesToNext = Math.max( 0, Game.HowManyCookiesReset( Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1, ) - (Game.cookiesEarned + Game.cookiesReset), ); const startDate = Game.sayTime( ((Date.now() - Game.startDate) / 1000) * Game.fps, -1, ); let str = ''; str += `You've been on this run for ${ startDate === '' ? 'not very long' : startDate }.
`; str += '
'; if (Game.prestige > 0) { str += `Your prestige level is currently ${Beautify( Game.prestige, )}.
(CpS +${Beautify(Game.prestige)}%)`; str += '
'; } if (CacheLastHeavenlyChips < 1) str += 'Ascending now would grant you no prestige.'; else if (CacheLastHeavenlyChips < 2) str += 'Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.'; else str += `Ascending now would grant you
${Beautify( CacheLastHeavenlyChips, )} prestige levels (+${Beautify( CacheLastHeavenlyChips, )}% CpS)
and ${Beautify( CacheLastHeavenlyChips, )} heavenly chips to spend.`; str += '
'; str += `You need ${Beautify( cookiesToNext, )} more cookies for the next level.
`; str += `${ CMOptions.TooltipAscendButton ? `
It takes ${CacheTimeTillNextPrestige} to reach the next level and you are making ${Beautify( CacheHCPerSecond, 2, )} chips on average in the last 5 seconds.
` : '' }`; l('ascendTooltip').innerHTML = str; }