5 new secret achievements

This commit is contained in:
WaitingIdly 2022-05-17 11:18:35 -07:00
parent 61dd6ff82f
commit aba3fca2cc
5 changed files with 33 additions and 15 deletions

View File

@ -80,6 +80,8 @@ export const Enslaved = {
player.celestials.enslaved.isStoringReal = false;
player.celestials.enslaved.storedReal = maxTime;
}
// More than 24 hours in milliseconds
if (player.celestials.enslaved.storedReal > (24 * 60 * 60 * 1000)) SecretAchievement(46).unlock();
player.lastUpdate = thisUpdate;
},
autoStoreRealTime(diffMs) {

View File

@ -146,8 +146,8 @@ GameDatabase.achievements.secret = [
},
{
id: 38,
name: "Professional bodybuilder",
description: "This one is getting replaced due to a recent PR."
name: "Knife's edge",
description: "Be about to do a Hard Reset, but cancel out."
},
{
id: 41,
@ -161,10 +161,10 @@ GameDatabase.achievements.secret = [
},
{
id: 43,
name: "Time fixes everything",
description: "Fix infinity while Dilated.",
checkRequirement: () => player.dilation.active,
checkEvent: GAME_EVENT.FIX_INFINITY
name: "A cacophonous chorus",
description: "Have all equipped Glyphs be Music Glyphs.",
checkRequirement: () => Glyphs.active.every(x => x?.symbol === "key266b"),
checkEvent: GAME_EVENT.GLYPHS_EQUIPPED_CHANGED
},
{
id: 44,
@ -181,17 +181,17 @@ GameDatabase.achievements.secret = [
},
{
id: 46,
name: "s46",
description: "s46"
name: "For a rainy day",
description: "Store a day of real time."
},
{
id: 47,
name: "s47",
description: "s47"
name: "Clean Slate",
description: "Hide every possible tab."
},
{
id: 48,
name: "s48",
description: "s48"
name: "Average programmer experience.jpg",
description: "Have more Automator errors than lines."
},
];

View File

@ -61,6 +61,8 @@ class SubtabState {
if (this._parent.id === Tabs.current.id && this.id === Tabs.current._currentSubtab.id) return;
// eslint-disable-next-line no-bitwise
player.options.hiddenSubtabBits[this._parent.id] ^= (1 << this.id);
checkTabVisibilityForSecretAchievement();
}
get isOpen() {
@ -161,6 +163,8 @@ class TabState {
if (this.id === Tabs.current.id) return;
// eslint-disable-next-line no-bitwise
player.options.hiddenTabBits ^= (1 << this.id);
checkTabVisibilityForSecretAchievement();
}
resetToAvailable() {
@ -219,6 +223,11 @@ export const Tabs = (function() {
};
}());
const checkTabVisibilityForSecretAchievement = () => {
// Checks if every unlocked tab that is hidable is hidden
if (Tabs.all.filter(t => t.isUnlocked && t.hidable).every(t => t.isHidden)) SecretAchievement(47).unlock();
};
EventHub.logic.on(GAME_EVENT.TAB_CHANGED, () => {
const currTab = Tabs.current.id;
player.options.lastOpenTab = currTab;

View File

@ -16,10 +16,12 @@ export default {
return this.input === "Shrek is love, Shrek is life";
},
},
destroyed() {
if (this.willHardReset) SecretAchievement(38).unlock();
},
methods: {
hardReset() {
if (!this.willHardReset) return;
GameStorage.hardReset();
if (this.willHardReset) GameStorage.hardReset();
},
},
};

View File

@ -127,7 +127,12 @@ export const AutomatorTextUI = {
});
this.editor.on("change", editor => {
const scriptID = ui.view.tabs.reality.automator.editorScriptID;
AutomatorBackend.saveScript(scriptID, editor.getDoc().getValue());
const scriptText = editor.getDoc().getValue();
AutomatorBackend.saveScript(scriptID, scriptText);
const errors = AutomatorData.currentErrors(scriptText).length;
if (errors > editor.doc.size) SecretAchievement(48).unlock();
// Clear all line highlighting as soon as any text is changed. We can't use the locations of previously
// highlighted lines because changes may shift the line numbers around before they're cleared.
this.clearAllHighlightedLines("Active");