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

Added remaining documentation docs

This commit is contained in:
Acamaeda 2020-10-01 01:30:59 -04:00
parent ea9daeb8d4
commit 857a423a58
11 changed files with 85 additions and 10 deletions

View file

@ -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.
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.

View file

@ -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:

39
docs/buyables.md Normal file
View file

@ -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.

View file

@ -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.

View file

@ -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 "<button onclick='console.log(`yeet`)'>'HI'</button>"}],
["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]

View file

@ -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.

View file

@ -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".

View file

@ -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))

View file

@ -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])
}
}

View file

@ -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))