mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-05 15:51:05 +00:00
Fixed being able to buy more buyables than you should.
This commit is contained in:
parent
45ebf4c002
commit
1ae02a4328
2 changed files with 17 additions and 0 deletions
js
12
js/game.js
12
js/game.js
|
@ -229,6 +229,7 @@ function respecBuyables(layer) {
|
|||
if (!layers[layer].buyables.respec) return
|
||||
if (!confirm("Are you sure you want to respec? This will force you to do a \"" + (layers[layer].name ? layers[layer].name : layer) + "\" reset as well!")) return
|
||||
layers[layer].buyables.respec()
|
||||
updateBuyableTemp(layer)
|
||||
}
|
||||
|
||||
function canAffordUpg(layer, id) {
|
||||
|
@ -305,12 +306,23 @@ function buyUpg(layer, id) {
|
|||
upg.onPurchase()
|
||||
}
|
||||
|
||||
function buyMaxBuyable(layer, id) {
|
||||
if (!player[layer].unl) return
|
||||
if (!tmp.buyables[layer][id].unl) return
|
||||
if (!tmp.buyables[layer][id].canAfford) return
|
||||
if (!layers[layer].buyables[id].buyMax) return
|
||||
|
||||
layers[layer].buyables[id].buyMax()
|
||||
updateBuyableTemp(layer)
|
||||
}
|
||||
|
||||
function buyBuyable(layer, id) {
|
||||
if (!player[layer].unl) return
|
||||
if (!tmp.buyables[layer][id].unl) return
|
||||
if (!tmp.buyables[layer][id].canAfford) return
|
||||
|
||||
layers[layer].buyables[id].buy()
|
||||
updateBuyableTemp(layer)
|
||||
}
|
||||
|
||||
function resetRow(row) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue