From d096c3c9b20667fe4b85220ec39fe2983c7ece1c Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Wed, 21 Oct 2020 16:14:42 -0400 Subject: [PATCH] 2.1.3 --- changelog.md | 5 +++++ docs/layer-features.md | 2 +- index.html | 2 +- js/Demo/demoLayers.js | 7 +------ js/game.js | 6 ++++-- js/layerSupport.js | 5 +++-- js/utils.js | 2 ++ js/v.js | 4 ++-- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/changelog.md b/changelog.md index 9249f74..0b38b9c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,12 @@ # The Modding Tree changelog: +### v2.1.3 - 10/21/20 +- gainMult and gainExp are now optional. +- Layer unlocking is now kept on reset. +- Game should start up faster. - Layer updates now have a determined order and starts with earlier-rowed layers. - Automation now has a determined order and starts with later-rowed layers. +- Fixed issues with resetting clickables and challenges. - Commas should no longer appear in the decimal places of a number. - Fixed potential issue in displaying the tree. diff --git a/docs/layer-features.md b/docs/layer-features.md index d57cf34..f5dfe60 100644 --- a/docs/layer-features.md +++ b/docs/layer-features.md @@ -122,7 +122,7 @@ Key: - canBuyMax(): **sometimes required**, required for static layers, function used to determine if buying max is permitted. -- gainMult(), gainExp(): Functions that calculate the multiplier and exponent on resource gain from upgrades +- gainMult(), gainExp(): **optional**, Functions that calculate the multiplier and exponent on resource gain from upgrades and boosts and such. Plug in any bonuses here. - onPrestige(gain): **optional**, A function that triggers when this layer prestiges, just before you gain the currency. diff --git a/index.html b/index.html index 6e3f32a..c524d18 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ - +
diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index 931af7c..2889d72 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -369,12 +369,7 @@ addLayer("f", { base: 3, roundUpCost: true, canBuyMax() {return hasAchievement('a', 13)}, - gainMult() { - return new Decimal(1) - }, - gainExp() { - return new Decimal(1) - }, + row: 1, layerShown() {return true}, branches: ["c"], // When this layer appears, a branch will appear from this layer to any layers here. Each entry can be a pair consisting of a layer id and a color. diff --git a/js/game.js b/js/game.js index 2ddb615..ae4ef4e 100644 --- a/js/game.js +++ b/js/game.js @@ -101,7 +101,7 @@ function rowReset(row, layer) { } function layerDataReset(layer, keep = []) { - let storedData = {} + let storedData = {unlocked: player[layer].unlocked} // Always keep unlocked for (thing in keep) { if (player[layer][keep[thing]] !== undefined) @@ -111,8 +111,10 @@ function layerDataReset(layer, keep = []) { player[layer] = layers[layer].startData(); player[layer].upgrades = [] player[layer].milestones = [] - player[layer].challenges = [] + player[layer].challenges = getStartChallenges(layer) resetBuyables(layer) + if (layers[layer].clickables && !player[layer].clickables) + player[layer].clickables = getStartClickables(layer) for (thing in storedData) { player[layer][thing] =storedData[thing] diff --git a/js/layerSupport.js b/js/layerSupport.js index f1cbabb..eae6060 100644 --- a/js/layerSupport.js +++ b/js/layerSupport.js @@ -115,7 +115,9 @@ function updateLayers(){ if(!layers[layer].componentStyles) layers[layer].componentStyles = {} if(layers[layer].symbol === undefined) layers[layer].symbol = layer.charAt(0).toUpperCase() + layer.slice(1) - if(layers[layer].unlockOrder === undefined) layers[layer].unlockOrder = 0 + if(layers[layer].unlockOrder === undefined) layers[layer].unlockOrder = [] + if(layers[layer].gainMult === undefined) layers[layer].gainMult = new Decimal(1) + if(layers[layer].gainExp === undefined) layers[layer].gainExp = new Decimal(1) let row = layers[layer].row if(!ROW_LAYERS[row]) ROW_LAYERS[row] = {} @@ -142,7 +144,6 @@ function updateLayers(){ function addLayer(layerName, layerData){ // Call this to add layers from a different file! layers[layerName] = layerData - updateLayers() } // If data is a function, return the result of calling it. Otherwise, return the data. diff --git a/js/utils.js b/js/utils.js index 7df9668..70a59f4 100644 --- a/js/utils.js +++ b/js/utils.js @@ -222,6 +222,8 @@ function load() { versionCheck(); changeTheme(); changeTreeQuality(); + updateLayers() + setupTemp(); updateTemp(); updateTemp(); diff --git a/js/v.js b/js/v.js index 9364667..7ac6e50 100644 --- a/js/v.js +++ b/js/v.js @@ -160,10 +160,10 @@ function loadVue() { Vue.component('milestone', { props: ['layer', 'data'], template: ` - +



-   +   ` })