1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 17:31:50 +00:00

Added "none" prestige type

This commit is contained in:
Acamaeda 2020-10-14 23:09:30 -04:00
parent fd61aaf7b3
commit b95ef2fe44
7 changed files with 38 additions and 36 deletions

View file

@ -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 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. - 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... They can be used for global achievements and statistics. Speaking of which...
@ -8,6 +8,7 @@
- Added clickables, a more generalized variant of buyables. - Added clickables, a more generalized variant of buyables.
- Almost every value in layer data can be either a function or a constant value! - Almost every value in layer data can be either a function or a constant value!
- Added support for multiple completions of challenges. - 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. - 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 - 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. - 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 - Changed the reset functions to make keeping things easier
- Renamed many things to increase readability (see something or other for a list) - Renamed many things to increase readability (see something or other for a list)
- Improved documentation based on feedback - 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) [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. - 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! - 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. - Created a tutorial for getting started with TMT and Github.
- Page title is now automatically taken from mod name. - 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. - 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. - 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. - 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 and tooltips for Layer Nodes.
- Added custom CSS for upgrades, buyables, milestones, and challenges, both individually and layer-wide. - 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, - Layers are now highlighted if you can buy an upgrade, and a new feature, shouldNotify,
lets you make it highlight other ways. lets you make it highlight other ways.
- Fixed bugs with hasUpg, hasChall, hasMilestone, and inChallenge. - Fixed bugs with hasUpg, hasChall, hasMilestone, and inChallenge.
- Changed the sample code to use the above functions for convenience. - 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 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). - 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. - 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, - Many layer features can now be static values or functions. (This made some formats change,
which will break old things) 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. - 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. - 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 - 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. - Lots of minor good things.
# v1.0: ## v1.0:
- First release. - First release.

View file

@ -96,6 +96,14 @@ Key:
# Prestige formula features # 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. - 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. - 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. 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"). 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. - exponent: Used as described above.
- base: **sometimes required**, required for "static" layers, used as described above. - base: **sometimes required**, required for "static" layers, used as described above.

View file

@ -148,8 +148,10 @@
<button class="back" onclick="showTab('tree')"></button><br><br><br> <button class="back" onclick="showTab('tree')"></button><br><br><br>
<div v-if="!layers[layer].tabFormat"> <div v-if="!layers[layer].tabFormat">
<main-display v-bind:style="tmp[layer].componentStyles['main-display']" :layer="layer"></main-display> <main-display v-bind:style="tmp[layer].componentStyles['main-display']" :layer="layer"></main-display>
<prestige-button v-bind:style="tmp[layer].componentStyles['prestige-button']" :layer="layer"></prestige-button> <div v-if="tmp[layer].type !== 'none'">
<span v-if="tmp[layer].type=='normal' && tmp[layer].resetGain.lt(100) && player[layer].points.lt(1e3)"><br>You have {{formatWhole(tmp[layer].baseAmt)}} {{tmp[layer].baseResource}}</span> <prestige-button v-bind:style="tmp[layer].componentStyles['prestige-button']" :layer="layer"></prestige-button>
<span v-if="tmp[layer].type=='normal' && tmp[layer].resetGain.lt(100) && player[layer].points.lt(1e3)"><br>You have {{formatWhole(tmp[layer].baseAmt)}} {{tmp[layer].baseResource}}</span>
</div>
<br><br> <br><br>
<span v-if="player[layer].best != undefined">Your best {{tmp[layer].resource}} is {{formatWhole(player[layer].best)}}<br></span> <span v-if="player[layer].best != undefined">Your best {{tmp[layer].resource}} is {{formatWhole(player[layer].best)}}<br></span>
<span v-if="player[layer].total != undefined">You have made a total of {{formatWhole(player[layer].total)}} {{tmp[layer].resource}}<br></span> <span v-if="player[layer].total != undefined">You have made a total of {{formatWhole(player[layer].total)}} {{tmp[layer].resource}}<br></span>

View file

@ -42,7 +42,8 @@ function getPointGen() {
function getResetGain(layer, useType = null) { function getResetGain(layer, useType = null) {
let type = useType let type = useType
if (!useType) type = layers[layer].type 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 (tmp[layer].gainExp.eq(0)) return new Decimal(0)
if (type=="static") { if (type=="static") {
if ((!layers[layer].canBuyMax()) || tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(1) 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) { function getNextAt(layer, canMax=false, useType = null) {
let type = useType let type = useType
if (!useType) type = layers[layer].type 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].gainMult.lte(0)) return new Decimal(Infinity)
if (tmp[layer].gainExp.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) return tmp[layer].baseAmount.gte(tmp[layer].requires)
else if(tmp[layer].type== "static") else if(tmp[layer].type== "static")
return tmp[layer].baseAmount.gte(tmp[layer].nextAt) return tmp[layer].baseAmount.gte(tmp[layer].nextAt)
if(tmp[layer].type == "none")
return false
else else
return layers[layer].canReset() return layers[layer].canReset()
} }

View file

@ -460,18 +460,8 @@ addLayer("a", {
points: new Decimal(0), points: new Decimal(0),
}}, }},
color: "yellow", color: "yellow",
requires: new Decimal (1),
resource: "achievement power", resource: "achievement power",
baseResource: "achievements", type: "none",
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)
},
row: "side", row: "side",
layerShown() {return true}, layerShown() {return true},
tooltip() { // Optional, tooltip displays when the layer is locked tooltip() { // Optional, tooltip displays when the layer is locked
@ -500,8 +490,8 @@ addLayer("a", {
onComplete() {console.log("Bork bork bork!")} onComplete() {console.log("Bork bork bork!")}
}, },
}, },
tabFormat: [ midsection: [
"main-display", "blank", "blank", "achievements", "achievements",
] ]
}, },
) )

View file

@ -608,6 +608,8 @@ function prestigeButtonText(layer)
else if(tmp[layer].type== "static") else if(tmp[layer].type== "static")
return `${tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for "}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource}<br><br>${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 } return `${tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for "}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource}<br><br>${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 else
return layers[layer].prestigeButtonText() return layers[layer].prestigeButtonText()
} }

View file

@ -178,7 +178,7 @@ function loadVue() {
Vue.component('prestige-button', { Vue.component('prestige-button', {
props: ['layer', 'data'], props: ['layer', 'data'],
template: ` template: `
<button v-bind:class="{ [layer]: true, reset: true, locked: !tmp[layer].canReset, can: tmp[layer].canReset}" <button v-if="(tmp[layer].type !== 'none')" v-bind:class="{ [layer]: true, reset: true, locked: !tmp[layer].canReset, can: tmp[layer].canReset}"
v-bind:style="[tmp[layer].canReset ? {'background-color': tmp[layer].color} : {}, tmp[layer].componentStyles['prestige-button']]" v-bind:style="[tmp[layer].canReset ? {'background-color': tmp[layer].color} : {}, tmp[layer].componentStyles['prestige-button']]"
v-html="tmp[layer].prestigeButtonText" v-on:click="doReset(layer)"> v-html="tmp[layer].prestigeButtonText" v-on:click="doReset(layer)">
</button> </button>