1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-02-16 09:41:41 +00:00

v1.1 Beta 1

This commit is contained in:
Aarex Tiaokhiao 2020-09-09 22:44:25 -04:00
parent 89ac54bd8d
commit 1c2c24f717
5 changed files with 181 additions and 48 deletions

View file

@ -409,10 +409,17 @@
<td><button class="treeNode hidden"></button></td> <td><button class="treeNode hidden"></button></td>
</table><table> </table><table>
<td v-if="player.tab=='tree'&&player.sp.unl" class="left"><br><br><img class="remove" src="remove.png" onclick="resetRow(5)"></img></td> <td v-if="player.tab=='tree'&&player.sp.unl" class="left"><br><br><img class="remove" src="remove.png" onclick="resetRow(5)"></img></td>
<td id="l" v-if="layerUnl('l')"><button class="treeNode l">L</button></td> <td id="l" v-if="layerUnl('l')"><button onclick="showTab('l')" v-bind:tooltip="(player.b.points.gte(tmp.layerReqs.l)||player.l.unl) ? (formatWhole(player.l.points)+' life essence') : ('Reach '+format(tmp.layerReqs.l)+' boosters to unlock')" v-bind:class="{ treeNode: true, l: true, locked: (player.b.points.lt(tmp.layerReqs.l)&&!player.l.unl), can: (player.b.points.gte(tmp.layerReqs.l)||player.l.unl) }">L</button></td>
<td id="sp" v-if="layerUnl('sp')"><button onclick="showTab('sp')" v-bind:tooltip="(player.p.points.gte(tmp.layerReqs.sp)||player.sp.unl) ? (formatWhole(player.sp.points)+' super-prestige points') : ('Reach '+format(tmp.layerReqs.sp)+' prestige points to unlock')" v-bind:class="{ treeNode: true, sp: true, locked: (player.p.points.lt(tmp.layerReqs.sp)&&!player.sp.unl), can: (player.p.points.gte(tmp.layerReqs.sp)||player.sp.unl) }">SP</button></td> <td id="sp" v-if="layerUnl('sp')"><button onclick="showTab('sp')" v-bind:tooltip="(player.p.points.gte(tmp.layerReqs.sp)||player.sp.unl) ? (formatWhole(player.sp.points)+' super-prestige points') : ('Reach '+format(tmp.layerReqs.sp)+' prestige points to unlock')" v-bind:class="{ treeNode: true, sp: true, locked: (player.p.points.lt(tmp.layerReqs.sp)&&!player.sp.unl), can: (player.p.points.gte(tmp.layerReqs.sp)||player.sp.unl) }">SP</button></td>
<td id="hs" v-if="layerUnl('hs')"><button class="treeNode hs">HS</button></td> <td id="hs" v-if="layerUnl('hs')"><button onclick="showTab('hs')" v-bind:tooltip="(player.s.points.gte(tmp.layerReqs.hs)||player.hs.unl) ? (formatWhole(player.hs.points)+' hyperspace') : ('Reach '+format(tmp.layerReqs.hs)+' space energy to unlock')" v-bind:class="{ treeNode: true, hs: true, locked: (player.s.points.lt(tmp.layerReqs.hs)&&!player.hs.unl), can: (player.s.points.gte(tmp.layerReqs.hs)||player.hs.unl) }">HS</button></td>
<td id="i" v-if="layerUnl('ps')||layerUnl('i')"><button v-bind:class="{treeNode: true, i: true, hidden: !layerUnl('i')}">I</button></td> <td id="i" v-if="layerUnl('ps')||layerUnl('i')"><button v-bind:class="{treeNode: true, i: true, hidden: !layerUnl('i')}">I</button></td>
</table><table>
<td><button class="treeNode hidden"></button></td>
</table><table>
<td v-if="player.tab=='tree'&&layerUnl('tm')" class="left"><br><br><img class="remove" src="remove.png" onclick="resetRow(6)"></img></td>
<td id="mb" v-if="layerUnl('mb')"><button class="treeNode mb">MB</button></td>
<td id="ge" v-if="layerUnl('ge')"><button class="treeNode ge">Ge</button></td>
<td id="ma" v-if="layerUnl('ma')"><button class="treeNode tm">Ma</button></td>
</table> </table>
<canvas id="treeCanvas" class="canvas"></canvas> <canvas id="treeCanvas" class="canvas"></canvas>
</div> </div>
@ -471,10 +478,10 @@
You have {{ format(player.g.power) }} Generator Power<br><br> You have {{ format(player.g.power) }} Generator Power<br><br>
<button onclick="respecSpaceBuildings()" v-bind:class="{ longUpg: true, can: player.s.unl, locked: !player.s.unl }">Respec Space Buildings</button><br> <button onclick="respecSpaceBuildings()" v-bind:class="{ longUpg: true, can: player.s.unl, locked: !player.s.unl }">Respec Space Buildings</button><br>
<div class="upgRow"> <div class="upgRow">
<div v-for="id in tmp.sbUnl"> <div v-for="id in tmp.trueSbUnl">
<button v-bind:class="{ upg: true, can: (player.g.power.gte(getSpaceBuildingCost(id))&&player.s.unl&&getSpace().gte(1)), locked: (!(player.g.power.gte(getSpaceBuildingCost(id))&&player.s.unl&&getSpace().gte(1))), s: true }" v-on:click="buyBuilding(id)"><h3>Building {{id}}</h3><br>{{getSpaceBuildingEffDesc(id)}}<br><br>Level: {{formatWhole(player.s.buildings[id])}}<br>Cost: {{format(getSpaceBuildingCost(id))}} Generator Power</button><br><br> <button v-bind:class="{ upg: true, can: (player.g.power.gte(getSpaceBuildingCost(id))&&player.s.unl&&getSpace().gte(1)), locked: (!(player.g.power.gte(getSpaceBuildingCost(id))&&player.s.unl&&getSpace().gte(1))), s: true }" v-on:click="buyBuilding(id)"><h3>Building {{id}}</h3><br>{{getSpaceBuildingEffDesc(id)}}<br><br>Level: {{formatWhole(tmp.spaceBuildLvl[id])}}<br>Cost: {{format(getSpaceBuildingCost(id))}} Generator Power</button><br><br>
<button v-if="player.q.best.gte(2500)" v-bind:class="{ longUpg: true, can: player.s.buildings[id].gte(1), locked: player.s.buildings[id].lt(1) }" v-on:click="destroyBuilding(id)">Destroy One</button><br> <button v-if="player.q.best.gte(2500)" v-bind:class="{ longUpg: true, can: tmp.spaceBuildLvl[id].gte(1), locked: tmp.spaceBuildLvl[id].lt(1) }" v-on:click="destroyBuilding(id)">Destroy One</button><br>
<button v-if="player.q.best.gte(2500)" v-bind:class="{ longUpg: true, can: player.s.buildings[id].gte(1), locked: player.s.buildings[id].lt(1) }" v-on:click="destroyBuilding(id, true)">Destroy All</button> <button v-if="player.q.best.gte(2500)" v-bind:class="{ longUpg: true, can: tmp.spaceBuildLvl[id].gte(1), locked: tmp.spaceBuildLvl[id].lt(1) }" v-on:click="destroyBuilding(id, true)">Destroy All</button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -83,6 +83,17 @@ function drawTree() {
if (layerUnl('i')) { if (layerUnl('i')) {
drawTreeBranch("ss", "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; needCanvasUpdate = false;
} }

View file

@ -175,10 +175,27 @@ function getStartPlayer() {
total: new Decimal(0), total: new Decimal(0),
upgrades: [], 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 = { const LAYER_REQS = {
p: new Decimal(10), p: new Decimal(10),
@ -196,6 +213,8 @@ const LAYER_REQS = {
m: new Decimal(1e80), m: new Decimal(1e80),
ba: new Decimal(1e130), ba: new Decimal(1e130),
sp: new Decimal("1e8500000"), sp: new Decimal("1e8500000"),
l: new Decimal(1415),
hs: new Decimal(715),
} }
const LAYER_RES = { const LAYER_RES = {
@ -214,6 +233,8 @@ const LAYER_RES = {
m: "magic", m: "magic",
ba: "balance energy", ba: "balance energy",
sp: "super-prestige points", sp: "super-prestige points",
l: "life essence",
hs: "hyperspace",
} }
const LAYER_RES_CEIL = ["sb", "sg", "hb", "ss"] const LAYER_RES_CEIL = ["sb", "sg", "hb", "ss"]
@ -234,6 +255,8 @@ const LAYER_TYPE = {
m: "normal", m: "normal",
ba: "normal", ba: "normal",
sp: "normal", sp: "normal",
l: "normal",
hs: "normal",
} }
const LAYER_EXP = { const LAYER_EXP = {
@ -252,6 +275,8 @@ const LAYER_EXP = {
m: new Decimal(0.01), m: new Decimal(0.01),
ba: new Decimal(0.00667), ba: new Decimal(0.00667),
sp: new Decimal(2e-7), sp: new Decimal(2e-7),
l: new Decimal(1e-9),
hs: new Decimal(1e-9),
} }
const LAYER_BASE = { const LAYER_BASE = {
@ -281,6 +306,8 @@ const LAYER_ROW = {
m: 4, m: 4,
ba: 4, ba: 4,
sp: 5, sp: 5,
l: 5,
hs: 5,
future_layer: 6, future_layer: 6,
} }
@ -290,7 +317,7 @@ const ROW_LAYERS = [
["e","t","s","sb","sg"], ["e","t","s","sb","sg"],
["h","q","hb","ss"], ["h","q","hb","ss"],
["m","ba"], ["m","ba"],
["sp"], ["sp","l","hs"],
["future_layer"], ["future_layer"],
] ]
@ -299,8 +326,8 @@ const ORDER_UP = [
[], [],
["e","t","s","sb"], ["e","t","s","sb"],
["hb","ss"], ["hb","ss"],
["sp"],
[], [],
["l","hs"],
] ]
const LAYER_EFFS = { const LAYER_EFFS = {
@ -803,7 +830,7 @@ const LAYER_UPGS = {
desc: "Space Building Levels boost Generator Power gain, and get 2 extra Space.", desc: "Space Building Levels boost Generator Power gain, and get 2 extra Space.",
cost: new Decimal(3), cost: new Decimal(3),
unl: function() { return player.s.upgrades.includes(11) }, 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" }, effDisp: function(x) { return format(x)+"x" },
}, },
14: { 14: {
@ -856,7 +883,7 @@ const LAYER_UPGS = {
desc: "Space Buildings boost the Generator Power effect (before all other boosts).", desc: "Space Buildings boost the Generator Power effect (before all other boosts).",
cost: new Decimal(15), 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 }, 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" }, effDisp: function(x) { return "Add "+format(x)+" to exponent" },
}, },
41: { 41: {
@ -1333,7 +1360,7 @@ const LAYER_UPGS = {
desc: "The Space Building 1 effect is stronger based on your Space Building 1 amount.", desc: "The Space Building 1 effect is stronger based on your Space Building 1 amount.",
cost: new Decimal(3e11), cost: new Decimal(3e11),
unl: function() { return player.ba.upgrades.includes(33)&&player.ba.upgrades.includes(34) }, 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) }, effDisp: function(x) { return "^"+format(x) },
}, },
43: { 43: {
@ -1457,6 +1484,14 @@ const LAYER_UPGS = {
unl: function() { return player.sp.upgrades.includes(33) }, unl: function() { return player.sp.upgrades.includes(33) },
}, },
}, },
l: {
rows: 0,
cols: 0,
},
hs: {
rows: 0,
cols: 0,
},
} }
const TAB_REQS = { 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') }, 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') }, 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') }, 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 = { const LAYER_AMT_NAMES = {
@ -1498,6 +1535,8 @@ const LAYER_AMT_NAMES = {
m: "hindrance spirit", m: "hindrance spirit",
ba: "quirks", ba: "quirks",
sp: "prestige points", sp: "prestige points",
l: "boosters",
hs: "space energy",
} }
function getLayerAmt(layer) { function getLayerAmt(layer) {
@ -1530,6 +1569,12 @@ function getLayerAmt(layer) {
case "sp": case "sp":
return player.p.points; return player.p.points;
break; break;
case "l":
return player.b.points;
break;
case "hs":
return player.s.points;
break;
} }
return amt return amt
} }
@ -1655,8 +1700,6 @@ function checkForVars() {
if (player.t.auto===undefined) player.t.auto = false if (player.t.auto===undefined) player.t.auto = false
if (player.t.autoCap===undefined) player.t.autoCap = false if (player.t.autoCap===undefined) player.t.autoCap = false
if (player.s === undefined) player.s = start.s 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.auto === undefined) player.s.auto = false
if (player.s.autoBuild === undefined) player.s.autoBuild = false if (player.s.autoBuild === undefined) player.s.autoBuild = false
if (player.sb === undefined) player.sb = start.sb if (player.sb === undefined) player.sb = start.sb
@ -1689,6 +1732,8 @@ function checkForVars() {
if (player.notify === undefined) player.notify = {} if (player.notify === undefined) player.notify = {}
if (player.sp === undefined) player.sp = start.sp if (player.sp === undefined) player.sp = start.sp
if (player.keepGoing === undefined) player.keepGoing = false 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() { function convertToDecimal() {
@ -1710,7 +1755,7 @@ function convertToDecimal() {
player.s.points = new Decimal(player.s.points) player.s.points = new Decimal(player.s.points)
player.s.best = new Decimal(player.s.best) player.s.best = new Decimal(player.s.best)
player.s.spent = new Decimal(player.s.spent) 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.points = new Decimal(player.sb.points)
player.sb.best = new Decimal(player.sb.best) player.sb.best = new Decimal(player.sb.best)
player.sg.points = new Decimal(player.sg.points) player.sg.points = new Decimal(player.sg.points)
@ -1731,7 +1776,7 @@ function convertToDecimal() {
player.m.points = new Decimal(player.m.points) player.m.points = new Decimal(player.m.points)
player.m.best = new Decimal(player.m.best) player.m.best = new Decimal(player.m.best)
player.m.hexes = new Decimal(player.m.hexes) 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.points = new Decimal(player.ba.points)
player.ba.best = new Decimal(player.ba.best) player.ba.best = new Decimal(player.ba.best)
player.ba.power = new Decimal(player.ba.power) player.ba.power = new Decimal(player.ba.power)
@ -1740,6 +1785,12 @@ function convertToDecimal() {
player.sp.points = new Decimal(player.sp.points) player.sp.points = new Decimal(player.sp.points)
player.sp.best = new Decimal(player.sp.best) player.sp.best = new Decimal(player.sp.best)
player.sp.total = new Decimal(player.sp.total) 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) { function toggleOpt(name) {
@ -1766,6 +1817,16 @@ function commaFormat(num, precision) {
return num.toStringWithDecimalPlaces(precision).replace(/\B(?=(\d{3})+(?!\d))/g, ",") 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) { function format(decimal, precision=3) {
decimal = new Decimal(decimal) decimal = new Decimal(decimal)
if (isNaN(decimal.sign)||isNaN(decimal.layer)||isNaN(decimal.mag)) { if (isNaN(decimal.sign)||isNaN(decimal.layer)||isNaN(decimal.mag)) {
@ -1865,6 +1926,12 @@ function getLayerReq(layer) {
case "ss": case "ss":
if (player.ss.order>0) req = new Decimal(45) if (player.ss.order>0) req = new Decimal(45)
break; 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 return req
} }
@ -2035,17 +2102,26 @@ function layerUnl(layer) {
return player.m.unl&&player.ba.unl return player.m.unl&&player.ba.unl
break; break;
case "l": case "l":
return false //player.sp.unl return player.sp.unl
break; break;
case "ps": case "ps":
return false //player.l.unl return false //player.l.unl
break; break;
case "hs": case "hs":
return false //player.sp.unl return player.sp.unl
break; break;
case "i": case "i":
return false //player.ps.unl && player.hs.unl return false //player.ps.unl && player.hs.unl
break; 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), points: new Decimal(0),
best: (player.h.best.gte(2)||player.m.best.gte(1)) ? player.s.best : 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), 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 : ({ 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)
}),
upgrades: (player.h.best.gte(4)||player.sp.total.gte(1)) ? player.s.upgrades : [], upgrades: (player.h.best.gte(4)||player.sp.total.gte(1)) ? player.s.upgrades : [],
auto: player.s.auto, auto: player.s.auto,
autoBuild: player.s.autoBuild, autoBuild: player.s.autoBuild,
@ -2211,6 +2281,8 @@ function rowReset(row, layer) {
break; break;
case 6: case 6:
player.sp = start.sp player.sp = start.sp
player.l = start.l
player.hs = start.hs
break; break;
} }
} }
@ -2532,6 +2604,8 @@ function getSpace() {
return baseSpace.sub(player.s.spent).max(0) return baseSpace.sub(player.s.spent).max(0)
} }
const MAX_BUILDINGS = 5
function getSpaceBuildingCostMod() { function getSpaceBuildingCostMod() {
let mod = new Decimal(1) let mod = new Decimal(1)
if (player.s.upgrades.includes(24)&&!(tmp.hcActive?tmp.hcActive[12]:true)) mod = mod.times(0.5) 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) { function getSpaceBuildingCost(x) {
let inputVal = new Decimal([1e3,1e10,1e25,1e48,1e100][x-1]) 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) 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()) 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 return cost
@ -2588,9 +2662,9 @@ function getExtraBuildingLevels(x) {
} }
function getSpaceBuildingEff(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 (!player.s.unl) bought = new Decimal(0);
if (tmp.sbUnl<x) bought = new Decimal(0); if (tmp.trueSbUnl<x) bought = new Decimal(0);
let power = getSpaceBuildingPow() let power = getSpaceBuildingPow()
bought = bought.times(power) bought = bought.times(power)
let ret; let ret;
@ -2641,40 +2715,40 @@ function getSpaceBuildingEffDesc(x) {
function buyBuilding(x) { function buyBuilding(x) {
if (!player.s.unl) return if (!player.s.unl) return
if (tmp.sbUnl<x) return if (tmp.trueSbUnl<x) return
if (getSpace().lt(1)) return if (getSpace().lt(1)) return
let cost = getSpaceBuildingCost(x) let cost = getSpaceBuildingCost(x)
if (player.g.power.lt(cost)) return if (player.g.power.lt(cost)) return
player.g.power = player.g.power.sub(cost) player.g.power = player.g.power.sub(cost)
player.s.spent = player.s.spent.plus(1) player.s.spent = player.s.spent.plus(1)
player.s.buildings[x] = player.s.buildings[x].plus(1) player.s.buildings[x] = tmp.spaceBuildLvl[x].plus(1)
} }
function maxSpaceBuilding(x) { function maxSpaceBuilding(x) {
if (!player.s.unl) return if (!player.s.unl) return
if (tmp.sbUnl<x) return if (tmp.trueSbUnl<x) return
let space = getSpace() let space = getSpace()
if (space.lt(1)) return if (space.lt(1)) return
let target = getSpaceBuildingTarg(x) let target = getSpaceBuildingTarg(x)
let bulk = target.sub(player.s.buildings[x]).min(space) let bulk = target.sub(tmp.spaceBuildLvl[x]).min(space)
if (bulk.lt(1)) return if (bulk.lt(1)) return
player.s.spent = player.s.spent.plus(bulk) player.s.spent = player.s.spent.plus(bulk)
player.s.buildings[x] = player.s.buildings[x].plus(bulk) player.s.buildings[x] = tmp.spaceBuildLvl[x].plus(bulk)
} }
function destroyBuilding(x, all=false) { function destroyBuilding(x, all=false) {
if (!player.s.unl) return if (!player.s.unl) return
if (tmp.sbUnl<x) return if (tmp.trueSbUnl<x) return
if (player.s.buildings[x].lt(1)) return if (tmp.spaceBuildLvl[x].lt(1)) return
if (player.q.best.lt(2500)) return if (player.q.best.lt(2500)) return
player.s.spent = player.s.spent.sub(all?player.s.buildings[x]:1) player.s.spent = player.s.spent.sub(all?tmp.spaceBuildLvl[x]:1)
player.s.buildings[x] = all?new Decimal(0):player.s.buildings[x].sub(1) player.s.buildings[x] = all?new Decimal(0):tmp.spaceBuildLvl[x].sub(1)
} }
function respecSpaceBuildings() { function respecSpaceBuildings() {
if (!player.s.unl) return; if (!player.s.unl) return;
if (!confirm("Are you sure you want to reset your Space Buildings? This will force you to do a Space reset as well!")) return if (!confirm("Are you sure you want to reset your Space Buildings? This will force you to do a Space reset as well!")) return
for (let i=1;i<=5;i++) player.s.buildings[i] = new Decimal(0) player.s.buildings = {}
player.s.spent = new Decimal(0) player.s.spent = new Decimal(0)
doReset("s", true) doReset("s", true)
} }
@ -3052,6 +3126,8 @@ function getBalPowGainMult() {
return mult; return mult;
} }
const MAX_SPELLS = 4
const SPELL_NAMES = { const SPELL_NAMES = {
1: "Booster Launch", 1: "Booster Launch",
2: "Time Warp", 2: "Time Warp",
@ -3227,7 +3303,11 @@ function gameLoop(diff) {
player.ba.positivity = player.ba.positivity.plus(tmp.layerEffs.ba.pos.times(getPosGainMult()).times(diff)).max(0) player.ba.positivity = player.ba.positivity.plus(tmp.layerEffs.ba.pos.times(getPosGainMult()).times(diff)).max(0)
player.ba.negativity = player.ba.negativity.plus(tmp.layerEffs.ba.neg.times(getNegGainMult()).times(diff)).max(0) player.ba.negativity = player.ba.negativity.plus(tmp.layerEffs.ba.neg.times(getNegGainMult()).times(diff)).max(0)
} }
if (player.m.unl) for (let i=1;i<=tmp.spellsUnl;i++) player.m.spellTimes[i] = Decimal.sub(player.m.spellTimes[i], diff).max(0).toNumber() if (player.m.unl) {
for (let i=1;i<=tmp.spellsUnl;i++) {
player.m.spellTimes[i] = Decimal.sub(player.m.spellTimes[i], diff).max(0).toNumber()
}
}
if (player.m.best.gte(3)) { if (player.m.best.gte(3)) {
generatePoints("h", diff) generatePoints("h", diff)
generatePoints("q", diff) generatePoints("q", diff)
@ -3244,7 +3324,7 @@ function gameLoop(diff) {
if (player.t.autoCap&&player.h.best.gte(5)) maxExtTimeCapsules() if (player.t.autoCap&&player.h.best.gte(5)) maxExtTimeCapsules()
if (player.t.auto&&player.q.best.gte(10)) doReset("t") if (player.t.auto&&player.q.best.gte(10)) doReset("t")
if (player.s.auto&&player.q.best.gte(10)) doReset("s") if (player.s.auto&&player.q.best.gte(10)) doReset("s")
if (player.s.autoBuild&&player.ss.best.gte(1)) for (let i=tmp.sbUnl;i>=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.sb.auto&&player.h.best.gte(15)) doReset("sb")
if (player.sg.auto&&player.sg.best.gte(2)) doReset("sg") if (player.sg.auto&&player.sg.best.gte(2)) doReset("sg")
if (player.q.auto&&player.ba.best.gte(3)) maxQuirkLayers() if (player.q.auto&&player.ba.best.gte(3)) maxQuirkLayers()

View file

@ -23,14 +23,14 @@ function updateTemp() {
tmp.resetGain[LAYERS[i]] = getResetGain(LAYERS[i]) tmp.resetGain[LAYERS[i]] = getResetGain(LAYERS[i])
tmp.nextAt[LAYERS[i]] = getNextAt(LAYERS[i]) tmp.nextAt[LAYERS[i]] = getNextAt(LAYERS[i])
} }
tmp.pointGen = getPointGen() tmp.pointGen = getPointGen()
tmp.atbb = addToBoosterBase() tmp.atbb = addToBoosterBase()
tmp.atgb = addToGenBase() tmp.atgb = addToGenBase()
tmp.genPowEff = getGenPowerEff() tmp.genPowEff = getGenPowerEff()
tmp.enhPow = getEnhancerPow() tmp.enhPow = getEnhancerPow()
tmp.enhEff = getEnhancerEff() tmp.enhEff = getEnhancerEff()
tmp.enhEff2 = getEnhancerEff2() tmp.enhEff2 = getEnhancerEff2()
@ -38,14 +38,19 @@ function updateTemp() {
if (tmp.hcActive ? tmp.hcActive[52] : true) { 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.subbedEnh = tmp.subbedEnh.plus(new Decimal(player.h.time).times(40).plus(1).log10().pow(10).max(10)).round()
} }
tmp.freeExtCap = getFreeExtCapsules() tmp.freeExtCap = getFreeExtCapsules()
tmp.timeEff = getTimeEnergyEff() tmp.timeEff = getTimeEnergyEff()
tmp.attb = addToTimeBase() tmp.attb = addToTimeBase()
if (!tmp.spaceBuildLvl) tmp.spaceBuildLvl = {}
if (!tmp.spaceBuildEff) tmp.spaceBuildEff = {} 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.sbUnl = getSpaceBuildingsUnl()
tmp.trueSbUnl = Decimal.min(tmp.sbUnl, MAX_BUILDINGS).floor().toNumber()
tmp.quirkEff = getQuirkEnergyEff() tmp.quirkEff = getQuirkEnergyEff()
tmp.qCB = getQuirkLayerCostBase() tmp.qCB = getQuirkLayerCostBase()

View file

@ -65,7 +65,7 @@ h1, h2, h3, b, input {
} }
.locked { .locked {
background-color: #9c6e6e !important; background-color: #bf8f8f !important;
cursor: not-allowed; cursor: not-allowed;
} }
@ -359,6 +359,36 @@ h1, h2, h3, b, input {
text-shadow: 0px 0px 10px #e5dab7; 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 { #optionWheel {
position: absolute; position: absolute;
top: 0px; top: 0px;