Fixed Golden Cookie percentage calculation to cdf #921 (#1190)

* Added cummulative probability handling

* executed build-dev command

* executed build-final command
This commit is contained in:
Numbernaut
2024-09-08 11:17:00 +02:00
committed by GitHub
parent ca1c28d1fc
commit 9e98208c19
8 changed files with 70 additions and 6 deletions

View File

@@ -10,6 +10,12 @@ import {
LastNumberOfTimers,
} from '../VariablesAndData';
import { CreateTimer } from './CreateDOMElements';
import {
updateChanceTotal,
getChanceFinalDeer,
getChanceFinal,
updateChanceTotalDeer,
} from '../../Main/CheckStates/Probability';
/**
* This function creates the TimerBar and appends it to l('wrapper')
@@ -124,9 +130,10 @@ export function UpdateTimerBar() {
(Game.shimmerTypes.golden.time - Game.shimmerTypes.golden.minTime) /
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime),
) ** 5;
updateChanceTotal(chanceToSpawn);
l('CMTimerBarGCTime').textContent = `${Math.ceil(
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
)} ${getChanceFinal() < 0.01 ? '<' : ''}${getChanceFinal().toLocaleString('en', {
style: 'percent',
})}`;
numberOfTimers += 1;
@@ -167,9 +174,10 @@ export function UpdateTimerBar() {
(Game.shimmerTypes.reindeer.time - Game.shimmerTypes.reindeer.minTime) /
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime),
) ** 5;
updateChanceTotalDeer(chanceToSpawn);
l('CMTimerBarRenTime').textContent = `${Math.ceil(
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
)} ${getChanceFinalDeer() < 0.01 ? '<' : ''}${getChanceFinalDeer().toLocaleString('en', {
style: 'percent',
})}`;
numberOfTimers += 1;