Add percentage to GC/Reindeer timer

This commit is contained in:
Daniël van Noord
2021-07-25 15:25:17 +02:00
parent 51713afaea
commit f60ac4889e
3 changed files with 22 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -118,9 +118,17 @@ export function UpdateTimerBar() {
) / Game.fps, ) / Game.fps,
); );
else l('CMTimerBarGCBar').textContent = ''; else l('CMTimerBarGCBar').textContent = '';
l('CMTimerBarGCTime').textContent = Math.ceil( const chanceToSpawn =
Math.max(
0,
(Game.shimmerTypes.golden.time - Game.shimmerTypes.golden.minTime) /
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime),
) ** 5;
l('CMTimerBarGCTime').textContent = `${Math.ceil(
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps, (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
); )} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
style: 'percent',
})}`;
numberOfTimers += 1; numberOfTimers += 1;
} else l('CMTimerBarGC').style.display = 'none'; } else l('CMTimerBarGC').style.display = 'none';
@@ -153,9 +161,17 @@ export function UpdateTimerBar() {
) / Game.fps, ) / Game.fps,
); );
else l('CMTimerBarRenBar').textContent = ''; else l('CMTimerBarRenBar').textContent = '';
l('CMTimerBarRenTime').textContent = Math.ceil( const chanceToSpawn =
Math.max(
0,
(Game.shimmerTypes.reindeer.time - Game.shimmerTypes.reindeer.minTime) /
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime),
) ** 5;
l('CMTimerBarRenTime').textContent = `${Math.ceil(
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps, (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
); )} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
style: 'percent',
})}`;
numberOfTimers += 1; numberOfTimers += 1;
} else { } else {
l('CMTimerBarRen').style.display = 'none'; l('CMTimerBarRen').style.display = 'none';