[Automated] Merge dev into gh-pages
This commit is contained in:
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonsterDev.js
vendored
2
dist/CookieMonsterDev.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonsterDev.js.map
vendored
2
dist/CookieMonsterDev.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -10,12 +10,7 @@ import {
|
||||
LastNumberOfTimers,
|
||||
} from '../VariablesAndData.js';
|
||||
import { CreateTimer } from './CreateDOMElements.js';
|
||||
import {
|
||||
updateChanceTotal,
|
||||
getChanceFinalDeer,
|
||||
getChanceFinal,
|
||||
updateChanceTotalDeer,
|
||||
} from '../../Main/CheckStates/Probability.js';
|
||||
import { updateChanceTotal, updateChanceTotalDeer } from '../../Main/CheckStates/Probability.js';
|
||||
|
||||
/**
|
||||
* This function creates the TimerBar and appends it to l('wrapper')
|
||||
@@ -130,12 +125,18 @@ export function UpdateTimerBar() {
|
||||
(Game.shimmerTypes.golden.time - Game.shimmerTypes.golden.minTime) /
|
||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime),
|
||||
) ** 5;
|
||||
updateChanceTotal(chanceToSpawn);
|
||||
const finalChance = updateChanceTotal(chanceToSpawn);
|
||||
l('CMTimerBarGCTime').textContent = `${Math.ceil(
|
||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||
)} ${getChanceFinal() < 0.01 ? '<' : ''}${getChanceFinal().toLocaleString('en', {
|
||||
)} `;
|
||||
if (finalChance < 0.01) {
|
||||
l('CMTimerBarGCTime').textContent +=
|
||||
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
|
||||
} else {
|
||||
l('CMTimerBarGCTime').textContent += finalChance.toLocaleString('en', {
|
||||
style: 'percent',
|
||||
})}`;
|
||||
});
|
||||
}
|
||||
numberOfTimers += 1;
|
||||
} else l('CMTimerBarGC').style.display = 'none';
|
||||
|
||||
@@ -174,12 +175,18 @@ export function UpdateTimerBar() {
|
||||
(Game.shimmerTypes.reindeer.time - Game.shimmerTypes.reindeer.minTime) /
|
||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime),
|
||||
) ** 5;
|
||||
updateChanceTotalDeer(chanceToSpawn);
|
||||
const deerFinalChance = updateChanceTotalDeer(chanceToSpawn);
|
||||
l('CMTimerBarRenTime').textContent = `${Math.ceil(
|
||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||
)} ${getChanceFinalDeer() < 0.01 ? '<' : ''}${getChanceFinalDeer().toLocaleString('en', {
|
||||
)} `;
|
||||
if (deerFinalChance < 0.01) {
|
||||
l('CMTimerBarRenTime').textContent +=
|
||||
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
|
||||
} else {
|
||||
l('CMTimerBarRenTime').textContent += deerFinalChance.toLocaleString('en', {
|
||||
style: 'percent',
|
||||
})}`;
|
||||
});
|
||||
}
|
||||
numberOfTimers += 1;
|
||||
} else {
|
||||
l('CMTimerBarRen').style.display = 'none';
|
||||
|
||||
@@ -12,39 +12,22 @@ export function resetChanceTotalDeer() {
|
||||
chanceTotalDeer = 1.0;
|
||||
}
|
||||
|
||||
export function getChanceTotal() {
|
||||
return chanceTotal;
|
||||
}
|
||||
|
||||
export function getChanceTotalDeer() {
|
||||
return chanceTotalDeer;
|
||||
}
|
||||
/**
|
||||
* Update the probability that a cookie has not spawned
|
||||
* @param {number} chanceToSpawn The probablity that a GC appears
|
||||
* @returns the cumulative probability that a GC has appeared from beginning to now
|
||||
*/
|
||||
export function updateChanceTotal(chanceToSpawn) {
|
||||
chanceTotal *= 1 - chanceToSpawn;
|
||||
return 1 - chanceTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the probability that a reindeer has not spawned
|
||||
* @param {number} chanceToSpawn The probablity that a reindeer appears
|
||||
* @returns the cumulative probability that a reindeer has appeared from beginning to now
|
||||
*/
|
||||
export function updateChanceTotalDeer(chanceToSpawn) {
|
||||
chanceTotalDeer *= 1 - chanceToSpawn;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @returns the cummulative probability that a GC has appeared from beginning to now
|
||||
*/
|
||||
export function getChanceFinal() {
|
||||
return 1 - chanceTotal;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @returns the cummulative probability that a reindeer has appeared from beginning to now
|
||||
*/
|
||||
export function getChanceFinalDeer() {
|
||||
return 1 - chanceTotalDeer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user