update calculations for lucky levels (#1161)

* update calculations for lucky levels

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Grace Carr
2023-07-17 00:40:29 -07:00
committed by GitHub
parent 7269577009
commit 9f78e14bec
7 changed files with 177 additions and 28 deletions

View File

@@ -37,6 +37,7 @@ import {
CacheWrinklersTotal,
} from '../../../Cache/VariablesAndData';
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
import CalculateLuckyLevels from '../../HelperFunctions/CalculateLuckyLevels';
import GetCPS from '../../HelperFunctions/GetCPS';
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
@@ -606,46 +607,47 @@ export function PrestigeSection() {
const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
const willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
const willGet = willHave - currentPrestige;
const { luckyDigit, luckyNumber, luckyPayout } = CalculateLuckyLevels(willHave);
if (!Game.Has('Lucky digit')) {
let delta7 = 7 - (willHave % 10);
if (delta7 < 0) delta7 += 10;
const next7Reset = willGet + delta7;
const next7Total = willHave + delta7;
const frag7 = document.createDocumentFragment();
frag7.appendChild(
const luckyDigitDelta = luckyDigit - willHave;
const luckyDigitReset = willGet + luckyDigitDelta;
const fragLuckyDigit = document.createDocumentFragment();
fragLuckyDigit.appendChild(
document.createTextNode(
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
`${luckyDigit.toLocaleString()} / ${luckyDigitReset.toLocaleString()} (+${luckyDigitDelta})`,
),
);
section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7));
section.appendChild(
StatsListing('basic', 'Next "Lucky Digit" (total / reset)', fragLuckyDigit),
);
}
if (!Game.Has('Lucky number')) {
let delta777 = 777 - (willHave % 1000);
if (delta777 < 0) delta777 += 1000;
const next777Reset = willGet + delta777;
const next777Total = willHave + delta777;
const frag777 = document.createDocumentFragment();
frag777.appendChild(
const luckyNumberDelta = luckyNumber - willHave;
const luckyNumberReset = willGet + luckyNumberDelta;
const fragLuckyNumber = document.createDocumentFragment();
fragLuckyNumber.appendChild(
document.createTextNode(
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
`${luckyNumber.toLocaleString()} / ${luckyNumberReset.toLocaleString()} (+${luckyNumberDelta})`,
),
);
section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777));
section.appendChild(
StatsListing('basic', 'Next "Lucky Number" (total / reset)', fragLuckyNumber),
);
}
if (!Game.Has('Lucky payout')) {
let delta777777 = 777777 - (willHave % 1000000);
if (delta777777 < 0) delta777777 += 1000000;
const next777777Reset = willGet + delta777777;
const next777777Total = willHave + delta777777;
const frag777777 = document.createDocumentFragment();
frag777777.appendChild(
const luckyPayoutDelta = luckyPayout - willHave;
const luckyPayoutReset = willGet + luckyPayoutDelta;
const fragLuckyPayout = document.createDocumentFragment();
fragLuckyPayout.appendChild(
document.createTextNode(
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
`${luckyPayout.toLocaleString()} / ${luckyPayoutReset.toLocaleString()} (+${luckyPayoutDelta})`,
),
);
section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777));
section.appendChild(
StatsListing('basic', 'Next "Lucky Payout" (total / reset)', fragLuckyPayout),
);
}
return section;