mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-22 00:21:32 +00:00
addBuyables
This commit is contained in:
parent
247ad64c58
commit
d1c00d681e
3 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
- The prestige/sec display now shows decimals.
|
- The prestige/sec display now shows decimals.
|
||||||
- resetsNothing now works immediately on a reset that enables it.
|
- resetsNothing now works immediately on a reset that enables it.
|
||||||
- Added onComplete for milestones.
|
- Added onComplete for milestones.
|
||||||
|
- Added addBuyables.
|
||||||
|
|
||||||
- Fixed challenges with no currencyDisplayName using "points" instead of the mod's pointsName.
|
- Fixed challenges with no currencyDisplayName using "points" instead of the mod's pointsName.
|
||||||
- inChallenge no longer can return undefined.
|
- inChallenge no longer can return undefined.
|
||||||
|
|
|
@ -7,6 +7,7 @@ The amount of a buyable owned is a `Decimal`.
|
||||||
Useful functions for dealing with buyables and implementing their effects:
|
Useful functions for dealing with buyables and implementing their effects:
|
||||||
|
|
||||||
- getBuyableAmount(layer, id): get the amount of the buyable the player has
|
- 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
|
- 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.
|
- buyableEffect(layer, id): Returns the current effects of the buyable, if any.
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,10 @@ function setBuyableAmount(layer, id, amt) {
|
||||||
player[layer].buyables[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) {
|
function getClickableState(layer, id) {
|
||||||
return (player[layer].clickables[id])
|
return (player[layer].clickables[id])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue