1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 16:13:55 +00:00

Fixed issues in the buyable docs

This commit is contained in:
Harley White 2021-05-07 18:37:24 -04:00
parent 124df2d3f9
commit 7aebcdeafc
2 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,7 @@
# The Modding Tree changelog:
- Fixed issues in the buyable docs
# v2.5.1 - 5/7/21
- Fixed dynamic things in tabFormat not updating.

View file

@ -15,12 +15,12 @@ Buyables should be formatted like this:
```js
buyables: {
11: {
cost(x) { return new Decimal(1).mul(x || getBuyableAmt(this.layer, this.id)) },
cost(x) { return new Decimal(1).mul(x) },
display() { return "Blah" },
canAfford() { return player[this.layer].points.gte(this.cost()) },
buy() {
player[this.layer].points = player[this.layer].points.sub(this.cost())
setBuyableAmount(this.layer, this.id, getBuyableAmt(this.layer, this.id).add(1))
setBuyableAmount(this.layer, this.id, getBuyableAmount(this.layer, this.id).add(1))
},
etc
},
@ -68,7 +68,7 @@ Including a `sellOne` or `sellAll` function will cause an additional button to a
To add a respec button, or something similar, add the respecBuyables function to the main buyables object (not individual buyables).
You can use these features along with it:
- respecBuyables(): **optional**. This is called when the button is pressed (after a toggleable confirmation message).
- respec(): **optional**. This is called when the button is pressed (after a toggleable confirmation message).
- respecText: **optional**. Text to display on the respec Button.