From 90fabb34d0146a48111ff906303534bfc818b795 Mon Sep 17 00:00:00 2001
From: Jacorb90 <39597610+Jacorb90@users.noreply.github.com>
Date: Fri, 21 Aug 2020 21:16:23 -0400
Subject: [PATCH] Alpha Build 8
---
index.html | 15 +++++++--
js/canvas.js | 1 +
js/game.js | 88 ++++++++++++++++++++++++++++++++++++++++++++++------
js/temp.js | 2 ++
js/v.js | 1 +
style.css | 10 ++++++
6 files changed, 105 insertions(+), 12 deletions(-)
diff --git a/index.html b/index.html
index d6378ab..49c7ca9 100644
--- a/index.html
+++ b/index.html
@@ -44,6 +44,11 @@
Balanced up to 1e4,175 points
Setup a temp variable system (to prevent lag later on)
+ Alpha Build 8
+
+ - Implemented Super Boosters
+ - Balanced up to 1e25,600 points
+
@@ -96,7 +101,8 @@
-
|
+
|
+ |
|
|
|
@@ -146,9 +152,12 @@
+
+
3 Super-Boosters Keep Prestige Upgrades on reset |
+
-
-
+
+
diff --git a/js/canvas.js b/js/canvas.js
index d618c52..03c7993 100644
--- a/js/canvas.js
+++ b/js/canvas.js
@@ -30,6 +30,7 @@ function drawTree() {
drawTreeBranch("g", "e")
}
if (layerUnl('t')) drawTreeBranch("b", "t")
+ if (layerUnl('sb')) drawTreeBranch("b", "sb")
if (layerUnl('s')) drawTreeBranch("g", "s")
needCanvasUpdate = false;
diff --git a/js/game.js b/js/game.js
index 825b61d..4016da5 100644
--- a/js/game.js
+++ b/js/game.js
@@ -61,10 +61,17 @@ function getStartPlayer() {
},
upgrades: [],
},
+ sb: {
+ unl: false,
+ order: 0,
+ points: new Decimal(0),
+ best: new Decimal(0),
+ upgrades: [],
+ },
}
}
-const LAYERS = ["p", "b", "g", "e", "t", "s"]
+const LAYERS = ["p", "b", "g", "e", "t", "s", "sb"]
const LAYER_REQS = {
p: new Decimal(10),
@@ -73,6 +80,7 @@ const LAYER_REQS = {
e: new Decimal(1e120),
t: new Decimal(1e120),
s: new Decimal(1e120),
+ sb: new Decimal(180),
}
const LAYER_RES = {
@@ -82,6 +90,7 @@ const LAYER_RES = {
e: "enhance points",
t: "time capsules",
s: "space energy",
+ sb: "super-boosters",
}
const LAYER_TYPE = {
@@ -91,6 +100,7 @@ const LAYER_TYPE = {
e: "normal",
t: "static",
s: "static",
+ sb: "static",
}
const LAYER_EXP = {
@@ -100,6 +110,7 @@ const LAYER_EXP = {
e: new Decimal(0.02),
t: new Decimal(1.85),
s: new Decimal(1.85),
+ sb: new Decimal(1.25),
}
const LAYER_BASE = {
@@ -107,6 +118,7 @@ const LAYER_BASE = {
g: new Decimal(5),
t: new Decimal(1e15),
s: new Decimal(1e15),
+ sb: new Decimal(1.05),
}
const LAYER_ROW = {
@@ -116,13 +128,14 @@ const LAYER_ROW = {
e: 2,
t: 2,
s: 2,
+ sb: 2,
future_layer: 3,
}
const ROW_LAYERS = [
["p"],
["b","g"],
- ["e","t","s"],
+ ["e","t","s","sb"],
["future_layer"],
]
@@ -133,6 +146,7 @@ const LAYER_EFFS = {
gain: Decimal.pow(3, player.t.points.plus(player.t.extCapsules.plus(tmp.freeExtCap))).sub(1).times(getTimeEnergyGainMult()),
limit: Decimal.pow(2, player.t.points.plus(player.t.extCapsules.plus(tmp.freeExtCap))).sub(1).times(100).times(getTimeEnergyLimitMult()),
}},
+ sb: function() { return Decimal.mul(45, player.sb.points.times(getSuperBoosterPow()).pow(1.25)) },
}
const LAYER_UPGS = {
@@ -520,6 +534,17 @@ const LAYER_UPGS = {
effDisp: function(x) { return "Add "+format(x)+" to exponent" },
},
},
+ sb: {
+ rows: 1,
+ cols: 1,
+ 11: {
+ desc: "Super-Boosters are stronger based on your Prestige Points.",
+ cost: new Decimal(2),
+ unl: function() { return player.sb.unl },
+ currently: function() { return Decimal.pow(10, player.p.points.plus(1).log10().div(1e5).sqrt()) },
+ effDisp: function(x) { return format(x)+"x" },
+ },
+ },
}
const TAB_REQS = {
@@ -533,6 +558,27 @@ const TAB_REQS = {
e: function() { return (player.e.unl||player.points.gte(tmp.layerReqs.e))&&layerUnl('e') },
t: function() { return (player.t.unl||player.points.gte(tmp.layerReqs.t))&&layerUnl('t') },
s: function() { return (player.s.unl||player.points.gte(tmp.layerReqs.s))&&layerUnl('s') },
+ sb: function() { return (player.sb.unl||player.b.points.gte(tmp.layerReqs.sb))&&layerUnl('sb') },
+}
+
+const LAYER_AMT_NAMES = {
+ p: "points",
+ b: "points",
+ g: "points",
+ t: "points",
+ e: "points",
+ s: "points",
+ sb: "boosters"
+}
+
+function getLayerAmt(layer) {
+ let amt = player.points
+ switch(layer) {
+ case "sb":
+ return player.b.points;
+ break;
+ }
+ return amt
}
function getLayerEffDesc(layer) {
@@ -548,6 +594,9 @@ function getLayerEffDesc(layer) {
case "t":
return "which are generating "+format(eff.gain)+" Time Energy/sec, but with a limit of "+format(eff.limit)+" Time Energy"
break;
+ case "sb":
+ return "which are adding "+format(eff)+" to the Booster effect base and providing "+format(eff)+" free Boosters"
+ break;
}
}
@@ -604,6 +653,7 @@ function checkForVars() {
if (player.s === undefined) player.s = getStartPlayer().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.sb === undefined) player.sb = getStartPlayer().sb
}
function convertToDecimal() {
@@ -626,6 +676,8 @@ function convertToDecimal() {
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])
+ player.sb.points = new Decimal(player.sb.points)
+ player.sb.best = new Decimal(player.sb.best)
}
function toggleOpt(name) {
@@ -728,13 +780,13 @@ function getLayerGainMult(layer) {
function getResetGain(layer) {
if (LAYER_TYPE[layer]=="static") {
- if ((!canBuyMax(layer)) || player.points.lt(tmp.layerReqs[layer])) return new Decimal(1)
- let gain = player.points.div(tmp.layerReqs[layer]).div(tmp.gainMults[layer]).max(1).log(LAYER_BASE[layer]).pow(Decimal.pow(LAYER_EXP[layer], -1))
+ if ((!canBuyMax(layer)) || tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return new Decimal(1)
+ let gain = tmp.layerAmt[layer].div(tmp.layerReqs[layer]).div(tmp.gainMults[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(tmp.layerReqs[layer])) return new Decimal(0)
- let gain = player.points.div(tmp.layerReqs[layer]).pow(LAYER_EXP[layer]).times(tmp.gainMults[layer])
+ if (tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return new Decimal(0)
+ let gain = tmp.layerAmt[layer].div(tmp.layerReqs[layer]).pow(LAYER_EXP[layer]).times(tmp.gainMults[layer])
return gain.floor().max(0);
}
@@ -767,6 +819,9 @@ function layerUnl(layer) {
case "s":
return player.g.unl;
break;
+ case "sb":
+ return player.e.unl&&player.t.unl&&player.s.unl;
+ break;
}
}
@@ -781,7 +836,7 @@ function rowReset(row, layer) {
player.p.points = new Decimal(0);
if (layer=="b"||layer=="g") {
if (player[layer].best.lt(8)) player.p.upgrades = [];
- } else if (layer=="t"||layer=="s") {
+ } else if (layer=="t"||layer=="s"||layer=="sb") {
if (player[layer].best.lt(3)) player.p.upgrades = [];
} else if (layer=="e") {
if (player[layer].best.lt(10)) player.p.upgrades = [];
@@ -830,16 +885,23 @@ function rowReset(row, layer) {
},
upgrades: [],
}
+ player.sb = {
+ unl: player.sb.unl,
+ order: 0,
+ points: new Decimal(0),
+ best: new Decimal(0),
+ upgrades: [],
+ }
break;
}
}
function doReset(layer, force=false) {
if (!force) {
- if (player.points.lt(tmp.layerReqs[layer])) return;
+ if (tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return;
let gain = tmp.resetGain[layer]
if (LAYER_TYPE[layer]=="static") {
- if (player.points.lt(tmp.nextAt[layer])) return;
+ if (tmp.layerAmt[layer].lt(tmp.nextAt[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)
@@ -897,12 +959,14 @@ function addToBoosterBase() {
if (player.e.unl) toAdd = toAdd.plus(tmp.enhEff2)
if (player.e.upgrades.includes(11)) toAdd = toAdd.plus(LAYER_UPGS.e[11].currently().b)
if (player.s.unl && tmp.spaceBuildEff) toAdd = toAdd.plus(tmp.spaceBuildEff[2])
+ if (player.sb.unl) toAdd = toAdd.plus(tmp.layerEffs.sb)
return toAdd
}
function getFreeBoosters() {
let free = new Decimal(0)
if (player.t.upgrades.includes(24)) free = free.plus(18)
+ if (player.sb.unl) free = free.plus(tmp.layerEffs.sb)
return free
}
@@ -1148,6 +1212,12 @@ function toggleAuto(layer) {
player[layer].auto = !player[layer].auto
}
+function getSuperBoosterPow() {
+ let pow = new Decimal(1)
+ if (player.sb.upgrades.includes(11)) pow = pow.times(LAYER_UPGS.sb[11].currently())
+ return pow;
+}
+
function gameLoop(diff) {
if (player.p.upgrades.includes(11)) player.points = player.points.plus(tmp.pointGen.times(diff))
if (player.g.unl) player.g.power = player.g.power.plus(tmp.layerEffs.g.times(diff))
diff --git a/js/temp.js b/js/temp.js
index 66bb1ba..968b5a8 100644
--- a/js/temp.js
+++ b/js/temp.js
@@ -8,7 +8,9 @@ function updateTemp() {
if (!tmp.gainMults) tmp.gainMults = {}
if (!tmp.resetGain) tmp.resetGain = {}
if (!tmp.nextAt) tmp.nextAt = {}
+ if (!tmp.layerAmt) tmp.layerAmt = {}
for (let i in LAYERS) {
+ tmp.layerAmt[LAYERS[i]] = getLayerAmt(LAYERS[i])
tmp.gainMults[LAYERS[i]] = getLayerGainMult(LAYERS[i])
tmp.resetGain[LAYERS[i]] = getResetGain(LAYERS[i])
tmp.nextAt[LAYERS[i]] = getNextAt(LAYERS[i])
diff --git a/js/v.js b/js/v.js
index 8f96f62..c743068 100644
--- a/js/v.js
+++ b/js/v.js
@@ -24,6 +24,7 @@ function loadVue() {
LAYER_TYPE,
LAYER_UPGS,
LAYER_EFFS,
+ LAYER_AMT_NAMES
},
})
}
\ No newline at end of file
diff --git a/style.css b/style.css
index b920ad8..b257c12 100644
--- a/style.css
+++ b/style.css
@@ -167,6 +167,16 @@ h1, h2 {
text-shadow: 0px 0px 10px white;
}
+.sb {
+ background-color: #415a9e;
+ color: black;
+}
+
+.sb_txt {
+ color: #415a9e;
+ text-shadow: 0px 0px 10px #415a9e;
+}
+
#optionWheel {
position: absolute;
top: 0px;