diff --git a/index.html b/index.html index d18e742..dac1385 100644 --- a/index.html +++ b/index.html @@ -409,10 +409,17 @@ - + - + +


+ +
+ + + +


@@ -471,10 +478,10 @@ You have {{ format(player.g.power) }} Generator Power


-
-

-
- +
+

+
+
diff --git a/js/canvas.js b/js/canvas.js index b41771e..58d2c5c 100644 --- a/js/canvas.js +++ b/js/canvas.js @@ -83,6 +83,17 @@ function drawTree() { if (layerUnl('i')) { drawTreeBranch("ss", "i") } + if (layerUnl('mb')) { + drawTreeBranch("l", "mb") + drawTreeBranch("ps", "mb", 2) + } + if (layerUnl('ge')) { + drawTreeBranch("sp", "ge") + } + if (layerUnl('ma')) { + drawTreeBranch("hs", "ma") + drawTreeBranch("i", "ma") + } needCanvasUpdate = false; } diff --git a/js/game.js b/js/game.js index e62abc7..afd561f 100644 --- a/js/game.js +++ b/js/game.js @@ -175,10 +175,27 @@ function getStartPlayer() { total: new Decimal(0), upgrades: [], }, + l: { + unl: false, + order: 0, + points: new Decimal(0), + best: new Decimal(0), + upgrades: [], + power: new Decimal(0), + boosters: {}, + }, + hs: { + unl: false, + order: 0, + points: new Decimal(0), + best: new Decimal(0), + upgrades: [], + hyperUpgrades: {}, + }, } } -const LAYERS = ["p", "b", "g", "e", "t", "s", "sb", "sg", "h", "q", "hb", "ss", "m", "ba", "sp"] +const LAYERS = ["p", "b", "g", "e", "t", "s", "sb", "sg", "h", "q", "hb", "ss", "m", "ba", "sp", "l", "hs"] const LAYER_REQS = { p: new Decimal(10), @@ -196,6 +213,8 @@ const LAYER_REQS = { m: new Decimal(1e80), ba: new Decimal(1e130), sp: new Decimal("1e8500000"), + l: new Decimal(1415), + hs: new Decimal(715), } const LAYER_RES = { @@ -214,6 +233,8 @@ const LAYER_RES = { m: "magic", ba: "balance energy", sp: "super-prestige points", + l: "life essence", + hs: "hyperspace", } const LAYER_RES_CEIL = ["sb", "sg", "hb", "ss"] @@ -234,6 +255,8 @@ const LAYER_TYPE = { m: "normal", ba: "normal", sp: "normal", + l: "normal", + hs: "normal", } const LAYER_EXP = { @@ -252,6 +275,8 @@ const LAYER_EXP = { m: new Decimal(0.01), ba: new Decimal(0.00667), sp: new Decimal(2e-7), + l: new Decimal(1e-9), + hs: new Decimal(1e-9), } const LAYER_BASE = { @@ -281,6 +306,8 @@ const LAYER_ROW = { m: 4, ba: 4, sp: 5, + l: 5, + hs: 5, future_layer: 6, } @@ -290,7 +317,7 @@ const ROW_LAYERS = [ ["e","t","s","sb","sg"], ["h","q","hb","ss"], ["m","ba"], - ["sp"], + ["sp","l","hs"], ["future_layer"], ] @@ -299,8 +326,8 @@ const ORDER_UP = [ [], ["e","t","s","sb"], ["hb","ss"], - ["sp"], [], + ["l","hs"], ] const LAYER_EFFS = { @@ -803,7 +830,7 @@ const LAYER_UPGS = { desc: "Space Building Levels boost Generator Power gain, and get 2 extra Space.", cost: new Decimal(3), unl: function() { return player.s.upgrades.includes(11) }, - currently: function() { return Decimal.pow(20, Object.values(player.s.buildings).reduce((a,b) => Decimal.add(a,b))) }, + currently: function() { return Decimal.pow(20, sumValues(player.s.buildings)) }, effDisp: function(x) { return format(x)+"x" }, }, 14: { @@ -856,7 +883,7 @@ const LAYER_UPGS = { desc: "Space Buildings boost the Generator Power effect (before all other boosts).", cost: new Decimal(15), unl: function() { return player.t.unl&&player.e.unl&&player.t.order==0&&player.e.order==0&&player.s.order==0 }, - currently: function() { return Decimal.pow(Object.values(player.s.buildings).reduce((a,b) => Decimal.add(a,b)), 0.2).div(17.5) }, + currently: function() { return Decimal.pow(sumValues(player.s.buildings), 0.2).div(17.5) }, effDisp: function(x) { return "Add "+format(x)+" to exponent" }, }, 41: { @@ -1333,7 +1360,7 @@ const LAYER_UPGS = { desc: "The Space Building 1 effect is stronger based on your Space Building 1 amount.", cost: new Decimal(3e11), unl: function() { return player.ba.upgrades.includes(33)&&player.ba.upgrades.includes(34) }, - currently: function() { return player.s.buildings[1].plus(1).pow(0.8) }, + currently: function() { return tmp.spaceBuildLvl[1].plus(1).pow(0.8) }, effDisp: function(x) { return "^"+format(x) }, }, 43: { @@ -1457,6 +1484,14 @@ const LAYER_UPGS = { unl: function() { return player.sp.upgrades.includes(33) }, }, }, + l: { + rows: 0, + cols: 0, + }, + hs: { + rows: 0, + cols: 0, + }, } const TAB_REQS = { @@ -1480,6 +1515,8 @@ const TAB_REQS = { m: function() { return (player.m.unl||player.h.points.gte(tmp.layerReqs.m))&&layerUnl('m') }, ba: function() { return (player.ba.unl||player.q.points.gte(tmp.layerReqs.ba))&&layerUnl('ba') }, sp: function() { return (player.sp.unl||player.p.points.gte(tmp.layerReqs.sp))&&layerUnl('sp') }, + l: function() { return (player.l.unl||player.b.points.gte(tmp.layerReqs.l))&&layerUnl('l') }, + hs: function() { return (player.hs.unl||player.s.points.gte(tmp.layerReqs.hs))&&layerUnl('hs') }, } const LAYER_AMT_NAMES = { @@ -1498,6 +1535,8 @@ const LAYER_AMT_NAMES = { m: "hindrance spirit", ba: "quirks", sp: "prestige points", + l: "boosters", + hs: "space energy", } function getLayerAmt(layer) { @@ -1530,6 +1569,12 @@ function getLayerAmt(layer) { case "sp": return player.p.points; break; + case "l": + return player.b.points; + break; + case "hs": + return player.s.points; + break; } return amt } @@ -1655,8 +1700,6 @@ function checkForVars() { if (player.t.auto===undefined) player.t.auto = false if (player.t.autoCap===undefined) player.t.autoCap = false if (player.s === undefined) player.s = start.s - if (player.s.buildings[4] === undefined) player.s.buildings[4] = new Decimal(0); - if (player.s.buildings[5] === undefined) player.s.buildings[5] = new Decimal(0); if (player.s.auto === undefined) player.s.auto = false if (player.s.autoBuild === undefined) player.s.autoBuild = false if (player.sb === undefined) player.sb = start.sb @@ -1689,6 +1732,8 @@ function checkForVars() { if (player.notify === undefined) player.notify = {} if (player.sp === undefined) player.sp = start.sp if (player.keepGoing === undefined) player.keepGoing = false + if (player.l === undefined) player.l = start.l + if (player.hs === undefined) player.hs = start.hs } function convertToDecimal() { @@ -1710,7 +1755,7 @@ function convertToDecimal() { player.s.points = new Decimal(player.s.points) player.s.best = new Decimal(player.s.best) player.s.spent = new Decimal(player.s.spent) - for (let i=1;i<=5;i++) player.s.buildings[i] = new Decimal(player.s.buildings[i]) + for (let i=1;i<=MAX_BUILDINGS;i++) if (player.s.buildings[i]) player.s.buildings[i] = new Decimal(player.s.buildings[i]) player.sb.points = new Decimal(player.sb.points) player.sb.best = new Decimal(player.sb.best) player.sg.points = new Decimal(player.sg.points) @@ -1731,7 +1776,7 @@ function convertToDecimal() { player.m.points = new Decimal(player.m.points) player.m.best = new Decimal(player.m.best) player.m.hexes = new Decimal(player.m.hexes) - for (let i=1;i<=4;i++) player.m.casted[i] = new Decimal(player.m.casted[i]) + for (let i=1;i<=MAX_SPELLS;i++) if (player.m.casted[i]) player.m.casted[i] = new Decimal(player.m.casted[i]) player.ba.points = new Decimal(player.ba.points) player.ba.best = new Decimal(player.ba.best) player.ba.power = new Decimal(player.ba.power) @@ -1740,6 +1785,12 @@ function convertToDecimal() { player.sp.points = new Decimal(player.sp.points) player.sp.best = new Decimal(player.sp.best) player.sp.total = new Decimal(player.sp.total) + player.l.points = new Decimal(player.l.points) + player.l.best = new Decimal(player.l.best) + player.l.power = new Decimal(player.l.power) + player.hs.points = new Decimal(player.hs.points) + player.hs.best = new Decimal(player.hs.best) + for (let i=1;i<=MAX_BUILDINGS;i++) if (player.hs.hyperUpgrades[i]) player.hs.hyperUpgrades[i] = new Decimal(player.hs.hyperUpgrades[i]) } function toggleOpt(name) { @@ -1766,6 +1817,16 @@ function commaFormat(num, precision) { return num.toStringWithDecimalPlaces(precision).replace(/\B(?=(\d{3})+(?!\d))/g, ",") } +function fixValue(x, y = 0) { + return x || new Decimal(y) +} + +function sumValues(x) { + x = Object.values(x) + if (x.length == 0) return new Decimal(0) + return x.reduce((a,b) => Decimal.add()) +} + function format(decimal, precision=3) { decimal = new Decimal(decimal) if (isNaN(decimal.sign)||isNaN(decimal.layer)||isNaN(decimal.mag)) { @@ -1865,6 +1926,12 @@ function getLayerReq(layer) { case "ss": if (player.ss.order>0) req = new Decimal(45) break; + case "l": + if (player.l.order>0) req = new Decimal(1/0) + break; + case "hs": + if (player.hs.order>0) req = new Decimal(1/0) + break; } return req } @@ -2035,17 +2102,26 @@ function layerUnl(layer) { return player.m.unl&&player.ba.unl break; case "l": - return false //player.sp.unl + return player.sp.unl break; case "ps": return false //player.l.unl break; case "hs": - return false //player.sp.unl + return player.sp.unl break; case "i": return false //player.ps.unl && player.hs.unl break; + case "mb": + return false //player.ps.unl && player.hs.unl + break; + case "ge": + return false //player.ps.unl && player.hs.unl + break; + case "ma": + return false //player.ps.unl && player.hs.unl + break; } } @@ -2107,13 +2183,7 @@ function rowReset(row, layer) { points: new Decimal(0), best: (player.h.best.gte(2)||player.m.best.gte(1)) ? player.s.best : new Decimal(0), spent: (player.q.best.gte(4)&&(layer=="h"||layer=="q"||layer=="ss"||layer=="hb")) ? player.s.spent : new Decimal(0), - buildings: (player.q.best.gte(4)&&(layer=="h"||layer=="q"||layer=="ss"||layer=="hb")) ? player.s.buildings : ({ - 1: new Decimal(0), - 2: new Decimal(0), - 3: new Decimal(0), - 4: new Decimal(0), - 5: new Decimal(0) - }), + buildings: (player.q.best.gte(4)&&(layer=="h"||layer=="q"||layer=="ss"||layer=="hb")) ? player.s.buildings : ({}), upgrades: (player.h.best.gte(4)||player.sp.total.gte(1)) ? player.s.upgrades : [], auto: player.s.auto, autoBuild: player.s.autoBuild, @@ -2211,6 +2281,8 @@ function rowReset(row, layer) { break; case 6: player.sp = start.sp + player.l = start.l + player.hs = start.hs break; } } @@ -2532,6 +2604,8 @@ function getSpace() { return baseSpace.sub(player.s.spent).max(0) } +const MAX_BUILDINGS = 5 + function getSpaceBuildingCostMod() { let mod = new Decimal(1) if (player.s.upgrades.includes(24)&&!(tmp.hcActive?tmp.hcActive[12]:true)) mod = mod.times(0.5) @@ -2549,7 +2623,7 @@ function getSpaceBuildingCostMult() { function getSpaceBuildingCost(x) { let inputVal = new Decimal([1e3,1e10,1e25,1e48,1e100][x-1]) - let bought = player.s.buildings[x] + let bought = tmp.spaceBuildLvl[x] if (bought.gte(100)) bought = bought.pow(2).div(100) let cost = Decimal.pow(inputVal, bought.times(getSpaceBuildingCostMod()).pow(1.35)).times(inputVal).times((bought.gt(0)||x>1)?1:0).times(getSpaceBuildingCostMult()) return cost @@ -2588,9 +2662,9 @@ function getExtraBuildingLevels(x) { } function getSpaceBuildingEff(x) { - let bought = player.s.buildings[x].plus(getExtraBuildingLevels(x)); + let bought = tmp.spaceBuildLvl[x].plus(getExtraBuildingLevels(x)); if (!player.s.unl) bought = new Decimal(0); - if (tmp.sbUnl=1;i--) maxSpaceBuilding(i) + if (player.s.autoBuild&&player.ss.best.gte(1)) for (let i=tmp.trueSbUnl;i>=1;i--) maxSpaceBuilding(i) if (player.sb.auto&&player.h.best.gte(15)) doReset("sb") if (player.sg.auto&&player.sg.best.gte(2)) doReset("sg") if (player.q.auto&&player.ba.best.gte(3)) maxQuirkLayers() diff --git a/js/temp.js b/js/temp.js index 6fc1de7..26686c8 100644 --- a/js/temp.js +++ b/js/temp.js @@ -23,14 +23,14 @@ function updateTemp() { tmp.resetGain[LAYERS[i]] = getResetGain(LAYERS[i]) tmp.nextAt[LAYERS[i]] = getNextAt(LAYERS[i]) } - + tmp.pointGen = getPointGen() - + tmp.atbb = addToBoosterBase() tmp.atgb = addToGenBase() - + tmp.genPowEff = getGenPowerEff() - + tmp.enhPow = getEnhancerPow() tmp.enhEff = getEnhancerEff() tmp.enhEff2 = getEnhancerEff2() @@ -38,14 +38,19 @@ function updateTemp() { if (tmp.hcActive ? tmp.hcActive[52] : true) { tmp.subbedEnh = tmp.subbedEnh.plus(new Decimal(player.h.time).times(40).plus(1).log10().pow(10).max(10)).round() } - + tmp.freeExtCap = getFreeExtCapsules() tmp.timeEff = getTimeEnergyEff() tmp.attb = addToTimeBase() - + + if (!tmp.spaceBuildLvl) tmp.spaceBuildLvl = {} if (!tmp.spaceBuildEff) tmp.spaceBuildEff = {} - for (let i=1;i<=5;i++) tmp.spaceBuildEff[i] = getSpaceBuildingEff(i) + for (let i=1;i<=MAX_BUILDINGS;i++) { + tmp.spaceBuildLvl[i] = fixValue(player.s.buildings[i]) + tmp.spaceBuildEff[i] = getSpaceBuildingEff(i) + } tmp.sbUnl = getSpaceBuildingsUnl() + tmp.trueSbUnl = Decimal.min(tmp.sbUnl, MAX_BUILDINGS).floor().toNumber() tmp.quirkEff = getQuirkEnergyEff() tmp.qCB = getQuirkLayerCostBase() diff --git a/style.css b/style.css index 19cab52..7c5eb42 100644 --- a/style.css +++ b/style.css @@ -65,7 +65,7 @@ h1, h2, h3, b, input { } .locked { - background-color: #9c6e6e !important; + background-color: #bf8f8f !important; cursor: not-allowed; } @@ -359,6 +359,36 @@ h1, h2, h3, b, input { text-shadow: 0px 0px 10px #e5dab7; } +.mb { + background-color: #ff9f7f; + color: rgba(0, 0, 0, 0.5); +} + +.mb_txt { + color: #ff9f7f; + text-shadow: 0px 0px 10px #ff9f7f; +} + +.ge { + background-color: #bfbfbf; + color: rgba(0, 0, 0, 0.5); +} + +.ge_txt { + color: #bfbfbf; + text-shadow: 0px 0px 10px #bfbfbf; +} + +.ma { + background-color: #9f9f9f; + color: rgba(0, 0, 0, 0.5); +} + +.ma_txt { + color: #9f9f9f; + text-shadow: 0px 0px 10px #9f9f9f; +} + #optionWheel { position: absolute; top: 0px;