mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-10 03:51:33 +00:00
canAfford and cost can work together
This commit is contained in:
parent
4bc8b7712a
commit
93b0fee963
4 changed files with 13 additions and 7 deletions
js
|
@ -11,7 +11,7 @@ let modInfo = {
|
|||
|
||||
// Set your version in num and name
|
||||
let VERSION = {
|
||||
num: "2.6",
|
||||
num: "2.6.0.1",
|
||||
name: "Fixed Reality",
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,12 @@ function respecBuyables(layer) {
|
|||
function canAffordUpgrade(layer, id) {
|
||||
let upg = tmp[layer].upgrades[id]
|
||||
if(tmp[layer].deactivated) return false
|
||||
if (tmp[layer].upgrades[id].canAfford !== undefined) return tmp[layer].upgrades[id].canAfford
|
||||
if (tmp[layer].upgrades[id].canAfford === false) return false
|
||||
let cost = tmp[layer].upgrades[id].cost
|
||||
return canAffordPurchase(layer, upg, cost)
|
||||
if (cost !== undefined)
|
||||
return canAffordPurchase(layer, upg, cost)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
function canBuyBuyable(layer, id) {
|
||||
|
@ -25,7 +28,6 @@ function canBuyBuyable(layer, id) {
|
|||
|
||||
|
||||
function canAffordPurchase(layer, thing, cost) {
|
||||
|
||||
if (thing.currencyInternalName) {
|
||||
let name = thing.currencyInternalName
|
||||
if (thing.currencyLocation) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue