diff --git a/README.md b/README.md index 9bbbef1..8320462 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ A modified version of The Prestige Tree that is much easier to mod. It still requires programming knowledge, but it's mostly pretty easy things and copy/pasting. -You can look in the [documentation](docs/general-info.md) for more information on how it all works, or look at the code in layers.js and sampleLayers.js to see what it all looks like. \ No newline at end of file +You can look in the [documentation](docs/!general-info.md) for more information on how it all works, or look at the code in layers.js and sampleLayers.js to see what it all looks like. \ No newline at end of file diff --git a/docs/general-info.md b/docs/!general-info.md similarity index 100% rename from docs/general-info.md rename to docs/!general-info.md diff --git a/docs/basic-layer-breakdown.md b/docs/basic-layer-breakdown.md index e39b705..9854146 100644 --- a/docs/basic-layer-breakdown.md +++ b/docs/basic-layer-breakdown.md @@ -1,4 +1,4 @@ -#Basic layer breakdown +# Basic layer breakdown This is a very minimal layer with minimal features. Most things will require additional features: diff --git a/docs/buyables.md b/docs/buyables.md new file mode 100644 index 0000000..9d30425 --- /dev/null +++ b/docs/buyables.md @@ -0,0 +1,39 @@ +# Buyables + +Buyables are things that can be bought multiple times with scaling costs. If you set a respec function, +the player can reset the purchases to get their currency back. + +Buyables should be formatted like this: + +``buyables: { + rows: # of rows + cols: # of columns + respec() {}, **optional**, implement it to reset things and give back your currency. + Having this function makes a respec button appear + respecText: **optional**, text that appears on the respec button + 11: { + desc: "Blah", + etc + } + etc +}`` + +Features: + +- title: **optional**, displayed at the top in a larger font + +- cost(x): cost for buying xth buyable, can be an object if there are multiple currencies + +- effect(x): **optional**, A function that calculates and returns the current values of bonuses + for having x of this buyable. Can return a value or an object containing multiple values. + +- display(): A function returning everything that should be displayed on the rebuyable after the title, likely + including the description, amount bought, cost, and current effect + +- unl(): A function returning a bool to determine if the buyable is visible or not. + +- canAfford(): A function returning a bool to determine if you can buy one of the buyables. + +- buy(): A function that implements buying one of the buyable. + +- buyMax(): **optional**, A function that implements buying as many of the buyable as possible. \ No newline at end of file diff --git a/docs/challenges.md b/docs/challenges.md index e19f1e2..29dd588 100644 --- a/docs/challenges.md +++ b/docs/challenges.md @@ -1,4 +1,4 @@ -#Challenges +# Challenges Challenges are stored in the following format: @@ -32,7 +32,7 @@ Individual upgrades can have these features: - goal: A Decimal for the cost of the upgrade. By default, the goal is in basic Points. -- unl(): A function returning a bool to determine if the challenge is unlocked or not. +- unl(): A function returning a bool to determine if the challenge is visible or not. - onComplete() - **optional**, this function will be called when the challenge is completed when previously incomplete. diff --git a/docs/custom-tab-layouts.md b/docs/custom-tab-layouts.md new file mode 100644 index 0000000..99fb50b --- /dev/null +++ b/docs/custom-tab-layouts.md @@ -0,0 +1,36 @@ +# Custom tab layouts + +Custom tab layouts can be used to do basically anything in a tab window, especially combined with the "style" layer feature. The tabFormat feature is an array of things, like this: + +``tabFormat: ["main-display", + ["prestige-button", function(){return "Melt your points into "}], + ["raw-html", function() {return ""}], + ["display-text", + function() {return 'I have ' + format(player.points) + ' pointy points!'}, + {"color": "red", "font-size": "32px", "font-family": "Comic Sans MS"}], + "blank", + ["toggle", ["c", "beep"]], + "milestones", "blank", "blank", "upgrades"]`` + +It is a list of components, which can be either just a name, or an array with arguments. If it's an array, the first item is the name of the component, the second is the data passed into it, and the third (optional) is a CSS object, +which applies its style to the component. + +These are the existing components, but you can create more in v.js: + +- display-text: Displays some text. The argument is a function which returns the text to display. + +- raw-html: Displays some HTML. The argument is a function which returns the HTML. It doesn't work with many vue things. + +- blank: An empty newline + +- main-display: The text that displays the main currency for the layer and its effects. + +- prestige-button: The argument is a function that returns what the prestige button should say before the amount of + currency you will gain. + +- upgrades, milestones, challs: Display the upgrades, milestones, and challenges for a layer, as appropriate. + +- buyables: Display all of the buyables for this layer, as appropriate. The argument optional, and is the size of the + boxes in pixels. + +- toggle: A toggle button that toggles a bool value. The data is a pair that identifies what bool to toggle, [layer, id] \ No newline at end of file diff --git a/docs/layer-features.md b/docs/layer-features.md index 339f005..16013a0 100644 --- a/docs/layer-features.md +++ b/docs/layer-features.md @@ -1,4 +1,4 @@ -#Layer Features +# Layer Features This is a more comprehensive list of established features to add to layers. You can add more freely, if you want to have other functions or values associated with your layer. These have special functionality, though. diff --git a/docs/upgrades.md b/docs/upgrades.md index bc6fbed..f37154b 100644 --- a/docs/upgrades.md +++ b/docs/upgrades.md @@ -1,4 +1,4 @@ -#Upgrades +# Upgrades Upgrades are stored in the following format: @@ -27,7 +27,7 @@ Individual upgrades can have these features: - cost: A Decimal for the cost of the upgrade. By default, upgrades cost the main prestige currency for the layer. -- unl(): A function returning a bool to determine if the upgrade is unlocked or not. +- unl(): A function returning a bool to determine if the upgrade is visible or not. - onPurchase() - **optional**, this function will be called when the upgrade is purchased. Good for upgrades like "makes this layer act like it was unlocked first". diff --git a/js/layers.js b/js/layers.js index eedbb13..b90474e 100644 --- a/js/layers.js +++ b/js/layers.js @@ -96,7 +96,7 @@ var layers = { let cost = Decimal.pow(2, x.pow(1.5)) return cost.floor() }, - effects(x) { // Effects of owning x of the items, x is a decimal + effect(x) { // Effects of owning x of the items, x is a decimal let eff = {} if (x.gte(0)) eff.first = Decimal.pow(25, x.pow(1.1)) else eff.first = Decimal.pow(1/25, x.times(-1).pow(1.1)) diff --git a/js/temp.js b/js/temp.js index b905c21..ff81b49 100644 --- a/js/temp.js +++ b/js/temp.js @@ -22,7 +22,7 @@ function updateTemp() { if (!tmp.buyables[layer][id]) tmp.buyables[layer][id] = {} tmp.buyables[layer][id] tmp.buyables[layer][id].cost = layers[layer].buyables[id].cost(player[layer].buyables[id]) - tmp.buyables[layer][id].effects = layers[layer].buyables[id].effects(player[layer].buyables[id]) + tmp.buyables[layer][id].effects = layers[layer].buyables[id].effect(player[layer].buyables[id]) } } diff --git a/sampleLayers.js b/sampleLayers.js index 7b9e95b..c7574d9 100644 --- a/sampleLayers.js +++ b/sampleLayers.js @@ -121,7 +121,7 @@ var layers = { let cost = Decimal.pow(2, x.pow(1.5)) return cost.floor() }, - effects(x) { // Effects of owning x of the items, x is a decimal + effect(x) { // Effects of owning x of the items, x is a decimal let eff = {} if (x.gte(0)) eff.first = Decimal.pow(25, x.pow(1.1)) else eff.first = Decimal.pow(1/25, x.times(-1).pow(1.1))