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

addBuyables

This commit is contained in:
Harley White 2021-06-02 17:02:46 -04:00
parent 247ad64c58
commit d1c00d681e
3 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,7 @@
- The prestige/sec display now shows decimals.
- resetsNothing now works immediately on a reset that enables it.
- Added onComplete for milestones.
- Added addBuyables.
- Fixed challenges with no currencyDisplayName using "points" instead of the mod's pointsName.
- inChallenge no longer can return undefined.

View file

@ -7,6 +7,7 @@ The amount of a buyable owned is a `Decimal`.
Useful functions for dealing with buyables and implementing their effects:
- getBuyableAmount(layer, id): get the amount of the buyable the player has
- addBuyables(layer, id, amount): add to the amount of the buyable
- setBuyableAmount(layer, id, amount): set the amount of the buyable the player has
- buyableEffect(layer, id): Returns the current effects of the buyable, if any.

View file

@ -30,6 +30,10 @@ function setBuyableAmount(layer, id, amt) {
player[layer].buyables[id] = amt
}
function addBuyables(layer, id, amt) {
player[layer].buyables[id] = player[layer].buyables[id].add(amt)
}
function getClickableState(layer, id) {
return (player[layer].clickables[id])
}