From b95ef2fe441f2d4352be8bac605ca567304630c9 Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Wed, 14 Oct 2020 23:09:30 -0400 Subject: [PATCH] Added "none" prestige type --- changelog.md | 26 ++++++++++++++------------ docs/layer-features.md | 15 ++++++++------- index.html | 6 ++++-- js/game.js | 7 ++++++- js/layers.js | 16 +++------------- js/utils.js | 2 ++ js/v.js | 2 +- 7 files changed, 38 insertions(+), 36 deletions(-) diff --git a/changelog.md b/changelog.md index e32a390..20a3f2d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ -#T he Modding Tree changelog: +# The Modding Tree changelog: -# v2.0 10/14/20 +## v2.0 10/14/20 - Added progress bars, which are highly customizable and can be horizontal or vertical! - Added "side layers", displayed smaller and off to the side, and don't get reset by default. They can be used for global achievements and statistics. Speaking of which... @@ -8,6 +8,7 @@ - Added clickables, a more generalized variant of buyables. - Almost every value in layer data can be either a function or a constant value! - Added support for multiple completions of challenges. +- Added "none" prestige type, which removes the need for any other prestige-related features. - The points display and other gui elements stay at the top of the screen when the tree scrolls. - Added getter/setter functions for the amounts and effects of most Big Features - Moved modInfo to game.js, added a spot in modInfo for a Discord link, changelog link. @@ -22,26 +23,27 @@ - Changed the reset functions to make keeping things easier - Renamed many things to increase readability (see something or other for a list) - Improved documentation based on feedback + [For a full list of changes to the format and functionality of existing things, click here.](2.0-format-changes.md) -## v1.3.5 +### v1.3.5 - Completely automated convertToDecimal, now you never have to worry about it again. - Branches can be defined without a color id. But they can also use hex values for color ids! - Created a tutorial for getting started with TMT and Github. - Page title is now automatically taken from mod name. -## v1.3.4: 10/8/20 +### v1.3.4: 10/8/20 - Added "midsection" feature to add things to a tab's layout while still keeping the standard layout. - Fix for being able to buy more buyables than you should. -## v1.3.3: - 10/7/20 +### v1.3.3: - 10/7/20 - Fix for the "order of operations" issue in temp. -## v1.3.1: - 10/7/20 +### v1.3.1: - 10/7/20 - Added custom CSS and tooltips for Layer Nodes. - Added custom CSS for upgrades, buyables, milestones, and challenges, both individually and layer-wide. @@ -64,20 +66,20 @@ -## v1.2.4 - 10/4/20 +### v1.2.4 - 10/4/20 - Layers are now highlighted if you can buy an upgrade, and a new feature, shouldNotify, lets you make it highlight other ways. - Fixed bugs with hasUpg, hasChall, hasMilestone, and inChallenge. - Changed the sample code to use the above functions for convenience. -## v1.2.3 - 10/3/20 +### v1.2.3 - 10/3/20 - Added a row component, which displays a list of objects in a row. - Added a column component, which displays a list of objects in a column (useful within a row). - Changed blanks to have a customizable width and height. -# v1.2: This Changes Everything! - 10/3/20 +## v1.2: This Changes Everything! - 10/3/20 - Many layer features can now be static values or functions. (This made some formats change, which will break old things) @@ -90,11 +92,11 @@ which will break old things) -## v1.1.1 +### v1.1.1 - You can define hotkeys directly from layer config. -# v1.1: Enhanced Edition +## v1.1: Enhanced Edition - Added "Buyables", which can function like Space Buildings or Enhancers. - Custom CSS can now be used on any component! Make the third argument an object with CSS @@ -102,5 +104,5 @@ parameters. - Lots of minor good things. -# v1.0: +## v1.0: - First release. \ No newline at end of file diff --git a/docs/layer-features.md b/docs/layer-features.md index 0752c75..2d782ff 100644 --- a/docs/layer-features.md +++ b/docs/layer-features.md @@ -96,6 +96,14 @@ Key: # Prestige formula features +- type: Determines which prestige formula you use. + "normal": The amount of currency you gain is independent of its current amount (like Prestige). + formula before bonuses is based on `baseResource^exponent` + "static": The cost is dependent on your total after reset. + formula before bonuses is based on `base^(x^exponent)` + "custom": You can define everything, from the calculations to the text on the button, yourself. (See more at the bottom) + "none": This layer does not prestige, and therefore does not need any of the other features in this section. + - baseResource: The name of the resource that determines how much of the main currency you gain on reset. - baseAmount(): A function that gets the current value of the base resource. @@ -104,13 +112,6 @@ Key: Also the amount required to unlock the layer. You can instead make this a function, to make it harder if another layer was unlocked first (based on "order"). -- type: Determines which prestige formula you use. - "normal": The amount of currency you gain is independent of its current amount (like Prestige). - formula before bonuses is based on `baseResource^exponent` - "static": The cost is dependent on your total after reset. - formula before bonuses is based on `base^(x^exponent)` - "custom": You can define everything, from the calculations to the text on the button, yourself. (See more at the bottom) - - exponent: Used as described above. - base: **sometimes required**, required for "static" layers, used as described above. diff --git a/index.html b/index.html index ea3c92b..3192a59 100644 --- a/index.html +++ b/index.html @@ -148,8 +148,10 @@


