Change auto-achievement to only hold one extra achievement

This commit is contained in:
SpectralFlame 2021-08-15 15:31:51 -05:00
parent 62a2175d89
commit d6f93572ae
2 changed files with 8 additions and 13 deletions

View File

@ -41,7 +41,7 @@ Vue.component("normal-achievements-tab", {
achievementPower: 0,
achTPeffect: 0,
achCountdown: 0,
availableAchieves: 0,
missingAchievements: 0,
showAutoAchieve: false,
isAutoAchieveActive: false,
hideCompletedRows: false,
@ -69,7 +69,7 @@ Vue.component("normal-achievements-tab", {
this.achievementPower = Achievements.power;
this.achTPeffect = RealityUpgrade(8).config.effect();
this.achCountdown = Achievements.timeToNextAutoAchieve / getGameSpeedupFactor();
this.availableAchieves = Achievements.availableAutoAchieves;
this.missingAchievements = Achievements.preReality.countWhere(a => !a.isUnlocked);
this.showAutoAchieve = PlayerProgress.realityUnlocked() && !Perk.achievementGroup6.isBought;
this.isAutoAchieveActive = player.reality.autoAchieve;
this.hideCompletedRows = player.options.hideCompletedAchievementRows;
@ -129,10 +129,10 @@ Vue.component("normal-achievements-tab", {
Automatically gain the next missing Achievement in {{ timeDisplayNoDecimals(achCountdown) }}.
(left-to-right, top-to-bottom)
</div>
<span v-if="availableAchieves > 0">
When turning Auto back on, you will immediately gain the next {{ formatInt(availableAchieves) }}
{{ "Achievement" | pluralize(availableAchieves, "Achievements") }}.
</span>
<div v-else-if="achCountdown === 0 && missingAchievements !== 0" class="c-achievements-tab__header">
Automatically gain the next missing Achievement as soon as you enable Auto Achievements.
(left-to-right, top-to-bottom)
</div>
<div class="l-achievement-grid">
<normal-achievement-row v-for="(row, i) in rows" :key="i" :row="row" />
</div>

View File

@ -110,7 +110,7 @@ const Achievements = {
autoAchieveUpdate(diff) {
if (!PlayerProgress.realityUnlocked()) return;
if (!player.reality.autoAchieve) {
player.reality.achTimer += diff;
player.reality.achTimer = Math.clampMax(player.reality.achTimer + diff, this.period);
return;
}
if (Achievements.preReality.every(a => a.isUnlocked)) return;
@ -136,12 +136,7 @@ const Achievements = {
if (!PlayerProgress.realityUnlocked()) return 0;
if (GameCache.achievementPeriod.value === 0) return 0;
if (Achievements.preReality.countWhere(a => !a.isUnlocked) === 0) return 0;
return (this.availableAutoAchieves + 1) * this.period - player.reality.achTimer;
},
get availableAutoAchieves() {
const allRemaining = Achievements.preReality.countWhere(a => !a.isUnlocked);
return Math.clampMax(Math.floor(player.reality.achTimer / this.period), allRemaining);
return this.period - player.reality.achTimer;
},
_power: new Lazy(() => {