import {
CacheHCPerSecond,
CacheLastHeavenlyChips,
CacheTimeTillNextPrestige,
} from '../../Cache/VariablesAndData.js';
import Beautify from '../BeautifyAndFormatting/Beautify.js';
/**
* 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 = `You've been on this run for ${
startDate === '' ? 'not very long' : startDate
}.
`;
if (Game.prestige > 0) {
str += `Your prestige level is currently ${Beautify(Game.prestige)}.
(CpS +${Beautify(
Game.prestige,
)}%)
`;
}
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 += `
You need ${Beautify(cookiesToNext)} more cookies for the next level.
${
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipAscendButton
? `It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify(
CacheHCPerSecond,
2,
)} chips on average in the last 5 seconds.
`
: ''
}`;
l('ascendTooltip').innerHTML = str;
}