2020-10-10 03:16:29 +00:00
|
|
|
var tmp = {}
|
2020-10-07 22:41:03 +00:00
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
// Tmp will not call these
|
|
|
|
var activeFunctions = [
|
|
|
|
"startData", "onPrestige", "doReset", "update", "automate",
|
|
|
|
"buy", "buyMax", "respec", "onComplete", "onPurchase", "onPress"
|
|
|
|
]
|
2020-10-07 20:41:45 +00:00
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
function setupTemp() {
|
|
|
|
tmp = {}
|
|
|
|
setupTempData(layers, tmp)
|
2020-09-10 02:44:25 +00:00
|
|
|
|
2020-09-24 15:54:41 +00:00
|
|
|
for (layer in layers){
|
2020-10-10 03:16:29 +00:00
|
|
|
tmp[layer].resetGain = {}
|
|
|
|
tmp[layer].nextAt = {}
|
|
|
|
tmp[layer].nextAtDisp = {}
|
|
|
|
tmp[layer].notify = {}
|
|
|
|
tmp[layer].canReset = {}
|
|
|
|
tmp[layer].prestigeButtonText = {}
|
2020-10-09 03:13:15 +00:00
|
|
|
}
|
2020-10-07 21:00:02 +00:00
|
|
|
}
|
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
function setupTempData(layerData, tmpData) {
|
|
|
|
tmp.pointGen = {}
|
2020-10-07 21:00:02 +00:00
|
|
|
|
2020-10-07 21:13:16 +00:00
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
for (item in layerData){
|
|
|
|
if (layerData[item] == null) {
|
|
|
|
tmpData[item] = null
|
2020-09-14 02:41:42 +00:00
|
|
|
}
|
2020-10-10 03:16:29 +00:00
|
|
|
else if (Array.isArray(layerData[item])) {
|
|
|
|
tmpData[item] = []
|
|
|
|
setupTempData(layerData[item], tmpData[item])
|
2020-10-03 19:45:47 +00:00
|
|
|
}
|
2020-10-10 03:16:29 +00:00
|
|
|
else if ((!!layerData[item]) && (layerData[item].constructor === Object)) {
|
|
|
|
tmpData[item] = {}
|
|
|
|
setupTempData(layerData[item], tmpData[item])
|
2020-10-07 20:41:45 +00:00
|
|
|
}
|
2020-10-10 03:16:29 +00:00
|
|
|
else if (isFunction(layerData[item]) && !activeFunctions.includes(item)){
|
|
|
|
tmpData[item] = {}
|
|
|
|
} else {
|
|
|
|
tmpData[item] = layerData[item]
|
2020-10-07 21:13:16 +00:00
|
|
|
}
|
2020-10-10 03:16:29 +00:00
|
|
|
}
|
2020-10-07 21:13:16 +00:00
|
|
|
}
|
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
function updateTemp() {
|
|
|
|
if (tmp === undefined)
|
|
|
|
setupTemp()
|
2020-10-07 21:13:16 +00:00
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
updateTempData(layers, tmp)
|
2020-10-07 21:13:16 +00:00
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
for (layer in layers){
|
|
|
|
tmp[layer].resetGain = getResetGain(layer)
|
|
|
|
tmp[layer].nextAt = getNextAt(layer)
|
|
|
|
tmp[layer].nextAtDisp = getNextAt(layer, true)
|
|
|
|
tmp[layer].notify = shouldNotify(layer)
|
|
|
|
tmp[layer].canReset = canReset(layer)
|
|
|
|
tmp[layer].prestigeButtonText = prestigeButtonText(layer)
|
2020-10-07 21:13:16 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
tmp.pointGen = getPointGen()
|
2020-10-07 21:13:16 +00:00
|
|
|
}
|
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
function updateTempData(layerData, tmpData) {
|
2020-10-07 21:13:16 +00:00
|
|
|
|
2020-10-10 03:16:29 +00:00
|
|
|
for (item in layerData){
|
|
|
|
if (Array.isArray(layerData[item])) {
|
|
|
|
updateTempData(layerData[item], tmpData[item])
|
2020-10-03 19:45:47 +00:00
|
|
|
}
|
2020-10-10 03:16:29 +00:00
|
|
|
else if ((!!layerData[item]) && (layerData[item].constructor === Object)) {
|
|
|
|
updateTempData(layerData[item], tmpData[item])
|
2020-10-09 03:13:15 +00:00
|
|
|
}
|
2020-10-10 03:16:29 +00:00
|
|
|
else if (isFunction(layerData[item]) && !activeFunctions.includes(item)){
|
|
|
|
tmpData[item] = layerData[item]()
|
|
|
|
}
|
|
|
|
}
|
2020-10-11 01:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function updateChallTemp(layer)
|
|
|
|
{
|
|
|
|
updateTempData(layers[layer].challs, tmp[layer].challs)
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateBuyableTemp(layer)
|
|
|
|
{
|
|
|
|
updateTempData(layers[layer].buyables, tmp[layer].buyables)
|
2020-08-21 19:02:34 +00:00
|
|
|
}
|