1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 01:11:46 +00:00
The-Modding-Tree/js/utils/easyAccess.js

75 lines
1.9 KiB
JavaScript
Raw Normal View History

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])
}
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))
}