mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-01-31 07:31:40 +00:00
a4f36d59fd
Did some stuff
157 lines
No EOL
4.5 KiB
JavaScript
157 lines
No EOL
4.5 KiB
JavaScript
function updateTemp() {
|
|
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])
|
|
}
|
|
}
|
|
|
|
if (!tmp.layerEffs) tmp.layerEffs = {}
|
|
for (let name in LAYER_EFFS) tmp.layerEffs[name] = LAYER_EFFS[name]()
|
|
|
|
if (!tmp.layerReqs) tmp.layerReqs = {}
|
|
for (let name in LAYER_REQS) tmp.layerReqs[name] = getLayerReq(name)
|
|
|
|
if (!tmp.gainMults) tmp.gainMults = {}
|
|
if (!tmp.gainExp) tmp.gainExp = {}
|
|
if (!tmp.resetGain) tmp.resetGain = {}
|
|
if (!tmp.nextAt) tmp.nextAt = {}
|
|
if (!tmp.nextAtDisp) tmp.nextAtDisp = {}
|
|
if (!tmp.layerAmt) tmp.layerAmt = {}
|
|
for (let i in LAYERS) {
|
|
tmp.layerAmt[LAYERS[i]] = getLayerAmt(LAYERS[i])
|
|
tmp.gainMults[LAYERS[i]] = getLayerGainMult(LAYERS[i])
|
|
tmp.gainExp[LAYERS[i]] = getLayerGainExp(LAYERS[i])
|
|
tmp.resetGain[LAYERS[i]] = getResetGain(LAYERS[i])
|
|
tmp.nextAt[LAYERS[i]] = getNextAt(LAYERS[i])
|
|
tmp.nextAtDisp[LAYERS[i]] = getNextAt(LAYERS[i], true)
|
|
}
|
|
|
|
tmp.pointGen = getPointGen()
|
|
|
|
tmp.scaling12b = getScaling12Boosters()
|
|
tmp.scaling12ps = getScaling12PS()
|
|
|
|
tmp.atbb = addToBoosterBase()
|
|
tmp.atgb = addToGenBase()
|
|
|
|
tmp.genPowEff = getGenPowerEff()
|
|
|
|
tmp.enhPow = getEnhancerPow()
|
|
tmp.enhEff = getEnhancerEff()
|
|
tmp.enhEff2 = getEnhancerEff2()
|
|
tmp.subbedEnh = new Decimal(0)
|
|
if (tmp.challActive ? tmp.challActive.h[52] : true) {
|
|
tmp.subbedEnh = tmp.subbedEnh.add(new Decimal(player.h.time).times(40).add(1).log10().pow(10).max(10)).round()
|
|
}
|
|
|
|
tmp.freeExtCap = getFreeExtCapsules()
|
|
tmp.timeEff = getTimeEnergyEff()
|
|
tmp.attb = addToTimeBase()
|
|
tmp.mttb = multiplyToTimeBase()
|
|
|
|
if (layerUnl("s")) {
|
|
tmp.s = {
|
|
sb: {},
|
|
sbEff: {}
|
|
}
|
|
var data = tmp.s
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
tmp.quirkEff = getQuirkEnergyEff()
|
|
tmp.qCB = getQuirkLayerCostBase()
|
|
|
|
tmp.ssEff1 = getSubspaceEff1()
|
|
tmp.ssEff2 = getSubspaceEff2()
|
|
tmp.ssEff3 = getSubspaceEff3()
|
|
|
|
tmp.balEff = getBalancePowerEff()
|
|
tmp.balEff2 = getBalanceTypesEff()
|
|
tmp.baExp = getBalanceEnergyExp()
|
|
|
|
tmp.hexEff = getHexEff()
|
|
tmp.spellsUnl = Math.min((player.sp.upgrades.includes(13)?4:3)+player.mb.extraSpells.toNumber(), MAX_SPELLS)
|
|
if (!tmp.spellEffs) tmp.spellEffs = {}
|
|
for (let i=1;i<=MAX_SPELLS;i++) tmp.spellEffs[i] = getSpellEff(i)
|
|
|
|
tmp.sGenPowEff = getSGenPowEff()
|
|
|
|
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] = new Decimal(fixValue(player.l.boosters[i]))
|
|
data.lbEff[i] = data2[i].eff(data.lb[i].times(data.lpEff))
|
|
}
|
|
}
|
|
|
|
if (layerUnl("hs")) {
|
|
if (!tmp.hs) tmp.hs = {
|
|
su: {},
|
|
suEff: {}
|
|
}
|
|
var data = tmp.hs
|
|
var data2 = HYPERSPACE
|
|
|
|
data.eff = data2.eff()
|
|
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)
|
|
if (player.i.building) data.work = data.work.add(player.i.extraBuildings.add(1).sqrt().add(1).div(5))
|
|
data.workEff = Decimal.pow(2, data.work.sub(1))
|
|
|
|
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()
|
|
}
|
|
|
|
if (layerUnl("mb")) {
|
|
if (!tmp.mb) tmp.mb = {}
|
|
var data = tmp.mb
|
|
|
|
data.spellBoost = player.mb.extraSpells.sub(MAX_SPELLS-4).max(0).plus(1).log10().div(2).plus(1).sqrt()
|
|
data.lbBoost = player.mb.extraBoosters.sub(LIFE_BOOSTERS.max-5).max(0).plus(1).log10().div(2).plus(1).sqrt()
|
|
}
|
|
}
|
|
|
|
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]
|
|
}
|
|
}
|
|
} |