2020-08-21 19:02:34 +00:00
|
|
|
function updateTemp() {
|
2020-09-14 02:41:42 +00:00
|
|
|
if (!tmp.challActive) {
|
|
|
|
let LAYERS_WITH_CHALLS = Object.keys(LAYER_CHALLS)
|
|
|
|
tmp.challActive = {}
|
|
|
|
for (let i = 0; i < LAYERS_WITH_CHALLS.length; i++) {
|
|
|
|
tmp.challActive[LAYERS_WITH_CHALLS[i]] = {}
|
|
|
|
updateChallTemp(LAYERS_WITH_CHALLS[i])
|
2020-09-01 00:39:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
if (!tmp.layerEffs) tmp.layerEffs = {}
|
|
|
|
for (let name in LAYER_EFFS) tmp.layerEffs[name] = LAYER_EFFS[name]()
|
2020-09-12 14:26:57 +00:00
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
if (!tmp.layerReqs) tmp.layerReqs = {}
|
|
|
|
for (let name in LAYER_REQS) tmp.layerReqs[name] = getLayerReq(name)
|
2020-09-12 14:26:57 +00:00
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
if (!tmp.gainMults) tmp.gainMults = {}
|
2020-09-13 02:38:32 +00:00
|
|
|
if (!tmp.gainExp) tmp.gainExp = {}
|
2020-08-21 19:02:34 +00:00
|
|
|
if (!tmp.resetGain) tmp.resetGain = {}
|
|
|
|
if (!tmp.nextAt) tmp.nextAt = {}
|
2020-08-22 01:16:23 +00:00
|
|
|
if (!tmp.layerAmt) tmp.layerAmt = {}
|
2020-08-21 19:02:34 +00:00
|
|
|
for (let i in LAYERS) {
|
2020-08-22 01:16:23 +00:00
|
|
|
tmp.layerAmt[LAYERS[i]] = getLayerAmt(LAYERS[i])
|
2020-08-21 19:02:34 +00:00
|
|
|
tmp.gainMults[LAYERS[i]] = getLayerGainMult(LAYERS[i])
|
2020-09-13 02:38:32 +00:00
|
|
|
tmp.gainExp[LAYERS[i]] = getLayerGainExp(LAYERS[i])
|
2020-08-21 19:02:34 +00:00
|
|
|
tmp.resetGain[LAYERS[i]] = getResetGain(LAYERS[i])
|
|
|
|
tmp.nextAt[LAYERS[i]] = getNextAt(LAYERS[i])
|
|
|
|
}
|
2020-09-10 02:44:25 +00:00
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
tmp.pointGen = getPointGen()
|
2020-09-10 02:44:25 +00:00
|
|
|
|
2020-09-12 14:26:57 +00:00
|
|
|
tmp.scaling12b = getScaling12Boosters()
|
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
tmp.atbb = addToBoosterBase()
|
|
|
|
tmp.atgb = addToGenBase()
|
2020-09-10 02:44:25 +00:00
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
tmp.genPowEff = getGenPowerEff()
|
2020-09-10 02:44:25 +00:00
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
tmp.enhPow = getEnhancerPow()
|
|
|
|
tmp.enhEff = getEnhancerEff()
|
|
|
|
tmp.enhEff2 = getEnhancerEff2()
|
2020-08-31 18:33:29 +00:00
|
|
|
tmp.subbedEnh = new Decimal(0)
|
2020-09-14 02:41:42 +00:00
|
|
|
if (tmp.challActive ? tmp.challActive.h[52] : true) {
|
2020-09-14 19:26:10 +00:00
|
|
|
tmp.subbedEnh = tmp.subbedEnh.add(new Decimal(player.h.time).times(40).add(1).log10().pow(10).max(10)).round()
|
2020-09-01 02:11:22 +00:00
|
|
|
}
|
2020-09-10 02:44:25 +00:00
|
|
|
|
2020-08-21 19:02:34 +00:00
|
|
|
tmp.freeExtCap = getFreeExtCapsules()
|
|
|
|
tmp.timeEff = getTimeEnergyEff()
|
2020-09-08 00:11:57 +00:00
|
|
|
tmp.attb = addToTimeBase()
|
2020-09-12 14:26:57 +00:00
|
|
|
tmp.mttb = multiplyToTimeBase()
|
2020-09-10 02:44:25 +00:00
|
|
|
|
2020-09-11 23:10:57 +00:00
|
|
|
if (layerUnl("s")) {
|
2020-09-14 02:41:42 +00:00
|
|
|
tmp.s = {
|
2020-09-11 23:10:57 +00:00
|
|
|
sb: {},
|
|
|
|
sbEff: {}
|
|
|
|
}
|
|
|
|
var data = tmp.s
|
|
|
|
|
2020-09-14 02:41:42 +00:00
|
|
|
data.sbUnl = getSpaceBuildingsUnl()
|
|
|
|
data.trueSbUnl = Decimal.min(data.sbUnl, SPACE_BUILDINGS.max).floor().toNumber()
|
|
|
|
data.sbCostMult = getSpaceBuildingCostMult()
|
|
|
|
data.sbCostMod = getSpaceBuildingCostMod()
|
|
|
|
data.sbExtra = getExtraBuildingLevels()
|
|
|
|
data.sbPow = getSpaceBuildingPow()
|
|
|
|
data.sbSum = sumValues(player.s.buildings)
|
|
|
|
for (let i=data.trueSbUnl;i>=1;i--) {
|
|
|
|
data.sb[i] = fixValue(player.s.buildings[i])
|
|
|
|
data.sbEff[i] = getSpaceBuildingEff(i)
|
2020-09-11 23:10:57 +00:00
|
|
|
}
|
2020-09-10 02:44:25 +00:00
|
|
|
}
|
2020-08-26 01:45:22 +00:00
|
|
|
|
|
|
|
tmp.quirkEff = getQuirkEnergyEff()
|
2020-09-05 17:11:53 +00:00
|
|
|
tmp.qCB = getQuirkLayerCostBase()
|
2020-09-11 02:15:05 +00:00
|
|
|
|
2020-08-29 23:43:53 +00:00
|
|
|
tmp.ssEff1 = getSubspaceEff1()
|
|
|
|
tmp.ssEff2 = getSubspaceEff2()
|
|
|
|
tmp.ssEff3 = getSubspaceEff3()
|
2020-09-11 02:15:05 +00:00
|
|
|
|
2020-09-03 21:59:23 +00:00
|
|
|
tmp.balEff = getBalancePowerEff()
|
|
|
|
tmp.balEff2 = getBalanceTypesEff()
|
2020-09-04 02:25:24 +00:00
|
|
|
tmp.baExp = getBalanceEnergyExp()
|
2020-09-11 02:15:05 +00:00
|
|
|
|
2020-09-03 21:59:23 +00:00
|
|
|
tmp.hexEff = getHexEff()
|
2020-09-09 02:10:25 +00:00
|
|
|
tmp.spellsUnl = player.sp.upgrades.includes(13)?4:3
|
2020-09-03 21:59:23 +00:00
|
|
|
if (!tmp.spellEffs) tmp.spellEffs = {}
|
2020-09-09 02:10:25 +00:00
|
|
|
for (let i=1;i<=4;i++) tmp.spellEffs[i] = getSpellEff(i)
|
2020-09-11 02:15:05 +00:00
|
|
|
|
2020-09-04 17:45:22 +00:00
|
|
|
tmp.sGenPowEff = getSGenPowEff()
|
2020-09-11 02:15:05 +00:00
|
|
|
|
|
|
|
if (layerUnl("l")) {
|
|
|
|
if (!tmp.l) tmp.l = {
|
|
|
|
lb: {},
|
|
|
|
lbEff: {}
|
|
|
|
}
|
|
|
|
var data = tmp.l
|
|
|
|
var data2 = LIFE_BOOSTERS
|
|
|
|
|
|
|
|
data.lpEff = data2.eff()
|
|
|
|
data.lbUnl = data2.unl()
|
|
|
|
for (let i=1;i<=data2.max;i++) {
|
|
|
|
data.lb[i] = fixValue(player.l.boosters[i])
|
|
|
|
data.lbEff[i] = data2[i].eff(data.lb[i].times(data.lpEff))
|
|
|
|
}
|
|
|
|
}
|
2020-09-14 02:41:42 +00:00
|
|
|
|
2020-09-13 02:38:32 +00:00
|
|
|
if (layerUnl("hs")) {
|
|
|
|
if (!tmp.hs) tmp.hs = {
|
|
|
|
su: {},
|
|
|
|
suEff: {}
|
|
|
|
}
|
|
|
|
var data = tmp.hs
|
|
|
|
var data2 = HYPERSPACE
|
|
|
|
|
|
|
|
data.eff = data2.eff()
|
2020-09-14 02:41:42 +00:00
|
|
|
for (let i=1;i<=tmp.s.trueSbUnl;i++) data.su[i] = fixValue(player.hs.superUpgrades[i])
|
|
|
|
}
|
|
|
|
|
|
|
|
if (layerUnl("i")) {
|
|
|
|
if (!tmp.i) tmp.i = {}
|
|
|
|
var data = tmp.i
|
|
|
|
|
|
|
|
data.work = new Decimal(1)
|
2020-09-16 02:50:53 +00:00
|
|
|
if (player.i.building) data.work = data.work.add(player.i.extraBuildings.add(1).sqrt().add(1).div(5))
|
2020-09-14 02:41:42 +00:00
|
|
|
data.workEff = Decimal.pow(2, data.work.sub(1))
|
2020-09-16 14:25:07 +00:00
|
|
|
|
|
|
|
data.collapse = {}
|
|
|
|
for (var i = 1; i <= IMPERIUM.maxCollapseRows; i++) if (data.work.gt(i + 0.5)) data.collapse[i] = data.work.sub(i + 0.5).times(2).min(1)
|
|
|
|
|
|
|
|
data.compressed = tmp.s.sbUnl.sub(SPACE_BUILDINGS.max).max(0).floor().toNumber()
|
2020-09-14 02:41:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateChallTemp(layer) {
|
|
|
|
if (player[layer] === undefined) return
|
|
|
|
|
|
|
|
let data = tmp.challActive[layer]
|
|
|
|
let data2 = LAYER_CHALLS[layer]
|
|
|
|
let customActive = data2.active !== undefined
|
|
|
|
for (let row = 1; row <= data2.rows; row++) {
|
|
|
|
for (let col = 1; col <= data2.cols; col++) {
|
|
|
|
let id = row * 10 + col
|
|
|
|
if (customActive ? data2.active(id) : player[layer].active == id) data[id] = 1
|
|
|
|
else delete data[id]
|
|
|
|
}
|
2020-09-13 02:38:32 +00:00
|
|
|
}
|
2020-08-21 19:02:34 +00:00
|
|
|
}
|