- -
You have {{formatWhole(tmp[layer].baseAmt)}} {{tmp[layer].baseResource}}
+
+ +
You have {{formatWhole(tmp[layer].baseAmt)}} {{tmp[layer].baseResource}}
+


Your best {{tmp[layer].resource}} is {{formatWhole(player[layer].best)}}
You have made a total of {{formatWhole(player[layer].total)}} {{tmp[layer].resource}}
diff --git a/js/game.js b/js/game.js index 0b799f9..f148a49 100644 --- a/js/game.js +++ b/js/game.js @@ -42,7 +42,8 @@ function getPointGen() { function getResetGain(layer, useType = null) { let type = useType if (!useType) type = layers[layer].type - + if(tmp[layer].type == "none") + return new Decimal (0) if (tmp[layer].gainExp.eq(0)) return new Decimal(0) if (type=="static") { if ((!layers[layer].canBuyMax()) || tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(1) @@ -63,6 +64,8 @@ function getResetGain(layer, useType = null) { function getNextAt(layer, canMax=false, useType = null) { let type = useType if (!useType) type = layers[layer].type + if(tmp[layer].type == "none") + return new Decimal (Infinity) if (tmp[layer].gainMult.lte(0)) return new Decimal(Infinity) if (tmp[layer].gainExp.lte(0)) return new Decimal(Infinity) @@ -110,6 +113,8 @@ function canReset(layer) return tmp[layer].baseAmount.gte(tmp[layer].requires) else if(tmp[layer].type== "static") return tmp[layer].baseAmount.gte(tmp[layer].nextAt) + if(tmp[layer].type == "none") + return false else return layers[layer].canReset() } diff --git a/js/layers.js b/js/layers.js index c7d43b4..a634b37 100644 --- a/js/layers.js +++ b/js/layers.js @@ -460,18 +460,8 @@ addLayer("a", { points: new Decimal(0), }}, color: "yellow", - requires: new Decimal (1), resource: "achievement power", - baseResource: "achievements", - baseAmount() {return player.points}, - type: "normal", // A "Custom" type which is effectively static - exponent: 0.5, - gainMult() { - return new Decimal(1) - }, - gainExp() { - return new Decimal(1) - }, + type: "none", row: "side", layerShown() {return true}, tooltip() { // Optional, tooltip displays when the layer is locked @@ -500,8 +490,8 @@ addLayer("a", { onComplete() {console.log("Bork bork bork!")} }, }, - tabFormat: [ - "main-display", "blank", "blank", "achievements", + midsection: [ + "achievements", ] }, ) diff --git a/js/utils.js b/js/utils.js index aff4914..3dd4083 100644 --- a/js/utils.js +++ b/js/utils.js @@ -608,6 +608,8 @@ function prestigeButtonText(layer) else if(tmp[layer].type== "static") return `${tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for "}+${formatWhole(tmp[layer].resetGain)} ${tmp[layer].resource}

${player[layer].points.lt(20) ? (tmp[layer].baseAmount.gte(tmp[layer].nextAt)&&(tmp[layer].canBuyMax !== undefined) && tmp[layer].canBuyMax?"Next":"Req") : ""}: ${formatWhole(tmp[layer].baseAmount)} / ${(tmp[layer].roundUpCost ? formatWhole(tmp[layer].nextAtDisp) : format(tmp[layer].nextAtDisp))} ${ tmp[layer].baseResource } ` + else if(tmp[layer].type == "none") + return "" else return layers[layer].prestigeButtonText() } diff --git a/js/v.js b/js/v.js index 2fa7637..2e70842 100644 --- a/js/v.js +++ b/js/v.js @@ -178,7 +178,7 @@ function loadVue() { Vue.component('prestige-button', { props: ['layer', 'data'], template: ` -