CookieMonsterTeam/CookieMonster

Consider current amount of Heavenly Chips when calculate next lucky digit/number/payout

Jerryh001 opened this issue · 1 comments

Feature description

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(
document.createTextNode(
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
),
);
section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7));
}
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(
document.createTextNode(
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
),
);
section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777));
}
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(
document.createTextNode(
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
),
);
section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777));
}

for example: when we started with 0 chips and 1000 prestige level, the player can buy it after get 777 chips (1777 level)

but next lucky digit in current version will be 1007 instead of 1777

Additional files

No response

I know this is an old post, but nobody has yet to comment... I'm thinking maybe they're confused by what you're asking, given your example.

I believe you're asking for the code to account for when the player can also afford to buy the upgrade. So while, in your example, the upgrade would next be available at 1007 prestige, the player would only have 7 chips and couldn't afford to buy it. The upgrade costs 777 chips to buy, so the min prestige to be able to buy it would be 1777 which also just happens to meet the upgrade condition. *

That's probably not a bad idea, but I would add that the display of this information needs to make it clear that it's also accounting for when the player afford to buy the upgrade. Otherwise, someone will complain that, using your example, the code is incorrectly showing 1777 when 1007 would actually be next.

  • at the present time, this code is no longer accurate anyway - 2 months ago, the conditions for these upgrades changed and cookie monster hasn't been updated accordingly