mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-22 00:21:32 +00:00
Pre-Alpha Build for you greedy gamers
This commit is contained in:
parent
faf5481427
commit
37e07e9b45
9 changed files with 1298 additions and 1 deletions
|
@ -1,2 +1,2 @@
|
||||||
# Prestige-Tree
|
# Prestige-Tree
|
||||||
A tree of prestige upgrades (unfinished)
|
A tree of prestige upgrades (alpha)
|
||||||
|
|
104
index.html
Normal file
104
index.html
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<head>
|
||||||
|
<title>The Prestige Tree</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||||
|
<script type="text/javascript" src="js/break_eternity.min.js"></script>
|
||||||
|
<script type="text/javascript" src="js/game.js"></script>
|
||||||
|
<script type="text/javascript" src="js/v.js"></script>
|
||||||
|
<script type="text/javascript" src="js/canvas.js"></script>
|
||||||
|
</head>
|
||||||
|
<body onload="load()">
|
||||||
|
<div id="app">
|
||||||
|
<img id="optionWheel" v-if="player.tab!='options'" src="options_wheel.jpg" onclick="showTab('options')"></img>
|
||||||
|
<br>You have <h2>{{format(player.points)}}</h2> Points
|
||||||
|
<div v-if="player.tab=='options'">
|
||||||
|
<button class="back" onclick="showTab('tree')">←</button><br><br><br><br><br>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td><button class="opt" onclick="save()">Save</button></td>
|
||||||
|
<td><button class="opt" onclick="hardReset()">HARD RESET</button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><button class="opt" onclick="exportSave()">Export</button></td>
|
||||||
|
<td><button class="opt" onclick="importSave()">Import</button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><button class="opt" onclick="toggleOpt('autosave')">Autosave: {{ player.autosave?"ON":"OFF" }}</button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div v-if="player.tab=='tree'">
|
||||||
|
<br><br><br><br><br>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td id="p"><button onclick="showTab('p')" v-bind:tooltip="(player.points.gte(getLayerReq('p'))||player.p.unl) ? (formatWhole(player.p.points)+' prestige points') : ('Reach '+format(getLayerReq('p'))+' points to unlock')" v-bind:class="{ treeNode: true, p: true, locked: (player.points.lt(getLayerReq('p'))&&!player.p.unl), can: (player.points.gte(getLayerReq('p'))||player.p.unl) }">P</button></td>
|
||||||
|
</tr>
|
||||||
|
</table><table>
|
||||||
|
<tr>
|
||||||
|
<td><button class="treeNode hidden"></button></td>
|
||||||
|
</tr>
|
||||||
|
</table><table>
|
||||||
|
<tr>
|
||||||
|
<td v-if="player.b.unl||player.g.unl" class="left"><br><br><img class="remove" src="remove.png" onclick="resetRow(1)"></img></td>
|
||||||
|
<td id="b" v-if="layerUnl('b')"><button onclick="showTab('b')" v-bind:tooltip="((player.points.gte(getLayerReq('b'))||player.b.unl)&&layerUnl('b')) ? (formatWhole(player.b.points)+' boosters') : ('Reach '+format(getLayerReq('b'))+' points to unlock')" v-bind:class="{ treeNode: true, b: true, locked: (player.points.lt(getLayerReq('b'))&&!player.b.unl), can: (player.points.gte(getLayerReq('b'))||player.b.unl) }">B</button></td>
|
||||||
|
<td id="g" v-if="layerUnl('g')"><button onclick="showTab('g')" v-bind:tooltip="((player.points.gte(getLayerReq('g'))||player.g.unl)&&layerUnl('g')) ? (formatWhole(player.g.points)+' generators') : ('Reach '+format(getLayerReq('g'))+' points to unlock')" v-bind:class="{ treeNode: true, g: true, locked: (player.points.lt(getLayerReq('g'))&&!player.g.unl), can: (player.points.gte(getLayerReq('g'))||player.g.unl) }">G</button></td>
|
||||||
|
</tr>
|
||||||
|
</table><table>
|
||||||
|
<tr>
|
||||||
|
<td><button class="treeNode hidden"></button></td>
|
||||||
|
</tr>
|
||||||
|
</table><table>
|
||||||
|
<tr>
|
||||||
|
<td v-if="player.e.unl||player.t.unl||player.s.unl" class="left"><br><br><img class="remove" src="remove.png" onclick="resetRow(2)"></img></td>
|
||||||
|
<td id="t" v-if="layerUnl('t')"><button onclick="showTab('t')" v-bind:tooltip="((player.points.gte(getLayerReq('t'))||player.t.unl)&&layerUnl('t')) ? (formatWhole(player.t.points)+' time capsules') : ('Reach '+format(getLayerReq('t'))+' points to unlock')" v-bind:class="{ treeNode: true, t: true, locked: (player.points.lt(getLayerReq('t'))&&!player.t.unl), can: (player.points.gte(getLayerReq('t'))||player.t.unl) }">T</button></td>
|
||||||
|
<td id="e" v-if="layerUnl('e')"><button onclick="showTab('e')" v-bind:tooltip="((player.points.gte(getLayerReq('e'))||player.e.unl)&&layerUnl('e')) ? (formatWhole(player.e.points)+' enhance points') : ('Reach '+format(getLayerReq('e'))+' points to unlock')" v-bind:class="{ treeNode: true, e: true, locked: (player.points.lt(getLayerReq('e'))&&!player.e.unl), can: (player.points.gte(getLayerReq('e'))||player.e.unl) }">E</button></td>
|
||||||
|
<td id="s" v-if="layerUnl('s')"><button onclick="showTab('s')" v-bind:tooltip="((player.points.gte(getLayerReq('s'))||player.s.unl)&&layerUnl('s')) ? (formatWhole(player.s.points)+' space energy') : ('Reach '+format(getLayerReq('s'))+' points to unlock')" v-bind:class="{ treeNode: true, s: true, locked: (player.points.lt(getLayerReq('s'))&&!player.s.unl), can: (player.points.gte(getLayerReq('s'))||player.s.unl) }">S</button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<canvas id="treeCanvas" class="canvas"></canvas>
|
||||||
|
</div>
|
||||||
|
<div v-for="layer in LAYERS">
|
||||||
|
<div v-if="player.tab==layer">
|
||||||
|
<button class="back" onclick="showTab('tree')">←</button><br><br><br>
|
||||||
|
You have <h2 v-bind:class="{ [layer+'_txt']: true }">{{formatWhole(player[layer].points)}}</h2> {{LAYER_RES[layer]}}<span v-if="Object.keys(LAYER_EFFS).includes(layer)">, {{getLayerEffDesc(layer)}}</span>
|
||||||
|
<br><br>
|
||||||
|
<div v-if="layer=='b'">
|
||||||
|
<table><tr><td v-bind:class="{ milestone: player.b.best.lt(8), milestoneDone: player.b.best.gte(8) }">8 Boosters<br>Keep Prestige Upgrades on reset</td></tr><tr><td v-bind:class="{ milestone: player.b.best.lt(15), milestoneDone: player.b.best.gte(15) }">15 Boosters<br>You can buy max Boosters</td></tr></table>
|
||||||
|
</div>
|
||||||
|
<div v-if="layer=='g'">
|
||||||
|
You have {{format(player.g.power)}} Generator Power, which multiplies Point gain by {{format(getGenPowerEff())}}<br><br>
|
||||||
|
<table><tr><td v-bind:class="{ milestone: player.g.best.lt(8), milestoneDone: player.g.best.gte(8) }">8 Generators<br>Keep Prestige Upgrades on reset</td></tr><tr><td v-bind:class="{ milestone: player.g.best.lt(10), milestoneDone: player.g.best.gte(10) }">10 Generators<br>Gain 100% of Prestige Point gain every second</td></tr><tr><td v-bind:class="{ milestone: player.g.best.lt(15), milestoneDone: player.g.best.gte(15) }">15 Generators<br>You can buy max Generators</td></tr></table>
|
||||||
|
</div>
|
||||||
|
<div v-if="layer=='e'">
|
||||||
|
<table><tr><td v-bind:class="{ milestone: player.e.best.lt(2), milestoneDone: player.e.best.gte(2) }">2 enhance points<br>Keep Booster/Generator milestones on reset</td></tr></table><br><br>
|
||||||
|
<button v-bind:class="{ upgBig: true, can: player.e.points.gte(getEnhancerCost()), locked: player.e.points.lt(getEnhancerCost()), e: true }" onclick="buyEnhancer()">Buy an Enhancer<br>Cost: {{formatWhole(getEnhancerCost())}} Enhance Points<br>Amount: {{formatWhole(player.e.enhancers)}}<br>Multiplies Prestige Point gain by {{format(getEnhancerEff())}}<br>Adds to base of Booster/Generator effects by {{format(getEnhancerEff2())}}</button>
|
||||||
|
</div>
|
||||||
|
<div v-if="layer=='t'">
|
||||||
|
You have {{format(player.t.energy)}} Time Energy, which multiplies Point gain & Prestige Point gain by {{format(getTimeEnergyEff())}}<br><br>
|
||||||
|
<table><tr><td v-bind:class="{ milestone: player.t.best.lt(2), milestoneDone: player.t.best.gte(2) }">2 time capsules<br>Keep Booster/Generator milestones on reset</td></tr></table><br><br>
|
||||||
|
<button v-bind:class="{ upgBig: true, can: (player.b.points.gte(getExtCapsuleCost())&&player.t.unl), locked: (player.b.points.lt(getExtCapsuleCost())||!player.t.unl), t: true }" onclick="buyExtCapsule()">Buy an extra Time Capsule<br>Cost: {{formatWhole(getExtCapsuleCost())}} Boosters<br>Amount: {{formatWhole(player.t.extCapsules)}}</button>
|
||||||
|
</div>
|
||||||
|
<div v-if="layer=='s'">
|
||||||
|
You have {{formatWhole(getSpace())}} Space.<br><br>
|
||||||
|
<table><tr><td v-bind:class="{ milestone: player.s.best.lt(2), milestoneDone: player.s.best.gte(2) }">2 space energy<br>Keep Booster/Generator milestones on reset</td></tr></table><br><br>
|
||||||
|
<button onclick="respecSpaceBuildings()" v-bind:class="{ longUpg: true, can: player.s.unl, locked: !player.s.unl }">Respec Space Buildings</button><br>
|
||||||
|
<table><tr>
|
||||||
|
<td v-for="id in 3">
|
||||||
|
<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)">Building {{id}}<br>Level: {{formatWhole(player.s.buildings[id])}}<br>Cost: {{format(getSpaceBuildingCost(id))}} Generator Power<br>Effect: {{getSpaceBuildingEffDesc(id)}}</button>
|
||||||
|
</td>
|
||||||
|
</tr></table>
|
||||||
|
</div>
|
||||||
|
<br><br><br>
|
||||||
|
<button v-if="LAYER_TYPE[layer]=='normal'" v-bind:class="{ [layer]: true, reset: true, locked: player.points.lt(getLayerReq(layer)), can: player.points.gte(getLayerReq(layer)) }" v-on:click="doReset(layer)">+{{formatWhole(getResetGain(layer))}} {{LAYER_RES[layer]}}<br>Next at {{ format(getNextAt(layer)) }} points</button>
|
||||||
|
<button v-if="LAYER_TYPE[layer]=='static'" v-bind:class="{ [layer]: true, reset: true, locked: player.points.lt(getNextAt(layer)), can: player.points.gte(getNextAt(layer)) }" v-on:click="doReset(layer)">+{{formatWhole(getResetGain(layer))}} {{LAYER_RES[layer]}}<br>Req: {{format(getNextAt(layer))}} points</button>
|
||||||
|
<br><br><br>
|
||||||
|
<table>
|
||||||
|
<tr v-for="row in LAYER_UPGS[layer].rows">
|
||||||
|
<td v-for="col in LAYER_UPGS[layer].cols"><button v-if="LAYER_UPGS[layer][row*10+col].unl()" v-on:click="buyUpg(layer, row*10+col)" v-bind:class="{ [layer]: true, upg: true, bought: player[layer].upgrades.includes(row*10+col), locked: (player[layer].points.lt(LAYER_UPGS[layer][row*10+col].cost)&&!player[layer].upgrades.includes(row*10+col)), can: (player[layer].points.gte(LAYER_UPGS[layer][row*10+col].cost)&&!player[layer].upgrades.includes(row*10+col)) }">{{ LAYER_UPGS[layer][row*10+col].desc }}<br>Cost: {{ formatWhole(LAYER_UPGS[layer][row*10+col].cost) }} {{LAYER_RES[layer]}}<span v-if="LAYER_UPGS[layer][row*10+col].currently"><br>Currently: {{LAYER_UPGS[layer][row*10+col].effDisp(LAYER_UPGS[layer][row*10+col].currently())}}</span></button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
1
js/break_eternity.min.js
vendored
Normal file
1
js/break_eternity.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
53
js/canvas.js
Normal file
53
js/canvas.js
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
var canvas;
|
||||||
|
var ctx
|
||||||
|
|
||||||
|
window.addEventListener("resize", (_=>resizeCanvas()));
|
||||||
|
|
||||||
|
function retrieveCanvasData() {
|
||||||
|
let treeCanv = document.getElementById("treeCanvas")
|
||||||
|
if (treeCanv===undefined||treeCanv===null) return false;
|
||||||
|
canvas = treeCanv;
|
||||||
|
ctx = canvas.getContext("2d");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resizeCanvas() {
|
||||||
|
if (player.tab!='tree') return
|
||||||
|
if (!retrieveCanvasData()) return
|
||||||
|
canvas.width = 0;
|
||||||
|
canvas.height = 0;
|
||||||
|
canvas.width = document.body.scrollWidth;
|
||||||
|
canvas.height = document.body.scrollHeight;
|
||||||
|
drawTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawTree() {
|
||||||
|
if (player.tab!='tree') return
|
||||||
|
if (!retrieveCanvasData()) return;
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
if (layerUnl('b')) drawTreeBranch("p", "b")
|
||||||
|
if (layerUnl('g')) drawTreeBranch("p", "g")
|
||||||
|
if (layerUnl('e')) {
|
||||||
|
drawTreeBranch("b", "e")
|
||||||
|
drawTreeBranch("g", "e")
|
||||||
|
}
|
||||||
|
if (layerUnl('t')) drawTreeBranch("b", "t")
|
||||||
|
if (layerUnl('s')) drawTreeBranch("g", "s")
|
||||||
|
|
||||||
|
needCanvasUpdate = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawTreeBranch(num1, num2) { // taken from Antimatter Dimensions & adjusted slightly
|
||||||
|
let start = document.getElementById(num1).getBoundingClientRect();
|
||||||
|
let end = document.getElementById(num2).getBoundingClientRect();
|
||||||
|
let x1 = start.left + (start.width / 2) + (document.documentElement.scrollLeft || document.body.scrollLeft);
|
||||||
|
let y1 = start.top + (start.height / 2) + (document.documentElement.scrollTop || document.body.scrollTop);
|
||||||
|
let x2 = end.left + (end.width / 2) + (document.documentElement.scrollLeft || document.body.scrollLeft);
|
||||||
|
let y2 = end.top + (end.height / 2) + (document.documentElement.scrollTop || document.body.scrollTop);
|
||||||
|
ctx.lineWidth = 15;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.strokeStyle = "white"
|
||||||
|
ctx.moveTo(x1, y1);
|
||||||
|
ctx.lineTo(x2, y2);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
819
js/game.js
Normal file
819
js/game.js
Normal file
|
@ -0,0 +1,819 @@
|
||||||
|
var player;
|
||||||
|
var needCanvasUpdate = true;
|
||||||
|
|
||||||
|
function getStartPlayer() {
|
||||||
|
return {
|
||||||
|
tab: "tree",
|
||||||
|
time: Date.now(),
|
||||||
|
autosave: true,
|
||||||
|
points: new Decimal(10),
|
||||||
|
p: {
|
||||||
|
unl: false,
|
||||||
|
points: new Decimal(0),
|
||||||
|
best: new Decimal(0),
|
||||||
|
upgrades: [],
|
||||||
|
},
|
||||||
|
b: {
|
||||||
|
unl: false,
|
||||||
|
points: new Decimal(0),
|
||||||
|
best: new Decimal(0),
|
||||||
|
upgrades: [],
|
||||||
|
},
|
||||||
|
g: {
|
||||||
|
unl: false,
|
||||||
|
points: new Decimal(0),
|
||||||
|
power: new Decimal(0),
|
||||||
|
best: new Decimal(0),
|
||||||
|
upgrades: [],
|
||||||
|
},
|
||||||
|
e: {
|
||||||
|
unl: false,
|
||||||
|
order: 0,
|
||||||
|
points: new Decimal(0),
|
||||||
|
best: new Decimal(0),
|
||||||
|
enhancers: new Decimal(0),
|
||||||
|
upgrades: [],
|
||||||
|
},
|
||||||
|
t: {
|
||||||
|
unl: false,
|
||||||
|
order: 0,
|
||||||
|
points: new Decimal(0),
|
||||||
|
best: new Decimal(0),
|
||||||
|
energy: new Decimal(0),
|
||||||
|
extCapsules: new Decimal(0),
|
||||||
|
upgrades: [],
|
||||||
|
},
|
||||||
|
s: {
|
||||||
|
unl: false,
|
||||||
|
order: 0,
|
||||||
|
points: new Decimal(0),
|
||||||
|
best: new Decimal(0),
|
||||||
|
spent: new Decimal(0),
|
||||||
|
buildings: {
|
||||||
|
1: new Decimal(0),
|
||||||
|
2: new Decimal(0),
|
||||||
|
3: new Decimal(0)
|
||||||
|
},
|
||||||
|
upgrades: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const LAYERS = ["p", "b", "g", "e", "t", "s"]
|
||||||
|
|
||||||
|
const LAYER_REQS = {
|
||||||
|
p: new Decimal(10),
|
||||||
|
b: new Decimal(200),
|
||||||
|
g: new Decimal(200),
|
||||||
|
e: new Decimal(1e120),
|
||||||
|
t: new Decimal(1e120),
|
||||||
|
s: new Decimal(1e120),
|
||||||
|
}
|
||||||
|
|
||||||
|
const LAYER_RES = {
|
||||||
|
p: "prestige points",
|
||||||
|
b: "boosters",
|
||||||
|
g: "generators",
|
||||||
|
e: "enhance points",
|
||||||
|
t: "time capsules",
|
||||||
|
s: "space energy",
|
||||||
|
}
|
||||||
|
|
||||||
|
const LAYER_TYPE = {
|
||||||
|
p: "normal",
|
||||||
|
b: "static",
|
||||||
|
g: "static",
|
||||||
|
e: "normal",
|
||||||
|
t: "static",
|
||||||
|
s: "static",
|
||||||
|
}
|
||||||
|
|
||||||
|
const LAYER_EXP = {
|
||||||
|
p: new Decimal(0.5),
|
||||||
|
b: new Decimal(1.25),
|
||||||
|
g: new Decimal(1.25),
|
||||||
|
e: new Decimal(0.02),
|
||||||
|
t: new Decimal(2),
|
||||||
|
s: new Decimal(2),
|
||||||
|
}
|
||||||
|
|
||||||
|
const LAYER_BASE = {
|
||||||
|
b: new Decimal(5),
|
||||||
|
g: new Decimal(5),
|
||||||
|
t: new Decimal(1e15),
|
||||||
|
s: new Decimal(1e15),
|
||||||
|
}
|
||||||
|
|
||||||
|
const LAYER_ROW = {
|
||||||
|
p: 0,
|
||||||
|
b: 1,
|
||||||
|
g: 1,
|
||||||
|
e: 2,
|
||||||
|
t: 2,
|
||||||
|
s: 2,
|
||||||
|
future_layer: 3,
|
||||||
|
}
|
||||||
|
|
||||||
|
const ROW_LAYERS = [
|
||||||
|
["p"],
|
||||||
|
["b","g"],
|
||||||
|
["e","t","s"],
|
||||||
|
["future_layer"],
|
||||||
|
]
|
||||||
|
|
||||||
|
const LAYER_EFFS = {
|
||||||
|
b: function() { return Decimal.pow(Decimal.add(2, addToBoosterBase()), player.b.points) },
|
||||||
|
g: function() { return Decimal.pow(Decimal.add(2, addToGenBase()), player.g.points).sub(1).times(getGenPowerGainMult()) },
|
||||||
|
t: function() { return {
|
||||||
|
gain: Decimal.pow(3, player.t.points.plus(player.t.extCapsules)).sub(1),
|
||||||
|
limit: Decimal.pow(2, player.t.points.plus(player.t.extCapsules)).sub(1).times(100),
|
||||||
|
}},
|
||||||
|
}
|
||||||
|
|
||||||
|
const LAYER_UPGS = {
|
||||||
|
p: {
|
||||||
|
rows: 2,
|
||||||
|
cols: 3,
|
||||||
|
11: {
|
||||||
|
desc: "Gain 1 Point every second.",
|
||||||
|
cost: new Decimal(1),
|
||||||
|
unl: function() { return player.p.unl },
|
||||||
|
},
|
||||||
|
12: {
|
||||||
|
desc: "Point generation is faster based on your unspent Prestige Points.",
|
||||||
|
cost: new Decimal(1),
|
||||||
|
unl: function() { return player.p.upgrades.includes(11) },
|
||||||
|
currently: function() { return player.p.points.plus(1).pow(player.g.upgrades.includes(24)?1.1:(player.g.upgrades.includes(14)?0.75:0.5)) },
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
13: {
|
||||||
|
desc: "Point generation is faster based on your Point amount.",
|
||||||
|
cost: new Decimal(5),
|
||||||
|
unl: function() { return player.p.upgrades.includes(12) },
|
||||||
|
currently: function() {
|
||||||
|
let ret = player.points.plus(1).log10().pow(0.75).plus(1)
|
||||||
|
if (player.g.upgrades.includes(15)) ret = ret.pow(LAYER_UPGS.g[15].currently())
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
21: {
|
||||||
|
desc: "Prestige Point gain is doubled.",
|
||||||
|
cost: new Decimal(20),
|
||||||
|
unl: function() { return (player.b.unl||player.g.unl)&&player.p.upgrades.includes(11) },
|
||||||
|
},
|
||||||
|
22: {
|
||||||
|
desc: "Point generation is faster based on your Prestige Upgrades bought.",
|
||||||
|
cost: new Decimal(75),
|
||||||
|
unl: function() { return (player.b.unl||player.g.unl)&&player.p.upgrades.includes(12) },
|
||||||
|
currently: function() { return Decimal.pow(1.4, player.p.upgrades.length) },
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
23: {
|
||||||
|
desc: "Prestige Point gain is boosted by your Point amount.",
|
||||||
|
cost: new Decimal(5e3),
|
||||||
|
unl: function() { return (player.b.unl||player.g.unl)&&player.p.upgrades.includes(13) },
|
||||||
|
currently: function() {
|
||||||
|
let ret = player.points.plus(1).log10().cbrt().plus(1)
|
||||||
|
if (player.g.upgrades.includes(23)) ret = ret.pow(LAYER_UPGS.g[23].currently())
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
b: {
|
||||||
|
rows: 2,
|
||||||
|
cols: 3,
|
||||||
|
11: {
|
||||||
|
desc: "Boosters boost Prestige Point gain.",
|
||||||
|
cost: new Decimal(3),
|
||||||
|
unl: function() { return player.b.unl },
|
||||||
|
currently: function() { return player.b.points.sqrt().plus(1) },
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
12: {
|
||||||
|
desc: "Generators add to the Booster effect.",
|
||||||
|
cost: new Decimal(7),
|
||||||
|
unl: function() { return player.g.unl },
|
||||||
|
currently: function() { return player.g.points.plus(1).log10().sqrt().div(3) },
|
||||||
|
effDisp: function(x) { return "+"+format(x)+" to base" },
|
||||||
|
},
|
||||||
|
13: {
|
||||||
|
desc: "Prestige Points add to the Booster effect.",
|
||||||
|
cost: new Decimal(8),
|
||||||
|
unl: function() { return player.b.best.gte(8) },
|
||||||
|
currently: function() { return player.p.points.plus(1).log10().plus(1).log10().div(3) },
|
||||||
|
effDisp: function(x) { return "+"+format(x)+" to base" },
|
||||||
|
},
|
||||||
|
21: {
|
||||||
|
desc: "Square the Generator Power effect.",
|
||||||
|
cost: new Decimal(10),
|
||||||
|
unl: function() { return player.b.upgrades.includes(11) && player.b.upgrades.includes(12) },
|
||||||
|
},
|
||||||
|
22: {
|
||||||
|
desc: "The Generator Power effect is raised to the power of 1.2.",
|
||||||
|
cost: new Decimal(15),
|
||||||
|
unl: function() { return player.b.upgrades.includes(12) && player.b.upgrades.includes(13) },
|
||||||
|
},
|
||||||
|
23: {
|
||||||
|
desc: "Boosters are cheaper based on your points.",
|
||||||
|
cost: new Decimal(18),
|
||||||
|
unl: function() { return player.b.upgrades.includes(21) || player.b.upgrades.includes(22) },
|
||||||
|
currently: function() { return player.points.plus(1).log10().plus(1).pow(3.2) },
|
||||||
|
effDisp: function(x) { return "/"+format(x) },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
g: {
|
||||||
|
rows: 2,
|
||||||
|
cols: 5,
|
||||||
|
11: {
|
||||||
|
desc: "Generators boost Prestige Point gain.",
|
||||||
|
cost: new Decimal(3),
|
||||||
|
unl: function() { return player.g.unl },
|
||||||
|
currently: function() { return player.g.points.sqrt().plus(1) },
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
12: {
|
||||||
|
desc: "Boosters boost Generator Power gain.",
|
||||||
|
cost: new Decimal(7),
|
||||||
|
unl: function() { return player.b.unl },
|
||||||
|
currently: function() { return player.b.points.plus(1).log10().sqrt().div(3) },
|
||||||
|
effDisp: function(x) { return "+"+format(x)+" to base" },
|
||||||
|
},
|
||||||
|
13: {
|
||||||
|
desc: "Prestige Points boost Generator Power gain.",
|
||||||
|
cost: new Decimal(8),
|
||||||
|
unl: function() { return player.g.best.gte(8) },
|
||||||
|
currently: function() { return player.p.points.plus(1).log10().plus(1).log10().div(3) },
|
||||||
|
effDisp: function(x) { return "+"+format(x)+" to base" },
|
||||||
|
},
|
||||||
|
14: {
|
||||||
|
desc: "Prestige Upgrade 2 uses a better formula.",
|
||||||
|
cost: new Decimal(13),
|
||||||
|
unl: function() { return player.g.best.gte(10) },
|
||||||
|
},
|
||||||
|
15: {
|
||||||
|
desc: "Prestige Upgrade 3 is stronger based on your Generators.",
|
||||||
|
cost: new Decimal(15),
|
||||||
|
unl: function() { return player.g.upgrades.includes(13) },
|
||||||
|
currently: function() { return player.g.points.sqrt().plus(1) },
|
||||||
|
effDisp: function(x) { return "^"+format(x) },
|
||||||
|
},
|
||||||
|
21: {
|
||||||
|
desc: "Generator Power generates faster based on its amount.",
|
||||||
|
cost: new Decimal(18),
|
||||||
|
unl: function() { return player.g.upgrades.includes(15) },
|
||||||
|
currently: function() { return player.g.power.plus(1).log10().plus(1) },
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
22: {
|
||||||
|
desc: "Generators are cheaper based on your Prestige Points.",
|
||||||
|
cost: new Decimal(19),
|
||||||
|
unl: function() { return player.g.upgrades.includes(15) },
|
||||||
|
currently: function() { return player.p.points.plus(1).pow(0.25) },
|
||||||
|
effDisp: function(x) { return "/"+format(x) },
|
||||||
|
},
|
||||||
|
23: {
|
||||||
|
desc: "Prestige Upgrade 6 is stronger based on your Boosters.",
|
||||||
|
cost: new Decimal(20),
|
||||||
|
unl: function() { return player.b.unl && player.g.upgrades.includes(15) },
|
||||||
|
currently: function() { return player.b.points.pow(0.75).plus(1) },
|
||||||
|
effDisp: function(x) { return "^"+format(x) },
|
||||||
|
},
|
||||||
|
24: {
|
||||||
|
desc: "Prestige Upgrade 2 uses an even better formula.",
|
||||||
|
cost: new Decimal(22),
|
||||||
|
unl: function() { return player.g.upgrades.includes(14) && (player.g.upgrades.includes(21)||player.g.upgrades.includes(22)) },
|
||||||
|
},
|
||||||
|
25: {
|
||||||
|
desc: "Prestige Points boost Generator Power gain.",
|
||||||
|
cost: new Decimal(28),
|
||||||
|
unl: function() { return player.g.upgrades.includes(23) && player.g.upgrades.includes(24) },
|
||||||
|
currently: function() { return player.p.points.plus(1).log10().sqrt().plus(1) },
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
e: {
|
||||||
|
rows: 0,
|
||||||
|
cols: 0,
|
||||||
|
},
|
||||||
|
t: {
|
||||||
|
rows: 0,
|
||||||
|
cols: 0,
|
||||||
|
},
|
||||||
|
s: {
|
||||||
|
rows: 0,
|
||||||
|
cols: 0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const TAB_REQS = {
|
||||||
|
tree: function() { return true },
|
||||||
|
options: function() { return true },
|
||||||
|
p: function() { return (player.p.unl||player.points.gte(getLayerReq('p')))&&layerUnl('p') },
|
||||||
|
b: function() { return (player.b.unl||player.points.gte(getLayerReq('b')))&&layerUnl('b') },
|
||||||
|
g: function() { return (player.g.unl||player.points.gte(getLayerReq('g')))&&layerUnl('g') },
|
||||||
|
e: function() { return (player.e.unl||player.points.gte(getLayerReq('e')))&&layerUnl('e') },
|
||||||
|
t: function() { return (player.t.unl||player.points.gte(getLayerReq('t')))&&layerUnl('t') },
|
||||||
|
s: function() { return (player.s.unl||player.points.gte(getLayerReq('s')))&&layerUnl('s') },
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLayerEffDesc(layer) {
|
||||||
|
if (!Object.keys(LAYER_EFFS).includes(layer)) return "???"
|
||||||
|
let eff = LAYER_EFFS[layer]()
|
||||||
|
switch(layer) {
|
||||||
|
case "b":
|
||||||
|
return "translated to a "+format(eff)+"x multiplier to point gain"
|
||||||
|
break;
|
||||||
|
case "g":
|
||||||
|
return "which are generating "+format(eff)+" Generator Power/sec"
|
||||||
|
break;
|
||||||
|
case "t":
|
||||||
|
return "which are generating "+format(eff.gain)+" Time Energy/sec, but with a limit of "+format(eff.limit)+" Time Energy"
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
localStorage.setItem("prestige-tree", btoa(JSON.stringify(player)))
|
||||||
|
}
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
let get = localStorage.getItem("prestige-tree");
|
||||||
|
if (get==null) player = getStartPlayer()
|
||||||
|
else player = JSON.parse(atob(get))
|
||||||
|
player.tab = "tree"
|
||||||
|
checkForVars();
|
||||||
|
convertToDecimal();
|
||||||
|
loadVue();
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportSave() {
|
||||||
|
let str = btoa(JSON.stringify(player))
|
||||||
|
|
||||||
|
const el = document.createElement("textarea");
|
||||||
|
el.value = str;
|
||||||
|
document.body.appendChild(el);
|
||||||
|
el.select();
|
||||||
|
el.setSelectionRange(0, 99999);
|
||||||
|
document.execCommand("copy");
|
||||||
|
document.body.removeChild(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
function importSave() {
|
||||||
|
let imported = prompt("Paste your save here")
|
||||||
|
try {
|
||||||
|
player = JSON.parse(atob(imported))
|
||||||
|
save()
|
||||||
|
window.location.reload()
|
||||||
|
} catch(e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkForVars() {
|
||||||
|
if (player.autosave===undefined) player.autosave = true;
|
||||||
|
if (player.b===undefined) player.b = getStartPlayer().b
|
||||||
|
if (player.g===undefined) player.g = getStartPlayer().g
|
||||||
|
if (player.p.best===undefined) player.p.best = player.p.points
|
||||||
|
if (player.b.best===undefined) player.b.best = player.b.points
|
||||||
|
if (player.g.best===undefined) player.g.best = player.g.points
|
||||||
|
if (player.e === undefined) player.e = getStartPlayer().e
|
||||||
|
if (player.e.order === undefined) player.e.order = 0
|
||||||
|
if (player.t === undefined) player.t = getStartPlayer().t
|
||||||
|
if (player.s === undefined) player.s = getStartPlayer().s
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertToDecimal() {
|
||||||
|
player.points = new Decimal(player.points)
|
||||||
|
player.p.points = new Decimal(player.p.points)
|
||||||
|
player.p.best = new Decimal(player.p.best)
|
||||||
|
player.b.points = new Decimal(player.b.points)
|
||||||
|
player.b.best = new Decimal(player.b.best)
|
||||||
|
player.g.points = new Decimal(player.g.points)
|
||||||
|
player.g.best = new Decimal(player.g.best)
|
||||||
|
player.g.power = new Decimal(player.g.power)
|
||||||
|
player.e.points = new Decimal(player.e.points)
|
||||||
|
player.e.best = new Decimal(player.e.best)
|
||||||
|
player.e.enhancers = new Decimal(player.e.enhancers)
|
||||||
|
player.t.points = new Decimal(player.t.points)
|
||||||
|
player.t.best = new Decimal(player.t.best)
|
||||||
|
player.t.energy = new Decimal(player.t.energy)
|
||||||
|
player.t.extCapsules = new Decimal(player.t.extCapsules)
|
||||||
|
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<=3;i++) player.s.buildings[i] = new Decimal(player.s.buildings[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleOpt(name) {
|
||||||
|
player[name] = !player[name]
|
||||||
|
}
|
||||||
|
|
||||||
|
function exponentialFormat(num, precision) {
|
||||||
|
let e = num.log10().floor()
|
||||||
|
let m = num.div(Decimal.pow(10, e))
|
||||||
|
return m.toStringWithDecimalPlaces(3)+"e"+e.toStringWithDecimalPlaces(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function commaFormat(num, precision) {
|
||||||
|
if (num === null || num === undefined) return "NaN"
|
||||||
|
return num.toStringWithDecimalPlaces(precision).replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
||||||
|
}
|
||||||
|
|
||||||
|
function format(decimal, precision=3) {
|
||||||
|
decimal = new Decimal(decimal)
|
||||||
|
if (decimal.gte(1e9)) return exponentialFormat(decimal, precision)
|
||||||
|
else return commaFormat(decimal, precision)
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatWhole(decimal) {
|
||||||
|
return format(decimal, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function showTab(name) {
|
||||||
|
if (!TAB_REQS[name]()) return
|
||||||
|
player.tab = name
|
||||||
|
if (name=="tree") needCanvasUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canBuyMax(layer) {
|
||||||
|
switch(layer) {
|
||||||
|
case "b":
|
||||||
|
return player.b.best.gte(15)
|
||||||
|
break;
|
||||||
|
case "g":
|
||||||
|
return player.g.best.gte(15)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLayerReq(layer) {
|
||||||
|
let req = LAYER_REQS[layer]
|
||||||
|
switch(layer) {
|
||||||
|
case "b":
|
||||||
|
if (player.g.unl && !player.b.unl) req = req.times(5000)
|
||||||
|
break;
|
||||||
|
case "g":
|
||||||
|
if (player.b.unl && !player.g.unl) req = req.times(5000)
|
||||||
|
break;
|
||||||
|
case "e":
|
||||||
|
req = req.times(Decimal.pow("10^^1000", player.e.order))
|
||||||
|
break;
|
||||||
|
case "t":
|
||||||
|
req = req.times(Decimal.pow("10^^1000", player.t.order))
|
||||||
|
break;
|
||||||
|
case "s":
|
||||||
|
req = req.times(Decimal.pow("10^^1000", player.s.order))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return req
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLayerGainMult(layer) {
|
||||||
|
let mult = new Decimal(1)
|
||||||
|
switch(layer) {
|
||||||
|
case "p":
|
||||||
|
if (player.p.upgrades.includes(21)) mult = mult.times(2)
|
||||||
|
if (player.p.upgrades.includes(23)) mult = mult.times(LAYER_UPGS.p[23].currently())
|
||||||
|
if (player.b.upgrades.includes(11)) mult = mult.times(LAYER_UPGS.b[11].currently())
|
||||||
|
if (player.g.upgrades.includes(11)) mult = mult.times(LAYER_UPGS.g[11].currently())
|
||||||
|
if (player.e.unl) mult = mult.times(getEnhancerEff())
|
||||||
|
if (player.t.unl) mult = mult.times(getTimeEnergyEff())
|
||||||
|
if (player.s.unl) mult = mult.times(getSpaceBuildingEff(1))
|
||||||
|
break;
|
||||||
|
case "b":
|
||||||
|
if (player.b.upgrades.includes(23)) mult = mult.div(LAYER_UPGS.b[23].currently())
|
||||||
|
if (player.s.unl) mult = mult.div(getSpaceBuildingEff(3))
|
||||||
|
break;
|
||||||
|
case "g":
|
||||||
|
if (player.g.upgrades.includes(22)) mult = mult.div(LAYER_UPGS.g[22].currently())
|
||||||
|
if (player.s.unl) mult = mult.div(getSpaceBuildingEff(3))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return mult
|
||||||
|
}
|
||||||
|
|
||||||
|
function getResetGain(layer) {
|
||||||
|
if (LAYER_TYPE[layer]=="static") {
|
||||||
|
if ((!canBuyMax(layer)) || player.points.lt(getLayerReq(layer))) return new Decimal(1)
|
||||||
|
let gain = player.points.div(getLayerReq(layer)).div(getLayerGainMult(layer)).max(1).log(LAYER_BASE[layer]).pow(Decimal.pow(LAYER_EXP[layer], -1))
|
||||||
|
if (gain.gte(12)) gain = gain.times(12).sqrt()
|
||||||
|
return gain.floor().sub(player[layer].points).plus(1).max(1);
|
||||||
|
}
|
||||||
|
if (player.points.lt(getLayerReq(layer))) return new Decimal(0)
|
||||||
|
let gain = player.points.div(getLayerReq(layer)).pow(LAYER_EXP[layer]).times(getLayerGainMult(layer))
|
||||||
|
return gain.floor().max(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNextAt(layer) {
|
||||||
|
if (LAYER_TYPE[layer]=="static") {
|
||||||
|
let amt = player[layer].points
|
||||||
|
if (amt.gte(12)) amt = amt.pow(2).div(12)
|
||||||
|
let extraCost = Decimal.pow(LAYER_BASE[layer], amt.pow(LAYER_EXP[layer])).times(getLayerGainMult(layer))
|
||||||
|
return extraCost.times(getLayerReq(layer)).max(getLayerReq(layer))
|
||||||
|
} else return getResetGain(layer).plus(1).div(getLayerGainMult(layer)).root(LAYER_EXP[layer]).times(getLayerReq(layer)).max(getLayerReq(layer))
|
||||||
|
}
|
||||||
|
|
||||||
|
function layerUnl(layer) {
|
||||||
|
switch(layer) {
|
||||||
|
case "p":
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case "b":
|
||||||
|
return player.p.unl;
|
||||||
|
break;
|
||||||
|
case "g":
|
||||||
|
return player.p.unl;
|
||||||
|
break;
|
||||||
|
case "e":
|
||||||
|
return player.b.unl&&player.g.unl;
|
||||||
|
break;
|
||||||
|
case "t":
|
||||||
|
return player.b.unl;
|
||||||
|
break;
|
||||||
|
case "s":
|
||||||
|
return player.g.unl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function rowReset(row, layer) {
|
||||||
|
let prev = JSON.parse(JSON.stringify(player)) // Deep Copy
|
||||||
|
switch(row) {
|
||||||
|
case 0:
|
||||||
|
player.points = new Decimal(0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
player.points = new Decimal(10);
|
||||||
|
player.p.points = new Decimal(0);
|
||||||
|
if (layer=="b"||layer=="g") {
|
||||||
|
if (player[layer].best.lt(8)) player.p.upgrades = [];
|
||||||
|
} else player.p.upgrades = [];
|
||||||
|
player.g.power = new Decimal(0);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
player.b.points = new Decimal(0);
|
||||||
|
player.b.best = new Decimal(0);
|
||||||
|
player.b.upgrades = [];
|
||||||
|
player.g.points = new Decimal(0);
|
||||||
|
player.g.power = new Decimal(0);
|
||||||
|
player.g.best = new Decimal(0);
|
||||||
|
player.g.upgrades = [];
|
||||||
|
player.t.energy = new Decimal(0);
|
||||||
|
if (layer=="t"||layer=="e"||layer=="s") {
|
||||||
|
if (player[layer].best.gte(2)) {
|
||||||
|
player.b.best = new Decimal(prev.b.best)
|
||||||
|
player.g.best = new Decimal(prev.g.best)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
player.t.points = new Decimal(0);
|
||||||
|
player.t.order = 0
|
||||||
|
player.t.best = new Decimal(0);
|
||||||
|
player.t.upgrades = [];
|
||||||
|
player.t.extCapsules = new Decimal(0);
|
||||||
|
player.e.order = 0
|
||||||
|
player.e.points = new Decimal(0);
|
||||||
|
player.e.best = new Decimal(0);
|
||||||
|
player.e.enhancers = new Decimal(0);
|
||||||
|
player.e.upgrades = [];
|
||||||
|
player.s = {
|
||||||
|
unl: player.s.unl,
|
||||||
|
order: 0,
|
||||||
|
points: new Decimal(0),
|
||||||
|
best: new Decimal(0),
|
||||||
|
spent: new Decimal(0),
|
||||||
|
buildings: {
|
||||||
|
1: new Decimal(0),
|
||||||
|
2: new Decimal(0),
|
||||||
|
3: new Decimal(0)
|
||||||
|
},
|
||||||
|
upgrades: [],
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function doReset(layer, force=false) {
|
||||||
|
if (!force) {
|
||||||
|
if (player.points.lt(getLayerReq(layer))) return;
|
||||||
|
let gain = getResetGain(layer)
|
||||||
|
if (LAYER_TYPE[layer]=="static") {
|
||||||
|
if (player.points.lt(getNextAt(layer))) return;
|
||||||
|
player[layer].points = player[layer].points.plus(canBuyMax(layer)?gain:1)
|
||||||
|
} else player[layer].points = player[layer].points.plus(gain)
|
||||||
|
player[layer].best = player[layer].best.max(player[layer].points)
|
||||||
|
|
||||||
|
if (!player[layer].unl) {
|
||||||
|
player[layer].unl = true;
|
||||||
|
needCanvasUpdate = true;
|
||||||
|
|
||||||
|
let layers = ROW_LAYERS[LAYER_ROW[layer]]
|
||||||
|
for (let i in layers) if (!player[layers[i]].unl) player[layers[i]].order++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let row = LAYER_ROW[layer]
|
||||||
|
if (row==0) rowReset(0, layer)
|
||||||
|
else for (let x=row;x>=1;x--) rowReset(x, layer)
|
||||||
|
}
|
||||||
|
|
||||||
|
function buyUpg(layer, id) {
|
||||||
|
if (!player[layer].unl) return
|
||||||
|
if (!LAYER_UPGS[layer][id].unl()) return
|
||||||
|
if (player[layer].upgrades.includes(id)) return
|
||||||
|
if (player[layer].points.lt(LAYER_UPGS[layer][id].cost)) return
|
||||||
|
player[layer].points = player[layer].points.sub(LAYER_UPGS[layer][id].cost)
|
||||||
|
player[layer].upgrades.push(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPointGen() {
|
||||||
|
let gain = new Decimal(1)
|
||||||
|
if (player.p.upgrades.includes(12)) gain = gain.times(LAYER_UPGS.p[12].currently())
|
||||||
|
if (player.p.upgrades.includes(13)) gain = gain.times(LAYER_UPGS.p[13].currently())
|
||||||
|
if (player.p.upgrades.includes(22)) gain = gain.times(LAYER_UPGS.p[22].currently())
|
||||||
|
if (player.b.unl) gain = gain.times(LAYER_EFFS.b())
|
||||||
|
if (player.g.unl) gain = gain.times(getGenPowerEff())
|
||||||
|
if (player.t.unl) gain = gain.times(getTimeEnergyEff())
|
||||||
|
if (player.s.unl) gain = gain.times(getSpaceBuildingEff(1))
|
||||||
|
return gain
|
||||||
|
}
|
||||||
|
|
||||||
|
function addToBoosterBase() {
|
||||||
|
let toAdd = new Decimal(0)
|
||||||
|
if (player.b.upgrades.includes(12)) toAdd = toAdd.plus(LAYER_UPGS.b[12].currently())
|
||||||
|
if (player.b.upgrades.includes(13)) toAdd = toAdd.plus(LAYER_UPGS.b[13].currently())
|
||||||
|
if (player.e.unl) toAdd = toAdd.plus(getEnhancerEff2())
|
||||||
|
if (player.s.unl) toAdd = toAdd.plus(getSpaceBuildingEff(2))
|
||||||
|
return toAdd
|
||||||
|
}
|
||||||
|
|
||||||
|
function addToGenBase() {
|
||||||
|
let toAdd = new Decimal(0)
|
||||||
|
if (player.g.upgrades.includes(12)) toAdd = toAdd.plus(LAYER_UPGS.g[12].currently())
|
||||||
|
if (player.g.upgrades.includes(13)) toAdd = toAdd.plus(LAYER_UPGS.g[13].currently())
|
||||||
|
if (player.e.unl) toAdd = toAdd.plus(getEnhancerEff2())
|
||||||
|
if (player.s.unl) toAdd = toAdd.plus(getSpaceBuildingEff(2))
|
||||||
|
return toAdd
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGenPowerGainMult() {
|
||||||
|
let mult = new Decimal(1)
|
||||||
|
if (player.g.upgrades.includes(21)) mult = mult.times(LAYER_UPGS.g[21].currently())
|
||||||
|
if (player.g.upgrades.includes(25)) mult = mult.times(LAYER_UPGS.g[25].currently())
|
||||||
|
return mult
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGenPowerEff() {
|
||||||
|
let eff = player.g.power.plus(1).cbrt();
|
||||||
|
if (player.b.upgrades.includes(21)) eff = eff.pow(2);
|
||||||
|
if (player.b.upgrades.includes(22)) eff = eff.pow(1.2);
|
||||||
|
return eff
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetRow(row) {
|
||||||
|
if (prompt('Are you sure you want to reset this row? It is highly recommended that you wait until the end of your current run before doing this! Type "I WANT TO RESET THIS" to confirm')!="I WANT TO RESET THIS") return
|
||||||
|
let pre_layers = ROW_LAYERS[row-1]
|
||||||
|
let layers = ROW_LAYERS[row]
|
||||||
|
let post_layers = ROW_LAYERS[row+1]
|
||||||
|
rowReset(row+1, post_layers[0])
|
||||||
|
doReset(pre_layers[0], true)
|
||||||
|
for (let layer in layers) {
|
||||||
|
player[layers[layer]].unl = false
|
||||||
|
}
|
||||||
|
resizeCanvas();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEnhancerCost() {
|
||||||
|
let cost = Decimal.pow(2, player.e.enhancers.pow(1.5))
|
||||||
|
return cost
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEnhancerEff() {
|
||||||
|
if (!player.e.unl) return new Decimal(1)
|
||||||
|
let eff = Decimal.pow(25, player.e.enhancers.pow(1.1))
|
||||||
|
return eff
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEnhancerEff2() {
|
||||||
|
if (!player.e.unl) return new Decimal(0)
|
||||||
|
let eff = player.e.enhancers.pow(0.8)
|
||||||
|
return eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buyEnhancer() {
|
||||||
|
let cost = getEnhancerCost()
|
||||||
|
if (player.e.points.lt(cost)) return
|
||||||
|
player.e.points = player.e.points.sub(cost)
|
||||||
|
player.e.enhancers = player.e.enhancers.plus(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTimeEnergyEff() {
|
||||||
|
if (!player.t.unl) return new Decimal(1)
|
||||||
|
let eff = player.t.energy.plus(1).pow(1.2)
|
||||||
|
return eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getExtCapsuleCost() {
|
||||||
|
let cost = player.t.extCapsules.times(0.4).pow(1.2).plus(1).times(10)
|
||||||
|
return cost.floor()
|
||||||
|
}
|
||||||
|
|
||||||
|
function buyExtCapsule() {
|
||||||
|
if (!player.t.unl) return
|
||||||
|
let cost = getExtCapsuleCost()
|
||||||
|
if (player.b.points.lt(cost)) return
|
||||||
|
player.b.points = player.b.points.sub(cost)
|
||||||
|
player.t.extCapsules = player.t.extCapsules.plus(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSpace() {
|
||||||
|
let baseSpace = player.s.best.pow(1.1).times(3).floor()
|
||||||
|
return baseSpace.sub(player.s.spent)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSpaceBuildingCost(x) {
|
||||||
|
let inputVal = new Decimal([1e3,1e10,1e25][x-1])
|
||||||
|
let bought = player.s.buildings[x]
|
||||||
|
let cost = Decimal.pow(inputVal, bought.pow(1.35)).times(inputVal).times((bought.gt(0)||x>1)?1:0)
|
||||||
|
return cost
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSpaceBuildingEff(x) {
|
||||||
|
let bought = player.s.buildings[x];
|
||||||
|
if (!player.s.unl) bought = new Decimal(0);
|
||||||
|
switch(x) {
|
||||||
|
case 1:
|
||||||
|
return Decimal.pow(Decimal.add(1, bought), player.s.points.sqrt()).times(Decimal.mul(4, bought)).max(1)
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return bought.sqrt()
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return Decimal.pow(10, bought.pow(2.5))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSpaceBuildingEffDesc(x) {
|
||||||
|
let eff = getSpaceBuildingEff(x)
|
||||||
|
switch(x) {
|
||||||
|
case 1:
|
||||||
|
return "Space Energy boosts Point gain & Prestige Point gain ("+format(eff)+"x)"
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return "Adds to base of Booster/Generator effects by "+format(eff)
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return "Makes Boosters/Generators cheaper by "+format(eff)+"x"
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buyBuilding(x) {
|
||||||
|
if (!player.s.unl) return
|
||||||
|
if (getSpace().lt(1)) return
|
||||||
|
let cost = getSpaceBuildingCost(x)
|
||||||
|
if (player.g.power.lt(cost)) return
|
||||||
|
player.g.power = player.g.power.sub(cost)
|
||||||
|
player.s.spent = player.s.spent.plus(1)
|
||||||
|
player.s.buildings[x] = player.s.buildings[x].plus(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
function respecSpaceBuildings() {
|
||||||
|
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
|
||||||
|
for (let i=1;i<=3;i++) player.s.buildings[i] = new Decimal(0)
|
||||||
|
player.s.spent = new Decimal(0)
|
||||||
|
doReset("space", true)
|
||||||
|
}
|
||||||
|
|
||||||
|
function gameLoop(diff) {
|
||||||
|
if (player.p.upgrades.includes(11)) player.points = player.points.plus(getPointGen().times(diff))
|
||||||
|
if (player.g.unl) player.g.power = player.g.power.plus(LAYER_EFFS.g().times(diff))
|
||||||
|
if (player.g.best.gte(10)) player.p.points = player.p.points.plus(getResetGain("p").times(diff))
|
||||||
|
if (player.t.unl) {
|
||||||
|
let data = LAYER_EFFS.t()
|
||||||
|
player.t.energy = player.t.energy.plus(data.gain.times(diff)).min(data.limit)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function hardReset() {
|
||||||
|
if (!confirm("Are you sure you want to do this? You will lose all your progress!")) return
|
||||||
|
player = getStartPlayer()
|
||||||
|
save();
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
var saveInterval = setInterval(function() {
|
||||||
|
if (player.autosave) save();
|
||||||
|
}, 5000)
|
||||||
|
|
||||||
|
var interval = setInterval(function() {
|
||||||
|
let diff = (Date.now()-player.time)/1000
|
||||||
|
player.time = Date.now()
|
||||||
|
if (needCanvasUpdate && player.tab=="tree") resizeCanvas();
|
||||||
|
gameLoop(diff)
|
||||||
|
}, 50)
|
34
js/v.js
Normal file
34
js/v.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
var app;
|
||||||
|
|
||||||
|
function loadVue() {
|
||||||
|
app = new Vue({
|
||||||
|
el: "#app",
|
||||||
|
data: {
|
||||||
|
player,
|
||||||
|
format,
|
||||||
|
formatWhole,
|
||||||
|
getResetGain,
|
||||||
|
getLayerReq,
|
||||||
|
getNextAt,
|
||||||
|
layerUnl,
|
||||||
|
getLayerEffDesc,
|
||||||
|
doReset,
|
||||||
|
buyUpg,
|
||||||
|
getGenPowerEff,
|
||||||
|
getEnhancerCost,
|
||||||
|
getEnhancerEff,
|
||||||
|
getEnhancerEff2,
|
||||||
|
getTimeEnergyEff,
|
||||||
|
getExtCapsuleCost,
|
||||||
|
getSpace,
|
||||||
|
getSpaceBuildingCost,
|
||||||
|
getSpaceBuildingEffDesc,
|
||||||
|
buyBuilding,
|
||||||
|
LAYERS,
|
||||||
|
LAYER_RES,
|
||||||
|
LAYER_TYPE,
|
||||||
|
LAYER_UPGS,
|
||||||
|
LAYER_EFFS,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
BIN
options_wheel.JPG
Normal file
BIN
options_wheel.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
BIN
remove.png
Normal file
BIN
remove.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
286
style.css
Normal file
286
style.css
Normal file
|
@ -0,0 +1,286 @@
|
||||||
|
* {
|
||||||
|
transition-duration: 0.5s;
|
||||||
|
text-align: center;
|
||||||
|
font-family: "Lucida Console";
|
||||||
|
table-align: center;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: black;
|
||||||
|
color: white;
|
||||||
|
text-shadow: 0px 0px 7px white;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2 {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.treeNode {
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border-color: black;
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locked {
|
||||||
|
background-color: #9c6e6e !important;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.can {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.can:hover {
|
||||||
|
transform: scale(1.1, 1.1);
|
||||||
|
text-shadow: 0px 0px 7px white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bought {
|
||||||
|
background-color: #68a66b !important;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
background-color: black;
|
||||||
|
border-color: black;
|
||||||
|
color: white;
|
||||||
|
font-size: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back:hover {
|
||||||
|
transform: scale(1.1, 1.1);
|
||||||
|
text-shadow: 0px 0px 7px white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reset {
|
||||||
|
height: 100px;
|
||||||
|
width: 150px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border-color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upg {
|
||||||
|
height: 120px;
|
||||||
|
width: 120px;
|
||||||
|
border-radius: 25%;
|
||||||
|
border-color: black;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upgBig {
|
||||||
|
height: 200px;
|
||||||
|
width: 200px;
|
||||||
|
border-radius: 25%;
|
||||||
|
border-color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.longUpg {
|
||||||
|
height: 50px;
|
||||||
|
width: 120px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border-color: black;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p {
|
||||||
|
background-color: #439ea3;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p_txt {
|
||||||
|
color: #439ea3;
|
||||||
|
text-shadow: 0px 0px 10px #439ea3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.b {
|
||||||
|
background-color: #415a9e;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.b_txt {
|
||||||
|
color: #415a9e;
|
||||||
|
text-shadow: 0px 0px 10px #415a9e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.g {
|
||||||
|
background-color: #409c6e;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.g_txt {
|
||||||
|
color: #409c6e;
|
||||||
|
text-shadow: 0px 0px 10px #409c6e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.e {
|
||||||
|
background-color: #9643a3;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.e_txt {
|
||||||
|
color: #9643a3;
|
||||||
|
text-shadow: 0px 0px 10px #9643a3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t {
|
||||||
|
background-color: #3f993d;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t_txt {
|
||||||
|
color: #3f993d;
|
||||||
|
text-shadow: 0px 0px 10px #3f993d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.s {
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.s_txt {
|
||||||
|
color: white;
|
||||||
|
text-shadow: 0px 0px 10px white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#optionWheel {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
right: 0px;
|
||||||
|
height: 40px;
|
||||||
|
width: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#optionWheel:hover {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.opt {
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 25%;
|
||||||
|
border-color: black;
|
||||||
|
background-color: #a1a1a1;
|
||||||
|
color: black;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.opt:hover {
|
||||||
|
background-color: #439ea3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
visibility: hidden;
|
||||||
|
height: 50px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.canvas {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
z-index: -999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.milestone {
|
||||||
|
width: 100%;
|
||||||
|
height: 75px;
|
||||||
|
background-color: #9e6d64;
|
||||||
|
}
|
||||||
|
|
||||||
|
.milestoneDone {
|
||||||
|
width: 100%;
|
||||||
|
height: 75px;
|
||||||
|
background-color: #68a66b;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove {
|
||||||
|
height: 24px;
|
||||||
|
width: 24px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove:hover {
|
||||||
|
transform: scale(1.1, 1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
[tooltip] {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
[tooltip]:before,
|
||||||
|
[tooltip]:after {
|
||||||
|
visibility: hidden;
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
[tooltip]:before {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 100%;
|
||||||
|
left: 50%;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-left: -80px;
|
||||||
|
padding: 7px;
|
||||||
|
width: 160px;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-color: #000;
|
||||||
|
background-color: hsla(0, 0%, 5%, 0.9);
|
||||||
|
color: #fff;
|
||||||
|
content: attr(tooltip);
|
||||||
|
text-align: center;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.2;
|
||||||
|
transition-duration: 0.5s;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
[tooltip]:after {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 100%;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -5px;
|
||||||
|
width: 0;
|
||||||
|
border-top: 5px solid #000;
|
||||||
|
border-top: 5px solid hsla(0, 0%, 5%, 0.9);
|
||||||
|
border-right: 5px solid transparent;
|
||||||
|
border-left: 5px solid transparent;
|
||||||
|
content: " ";
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
transition-duration: 0.5s;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
[tooltip]:hover:before,
|
||||||
|
[tooltip]:hover:after {
|
||||||
|
visibility: visible;
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||||
|
filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||||
|
opacity: 1;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
Loading…
Reference in a new issue