From 65bd6be6305c16730b158fe0d3f78131c2a9e542 Mon Sep 17 00:00:00 2001 From: jwklong <72522395+jwklong@users.noreply.github.com> Date: Tue, 4 Jan 2022 17:01:54 +0000 Subject: [PATCH] v0.1.1 --- js/classes/prestigelayer.js | 4 ++-- js/components/changelog-tab.js | 6 ++++++ js/components/settings-menu.js | 7 ++++++- js/data/functions.js | 35 ++++++++++++++++++++++------------ js/data/game.js | 14 +++++++++----- js/main.js | 1 + js/mod.js | 9 +++++++-- 7 files changed, 54 insertions(+), 22 deletions(-) diff --git a/js/classes/prestigelayer.js b/js/classes/prestigelayer.js index 1271a90..862138e 100644 --- a/js/classes/prestigelayer.js +++ b/js/classes/prestigelayer.js @@ -392,10 +392,10 @@ class PrestigeLayer createUpgradeTree() { this.treeUpgrades = []; - const upgs = []; //this is still undefined, so local var is used + var upgs = []; //this is still undefined, so local var is used const rand = new Random(this.layer); const rows = 5 + rand.nextInt(2); - let amnt = 2; + let amnt = 1; let amntBefore = 1; const requiredUpgrade = function(row, col) diff --git a/js/components/changelog-tab.js b/js/components/changelog-tab.js index 2ea8e81..d0de013 100644 --- a/js/components/changelog-tab.js +++ b/js/components/changelog-tab.js @@ -1,6 +1,11 @@ Vue.component("changelog-tab", { template: `
+ + + + @@ -19,5 +24,6 @@ Vue.component("changelog-tab", { +
` }) \ No newline at end of file diff --git a/js/components/settings-menu.js b/js/components/settings-menu.js index ed4d11d..c5e743d 100644 --- a/js/components/settings-menu.js +++ b/js/components/settings-menu.js @@ -7,7 +7,8 @@ Vue.component("settings-menu", { " Click Import to load the save string from the text field.", themes: mod.themes, names: mod.layerNames, - fonts: mod.fonts + fonts: mod.fonts, + saves: mod.saves } }, mounted: function() @@ -96,6 +97,7 @@ Vue.component("settings-menu", { setTheme: css => functions.setTheme(css), setNames: js => functions.setNames(js), setFont: css => functions.setFont(css), + setSave: info => functions.setSave(info), volatilityUnlocked: () => functions.maxLayerUnlocked() >= 2 }, template: `
@@ -149,6 +151,9 @@ Vue.component("settings-menu", {
+
+ +
diff --git a/js/data/functions.js b/js/data/functions.js index b58cd86..b0a2caa 100644 --- a/js/data/functions.js +++ b/js/data/functions.js @@ -7,7 +7,7 @@ const functions = { } if(n.mag === Infinity) { - return "very much too big"; + return "Infinite"; } if(n.lt(0)) { @@ -106,9 +106,16 @@ const functions = { game.settings.layerNames = stuff; [LETTERS, ORDERS, GIANTS] = stuff; }, + setSave: function(info) + { + this.saveGame() + game.settings.saveInfo = info + this.hardResetGame(true) + this.loadGame() + }, createNotification: function(notification) { - if (saveTimer > 1){game.notifications.push(notification)}; + if (localTimer > 1){game.notifications.push(notification)}; }, getSaveString() { @@ -174,8 +181,9 @@ const functions = { game.timeSaved = Date.now(); try { - localStorage.setItem(mod.primaryName+mod.secondaryName, this.getSaveString()); - localStorage.setItem(mod.primaryName+mod.secondaryName+"_Settings", this.getSettingsSaveString()); + localStorage.setItem(mod.primaryName+mod.secondaryName+game.settings.saveInfo, this.getSaveString()); + localStorage.setItem(mod.primaryName+mod.secondaryName+"_Settings"+game.settings.saveInfo, this.getSettingsSaveString()); + localStorage.setItem(mod.primaryName+mod.secondaryName+"_SaveInfo", game.settings.saveInfo); if(game.settings.notifications && game.settings.saveNotifications) { functions.createNotification(new Notification(NOTIFICATION_STANDARD, "Game Saved!", "images/save.svg")); @@ -193,7 +201,8 @@ const functions = { { let loadObj; const isImported = typeof(str) !== "undefined"; - str = str || localStorage.getItem(mod.primaryName+mod.secondaryName) || null; + game.settings.saveInfo = game.settings.saveInfo === "i have no idea" ? localStorage.getItem(mod.primaryName+mod.secondaryName+"_SaveInfo") || "" : game.settings.saveInfo + str = str || localStorage.getItem(mod.primaryName+mod.secondaryName+game.settings.saveInfo) || null; if(str === null) return; if(str === "?") { @@ -294,12 +303,13 @@ const functions = { { try { - const settings = JSON.parse(decodeURIComponent(escape(atob(localStorage.getItem(mod.primaryName+mod.secondaryName+"_Settings"))))); + const settings = JSON.parse(decodeURIComponent(escape(atob(localStorage.getItem(mod.primaryName+mod.secondaryName+"_Settings"+game.settings.saveInfo))))); + settings.saveInfo = game.settings.saveInfo game.settings = Object.assign(game.settings, settings); } catch(e) { - console.warn("oopsie your settings are sus\n", e.stack); + console.warn("Error setting settings\n", e.stack); } } this.setTheme(game.settings.theme) @@ -308,7 +318,7 @@ const functions = { if(game.version !== loadObj.version) { - if(loadObj.version === "1") + if(loadObj.version === "1.0" || loadObj.version === "1") { for(const l of game.layers) { @@ -330,11 +340,12 @@ const functions = { functions.createNotification(new Notification(NOTIFICATION_STANDARD, "You were offline for " + functions.formatTime(t))); } } - + localTimer = 0 return true; }, - hardResetGame: function() + hardResetGame: function(changeSave) { + if (changeSave !== true) { let confirmations = 0; do { @@ -345,8 +356,8 @@ const functions = { } confirmations++; } while(confirmations < 3) - - localStorage.setItem(mod.primaryName+mod.secondaryName, null); + localStorage.setItem(mod.primaryName+mod.secondaryName+game.settings.saveInfo, null); + } game.currentLayer = null; game.layers = []; functions.generateLayer(0); diff --git a/js/data/game.js b/js/data/game.js index 5602e95..36db22a 100644 --- a/js/data/game.js +++ b/js/data/game.js @@ -1,5 +1,5 @@ const game = { - version: "1.0", + version: "1.1", timeSaved: Date.now(), layers: [], highestLayer: 0, @@ -79,7 +79,10 @@ const game = { }), }, achievements: [ - new Achievement("Coming soon", "in a later update", mod.primaryName, () => true), + new Achievement("You played!", "If you dont have this, you shouldn't exist", "ω", () => true), + new Achievement("Stacking up", "Do a restack and restart your progress", "κ", () => game.restackLayer.timesReset > 0), + new Achievement("No turning back", "Go meta and be reborn", "Ω", () => game.metaLayer.active), + new Achievement("Endgame", "Reach layer 1.8e308 and finish "+mod.primaryName+mod.secondaryName, "Ʊ", () => game.metaLayer.layer.gte(Infinities[0])), ], alephLayer: new AlephLayer(), restackLayer: new ReStackLayer(), @@ -107,9 +110,10 @@ const game = { confirmations: true, offlineProgress: true, titleStyle: 2, - theme: "css/themes/dark.css", - layerNames: ["αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ψϝϛͱϻϙͳϸ", ["Ω", "Ω2","Ω3"]], - font: "css/fonts/typespace.css" + theme: mod.themes[0][1], + layerNames: mod.layerNames[0][1], + font: mod.fonts[0][1], + saveInfo: "i have no idea" }, }; const initialGame = functions.getSaveString(); \ No newline at end of file diff --git a/js/main.js b/js/main.js index 5b65916..5a00525 100644 --- a/js/main.js +++ b/js/main.js @@ -34,6 +34,7 @@ function tickGame(seconds) { game.timeSpent += seconds; saveTimer += seconds; + localTimer += seconds; let titleInfo = ""; switch(game.settings.titleStyle) diff --git a/js/mod.js b/js/mod.js index e364ee7..1d9d099 100644 --- a/js/mod.js +++ b/js/mod.js @@ -1,8 +1,8 @@ var mod = { primaryName: "ω", secondaryName: "Engine", - version: "0.1.0 P2", - engineVer: "0.1.0 P2", //DO NOT MODIFY + version: "0.1.1", + engineVer: "0.1.1", //DO NOT MODIFY themes: [ ["Dark", "css/themes/dark.css"], ["Light", "https://veprogames.github.io/omega-layers/css/main.css"], @@ -42,6 +42,11 @@ var mod = { ["Comic Sans", "css/fonts/comic.css"], ["Arial", "css/fonts/arial.css"], ["Roboto", "css/fonts/roboto.css"] + ], + saves: [ + ["Save 1", ""], + ["Save 2", "2"], + ["Save 3", "3"] ] }