Fixed rounding issues with HC per second

This commit is contained in:
Daniël van Noord
2021-02-21 00:15:27 +01:00
parent fdc94dd2db
commit 69a151a25a
3 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -2695,14 +2695,16 @@ CM.Disp.CreateStatsPrestigeSection = function() {
section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Heavenly Chips (CUR / MAX)', document.createTextNode(Beautify(Game.heavenlyChips) + ' / ' + Beautify((possiblePresMax - Game.prestige) + Game.heavenlyChips)), 'HeavenChipMaxTooltipPlaceholder')); section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Heavenly Chips (CUR / MAX)', document.createTextNode(Beautify(Game.heavenlyChips) + ' / ' + Beautify((possiblePresMax - Game.prestige) + Game.heavenlyChips)), 'HeavenChipMaxTooltipPlaceholder'));
section.appendChild(CM.Disp.CreateStatsListing("basic", 'Heavenly Chips Per Second (last 5 seconds)', document.createTextNode(Beautify(CM.Cache.HCPerSecond)))); section.appendChild(CM.Disp.CreateStatsListing("basic", 'Heavenly Chips Per Second (last 5 seconds)', document.createTextNode(Beautify(CM.Cache.HCPerSecond, 2))));
let HCTarget = Number(CM.Options.HeavenlyChipsTarget) let HCTarget = Number(CM.Options.HeavenlyChipsTarget)
if (!isNaN(HCTarget)) { if (!isNaN(HCTarget)) {
let CookiesTillTarget = HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) let CookiesTillTarget = HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned))
if (CookiesTillTarget > 0) {
section.appendChild(CM.Disp.CreateStatsListing("basic", 'Heavenly Chips To Target Set In Settings (CUR)', document.createTextNode(Beautify(CookiesTillTarget)))); section.appendChild(CM.Disp.CreateStatsListing("basic", 'Heavenly Chips To Target Set In Settings (CUR)', document.createTextNode(Beautify(CookiesTillTarget))));
section.appendChild(CM.Disp.CreateStatsListing("basic", 'Time To Target (CUR, Current 5 Second Average)', document.createTextNode(CM.Disp.FormatTime(CookiesTillTarget / CM.Cache.HCPerSecond)))); section.appendChild(CM.Disp.CreateStatsListing("basic", 'Time To Target (CUR, Current 5 Second Average)', document.createTextNode(CM.Disp.FormatTime(CookiesTillTarget / CM.Cache.HCPerSecond))));
} }
}
let resetBonus = CM.Sim.ResetBonus(possiblePresMax); let resetBonus = CM.Sim.ResetBonus(possiblePresMax);
let resetFrag = document.createDocumentFragment(); let resetFrag = document.createDocumentFragment();

View File

@@ -202,7 +202,7 @@ CM.Main.ReplaceNative = function() {
.split('document.title') .split('document.title')
.join('CM.Disp.Title') .join('CM.Disp.Title')
.split("' more cookies</b> for the next level.<br>';") .split("' more cookies</b> for the next level.<br>';")
.join("` more cookies</b> for the next level.<br>${CM.Options.TooltipAscendButton ? `<div class='line'></div>It takes ${CM.Cache.TimeTillNextPrestige} to reach the next level and you are making ${CM.Cache.HCPerSecond} chips on average in the last 5 seconds.<br>` : ``}`;")}`, .join("` more cookies</b> for the next level.<br>${CM.Options.TooltipAscendButton ? `<div class='line'></div>It takes ${CM.Cache.TimeTillNextPrestige} to reach the next level and you are making ${Beautify(CM.Cache.HCPerSecond, 2)} chips on average in the last 5 seconds.<br>` : ``}`;")}`,
)(); )();
Game.Logic = function() { Game.Logic = function() {
CM.Backup.LogicMod(); CM.Backup.LogicMod();