From 595d4916a60dd01d254bac1f405105ecfb8acb6e Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Thu, 3 Dec 2020 23:19:14 -0500 Subject: [PATCH] 2.2.8 --- changelog.md | 7 +++++++ docs/layer-features.md | 2 ++ js/Demo/demoLayers.js | 1 - js/Demo/demoMod.js | 2 +- js/components.js | 6 +++--- js/game.js | 8 +++++++- js/technical/layerSupport.js | 14 +++++++++----- js/technical/temp.js | 18 ++++++++++++++++++ js/utils.js | 5 ++++- style.css | 2 +- 10 files changed, 52 insertions(+), 13 deletions(-) diff --git a/changelog.md b/changelog.md index 6e3aac9..123f407 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # The Modding Tree changelog: +### v2.2.8 12/03/20 +- Double-clicking a layer node brings you to the main subtab for that layer. +- Attempted to fix challenges visually updating a different way. +- Added a softcap function for use in formulas. +- Added displayRow feature, which lets layers be shown somewhere separate from where they are in the reset order (e.g. side layers) +- Fixed autoupgrade issue. + ### v2.2.7 11/30/20 - Added autoUpgrade feature. - resource-display now shows resource gain per second if passiveGain is active. diff --git a/docs/layer-features.md b/docs/layer-features.md index 538f109..da7312e 100644 --- a/docs/layer-features.md +++ b/docs/layer-features.md @@ -27,6 +27,8 @@ You can make almost any value dynamic by using a function in its place, includin Using "side" instead of a number will cause the layer to appear off to the side as a smaller node (useful for achievements and statistics). Side layers are not affected by resets unless you add a doReset to them. +- displayRow: **OVERRIDE** Changes where the layer node appears without changing where it is in the reset order. + - resource: Name of the main currency you gain by resetting on this layer. - effect(): **optional**. A function that calculates and returns the current values of any bonuses inherent to the main currency. Can return a value or an object containing multiple values. *You will also have to implement the effect where it is applied.* diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index 1ba5098..0c4bbc0 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -15,7 +15,6 @@ addLayer("c", { beep: false, }}, color: "#4BDC13", - autoUpgrade: true, requires: new Decimal(10), // Can be a function that takes requirement increases into account resource: "lollipops", // Name of prestige currency baseResource: "candies", // Name of resource prestige is based on diff --git a/js/Demo/demoMod.js b/js/Demo/demoMod.js index eae2d18..1d58ef6 100644 --- a/js/Demo/demoMod.js +++ b/js/Demo/demoMod.js @@ -12,7 +12,7 @@ let modInfo = { // Set your version in num and name let VERSION = { - num: "2.2.7", + num: "2.2.8", name: "Uprooted", } diff --git a/js/components.js b/js/components.js index d7831b0..03d2a16 100644 --- a/js/components.js +++ b/js/components.js @@ -119,9 +119,9 @@ function loadVue() { Vue.component('challenge', { props: ['layer', 'data'], template: ` -
+



-

+


@@ -169,7 +169,7 @@ function loadVue() { template: `
-
diff --git a/js/game.js b/js/game.js index 3e78582..090d2ad 100644 --- a/js/game.js +++ b/js/game.js @@ -4,7 +4,7 @@ var gameEnded = false; // Don't change this const TMT_VERSION = { - tmtNum: "2.2.7.1", + tmtNum: "2.2.8", tmtName: "Uprooted" } @@ -59,6 +59,12 @@ function getNextAt(layer, canMax=false, useType = null) { return new Decimal(0) }} +function softcap(value, cap, power = 0.5) { + if (value.lte(cap)) return value + else + return value.pow(power).times(cap.pow(decimalOne.sub(power))) +} + // Return true if the layer should be highlighted. By default checks for upgrades only. function shouldNotify(layer){ if (player.tab == layer || player.navTab == layer) return false diff --git a/js/technical/layerSupport.js b/js/technical/layerSupport.js index 2639c0b..910cfc3 100644 --- a/js/technical/layerSupport.js +++ b/js/technical/layerSupport.js @@ -143,19 +143,23 @@ function updateLayers(){ if(layers[layer].base === undefined || layers[layer].base <= 1) layers[layer].base = 2 if(layers[layer].softcap === undefined) layers[layer].softcap = new Decimal("e1e7") if(layers[layer].softcapPower === undefined) layers[layer].softcapPower = new Decimal("0.5") + if(layers[layer].displayRow === undefined) layers[layer].displayRow = layers[layer].row let row = layers[layer].row + + let displayRow = layers[layer].displayRow + if(!ROW_LAYERS[row]) ROW_LAYERS[row] = {} - if(!TREE_LAYERS[row] && !isNaN(row)) TREE_LAYERS[row] = [] - if(!OTHER_LAYERS[row] && isNaN(row)) OTHER_LAYERS[row] = [] + if(!TREE_LAYERS[displayRow] && !isNaN(displayRow)) TREE_LAYERS[displayRow] = [] + if(!OTHER_LAYERS[displayRow] && isNaN(displayRow)) OTHER_LAYERS[displayRow] = [] ROW_LAYERS[row][layer]=layer; let position = (layers[layer].position !== undefined ? layers[layer].position : layer) - if (!isNaN(row)) TREE_LAYERS[row].push({layer: layer, position: position}) - else OTHER_LAYERS[row].push({layer: layer, position: position}) + if (!isNaN(displayRow)) TREE_LAYERS[displayRow].push({layer: layer, position: position}) + else OTHER_LAYERS[displayRow].push({layer: layer, position: position}) - if (maxRow < layers[layer].row) maxRow = layers[layer].row + if (maxRow < layers[layer].displayRow) maxRow = layers[layer].displayRow } for (row in OTHER_LAYERS) { diff --git a/js/technical/temp.js b/js/technical/temp.js index f058ba1..92e47a2 100644 --- a/js/technical/temp.js +++ b/js/technical/temp.js @@ -1,4 +1,5 @@ var tmp = {} +var temp = tmp // Proxy for tmp var NaNalert = false; // Tmp will not call these @@ -32,6 +33,7 @@ function setupTemp() { tmp[layer].prestigeButtonText = {} setupBarStyles(layer) } + temp = tmp } function setupTempData(layerData, tmpData) { @@ -75,6 +77,8 @@ function updateTemp() { tmp[layer].prestigeNotify = prestigeNotify(layer) tmp[layer].prestigeButtonText = prestigeButtonText(layer) constructBarStyles(layer) + updateChallengeDisplay(layer) + } tmp.pointGen = getPointGen() @@ -119,6 +123,20 @@ function updateTempData(layerData, tmpData) { function updateChallengeTemp(layer) { updateTempData(layers[layer].challenges, tmp[layer].challenges) + updateChallengeDisplay(layer) +} + +function updateChallengeDisplay(layer) { + for (id in player[layer].challenges) { + let style = "locked" + console.log(layer + " " + id) + if (player[layer].activeChallenge == id && canCompleteChallenge(layer, id)) style = "canComplete" + else if (hasChallenge(layer, id)) style = "done" + tmp[layer].challenges[id].defaultStyle = style + + tmp[layer].challenges[id].buttonText = (player[layer].activeChallenge==(id)?(canCompleteChallenge(layer, id)?"Finish":"Exit Early"):(hasChallenge(layer, id)?"Completed":"Start")) + } + } function updateBuyableTemp(layer) diff --git a/js/utils.js b/js/utils.js index 95cb654..0a8adec 100644 --- a/js/utils.js +++ b/js/utils.js @@ -627,7 +627,10 @@ function inChallenge(layer, id){ var onTreeTab = true function showTab(name) { if (LAYERS.includes(name) && !layerunlocked(name)) return - + if (player.tab === name && player.subtabs[name] && player.subtabs[name].mainTabs) { + console.log("momo") + player.subtabs[name].mainTabs = Object.keys(layers[name].tabFormat)[0] + } var toTreeTab = name == "none" player.tab = name if (player.navTab == "none" && (tmp[name].row !== "side") && (tmp[name].row !== "otherside")) player.lastSafeTab = name diff --git a/style.css b/style.css index 995a884..808b330 100644 --- a/style.css +++ b/style.css @@ -676,4 +676,4 @@ button > * { #treeTab td button { margin: 0 10px 0 10px; -} \ No newline at end of file +}