2021-05-13 21:44:07 +00:00
|
|
|
function hasUpgrade(layer, id) {
|
2021-05-15 16:31:58 +00:00
|
|
|
return ((player[layer].upgrades.includes(toNumber(id)) || player[layer].upgrades.includes(id.toString())) && !tmp[layer].deactivated)
|
2021-05-13 21:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function hasMilestone(layer, id) {
|
2021-05-15 16:31:58 +00:00
|
|
|
return ((player[layer].milestones.includes(toNumber(id)) || player[layer].milestones.includes(id.toString())) && !tmp[layer].deactivated)
|
2021-05-13 21:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function hasAchievement(layer, id) {
|
2021-05-15 16:31:58 +00:00
|
|
|
return ((player[layer].achievements.includes(toNumber(id)) || player[layer].achievements.includes(id.toString())) && !tmp[layer].deactivated)
|
2021-05-13 21:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function hasChallenge(layer, id) {
|
2021-05-15 16:31:58 +00:00
|
|
|
return ((player[layer].challenges[id]) && !tmp[layer].deactivated)
|
2021-05-13 21:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function maxedChallenge(layer, id) {
|
2021-05-15 16:31:58 +00:00
|
|
|
return ((player[layer].challenges[id] >= tmp[layer].challenges[id].completionLimit) && !tmp[layer].deactivated)
|
2021-05-13 21:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function challengeCompletions(layer, id) {
|
|
|
|
return (player[layer].challenges[id])
|
|
|
|
}
|
|
|
|
|
2024-10-27 22:22:34 +00:00
|
|
|
function canEnterChallenge(layer, id){
|
|
|
|
return tmp[layer].challenges[id].canEnter ?? true
|
|
|
|
}
|
|
|
|
|
|
|
|
function canExitChallenge(layer, id){
|
|
|
|
return tmp[layer].challenges[id].canExit ?? true
|
|
|
|
}
|
|
|
|
|
2021-05-13 21:44:07 +00:00
|
|
|
function getBuyableAmount(layer, id) {
|
|
|
|
return (player[layer].buyables[id])
|
|
|
|
}
|
|
|
|
|
|
|
|
function setBuyableAmount(layer, id, amt) {
|
|
|
|
player[layer].buyables[id] = amt
|
|
|
|
}
|
|
|
|
|
2021-06-02 21:02:46 +00:00
|
|
|
function addBuyables(layer, id, amt) {
|
|
|
|
player[layer].buyables[id] = player[layer].buyables[id].add(amt)
|
|
|
|
}
|
|
|
|
|
2021-05-13 21:44:07 +00:00
|
|
|
function getClickableState(layer, id) {
|
|
|
|
return (player[layer].clickables[id])
|
|
|
|
}
|
|
|
|
|
|
|
|
function setClickableState(layer, id, state) {
|
|
|
|
player[layer].clickables[id] = state
|
|
|
|
}
|
|
|
|
|
|
|
|
function getGridData(layer, id) {
|
|
|
|
return (player[layer].grid[id])
|
|
|
|
}
|
|
|
|
|
|
|
|
function setGridData(layer, id, data) {
|
|
|
|
player[layer].grid[id] = data
|
|
|
|
}
|
|
|
|
|
|
|
|
function upgradeEffect(layer, id) {
|
|
|
|
return (tmp[layer].upgrades[id].effect)
|
|
|
|
}
|
|
|
|
|
|
|
|
function challengeEffect(layer, id) {
|
|
|
|
return (tmp[layer].challenges[id].rewardEffect)
|
|
|
|
}
|
|
|
|
|
|
|
|
function buyableEffect(layer, id) {
|
|
|
|
return (tmp[layer].buyables[id].effect)
|
|
|
|
}
|
|
|
|
|
|
|
|
function clickableEffect(layer, id) {
|
|
|
|
return (tmp[layer].clickables[id].effect)
|
|
|
|
}
|
|
|
|
|
|
|
|
function achievementEffect(layer, id) {
|
|
|
|
return (tmp[layer].achievements[id].effect)
|
|
|
|
}
|
|
|
|
|
|
|
|
function gridEffect(layer, id) {
|
|
|
|
return (gridRun(layer, 'getEffect', player[layer].grid[id], id))
|
|
|
|
}
|