Improve ACHNR behavior

This commit is contained in:
SpectralFlame 2023-02-02 22:12:26 -06:00 committed by cyip92
parent a75b1526a6
commit fe698ccfb9
3 changed files with 11 additions and 2 deletions

View File

@ -48,6 +48,12 @@ class PerkState extends SetPurchasableMechanicState {
onPurchased() {
if (this.config.bumpCurrency !== undefined) this.config.bumpCurrency();
if (this.label === "EU1" && Currency.eternities.gt(0)) applyEU1();
if (this.label === "ACHNR") {
if (Achievements.preReality.some(a => !a.isUnlocked)) player.reality.gainedAutoAchievements = true;
for (const achievement of Achievements.preReality) {
achievement.unlock(true);
}
}
GameCache.achievementPeriod.invalidate();
GameCache.buyablePerks.invalidate();
EventHub.dispatch(GAME_EVENT.PERK_BOUGHT);

View File

@ -482,7 +482,10 @@ GameDatabase.reality.perks = {
id: 205,
label: "ACHNR",
family: PERK_FAMILY.ACHIEVEMENT,
description: "Reality no longer resets your Achievements.",
get description() {
return `Immediately unlock the first ${formatInt(13)} rows of Achievements
and Reality no longer resets them.`;
},
automatorPoints: 10,
shortDescription: () => "Keep Achievements on Reality",
defaultPosition: new Vector(-195, -630)

View File

@ -77,7 +77,7 @@ export default {
this.totalCountdown = ((Achievements.preReality.countWhere(a => !a.isUnlocked) - 1) * Achievements.period +
Achievements.timeToNextAutoAchieve) / gameSpeedupFactor;
this.missingAchievements = Achievements.preReality.countWhere(a => !a.isUnlocked);
this.showAutoAchieve = PlayerProgress.realityUnlocked();
this.showAutoAchieve = PlayerProgress.realityUnlocked() && !Perk.achievementGroup5.isBought;
this.isAutoAchieveActive = player.reality.autoAchieve;
this.hideCompletedRows = player.options.hideCompletedAchievementRows;
this.achMultBreak = BreakInfinityUpgrade.achievementMult.canBeApplied;