1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 08:12:39 +00:00

Alpha Build 8

This commit is contained in:
Jacorb90 2020-08-21 21:16:23 -04:00
parent d3f598f3c8
commit 90fabb34d0
6 changed files with 105 additions and 12 deletions

View file

@ -44,6 +44,11 @@
<li>Balanced up to 1e4,175 points</li>
<li>Setup a temp variable system (to prevent lag later on)</li>
</ul><br><br>
<h3>Alpha Build 8</h3>
<ul>
<li>Implemented Super Boosters</li>
<li>Balanced up to 1e25,600 points</li>
</ul><br><br>
</div>
<div v-if="player.tab=='info'" class="col right">
<button class="back" onclick="showTab('tree')"></button><br><br><br><br><br>
@ -96,7 +101,8 @@
</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 v-if="player.e.unl||player.t.unl||player.s.unl||player.sb.unl" class="left"><br><br><img class="remove" src="remove.png" onclick="resetRow(2)"></img></td>
<td id="sb" v-if="layerUnl('sb')"><button onclick="showTab('sb')" v-bind:tooltip="((player.b.points.gte(tmp.layerReqs.sb)||player.sb.unl)&&layerUnl('sb')) ? (formatWhole(player.sb.points)+' super-boosters') : ('Reach '+formatWhole(tmp.layerReqs.sb)+' boosters to unlock')" v-bind:class="{ treeNode: true, sb: true, locked: (player.b.points.lt(tmp.layerReqs.sb)&&!player.sb.unl), can: (player.b.points.gte(tmp.layerReqs.sb)||player.sb.unl) }">SB</button></td>
<td id="t" v-if="layerUnl('t')"><button onclick="showTab('t')" v-bind:tooltip="((player.points.gte(tmp.layerReqs.t)||player.t.unl)&&layerUnl('t')) ? (formatWhole(player.t.points)+' time capsules') : ('Reach '+format(tmp.layerReqs.t)+' points to unlock')" v-bind:class="{ treeNode: true, t: true, locked: (player.points.lt(tmp.layerReqs.t)&&!player.t.unl), can: (player.points.gte(tmp.layerReqs.t)||player.t.unl) }">T</button></td>
<td id="e" v-if="layerUnl('e')"><button onclick="showTab('e')" v-bind:tooltip="((player.points.gte(tmp.layerReqs.e)||player.e.unl)&&layerUnl('e')) ? (formatWhole(player.e.points)+' enhance points') : ('Reach '+format(tmp.layerReqs.e)+' points to unlock')" v-bind:class="{ treeNode: true, e: true, locked: (player.points.lt(tmp.layerReqs.e)&&!player.e.unl), can: (player.points.gte(tmp.layerReqs.e)||player.e.unl) }">E</button></td>
<td id="s" v-if="layerUnl('s')"><button onclick="showTab('s')" v-bind:tooltip="((player.points.gte(tmp.layerReqs.s)||player.s.unl)&&layerUnl('s')) ? (formatWhole(player.s.points)+' space energy') : ('Reach '+format(tmp.layerReqs.s)+' points to unlock')" v-bind:class="{ treeNode: true, s: true, locked: (player.points.lt(tmp.layerReqs.s)&&!player.s.unl), can: (player.points.gte(tmp.layerReqs.s)||player.s.unl) }">S</button></td>
@ -146,9 +152,12 @@
</td>
</tr></table>
</div>
<div v-if="layer=='sb'">
<table><tr><td v-bind:class="{ milestone: player.sb.best.lt(3), milestoneDone: player.sb.best.gte(3) }">3 Super-Boosters<br>Keep Prestige Upgrades on reset</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(tmp.layerReqs[layer]), can: player.points.gte(tmp.layerReqs[layer]) }" v-on:click="doReset(layer)">+{{formatWhole(tmp.resetGain[layer])}} {{LAYER_RES[layer]}}<br>Next at {{ format(tmp.nextAt[layer]) }} points</button>
<button v-if="LAYER_TYPE[layer]=='static'" v-bind:class="{ [layer]: true, reset: true, locked: player.points.lt(tmp.nextAt[layer]), can: player.points.gte(tmp.nextAt[layer]) }" v-on:click="doReset(layer)">+{{formatWhole(tmp.resetGain[layer])}} {{LAYER_RES[layer]}}<br>Req: {{format(tmp.nextAt[layer])}} points</button>
<button v-if="LAYER_TYPE[layer]=='normal'" v-bind:class="{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.layerReqs[layer]), can: tmp.layerAmt[layer].gte(tmp.layerReqs[layer]) }" v-on:click="doReset(layer)">+{{formatWhole(tmp.resetGain[layer])}} {{LAYER_RES[layer]}}<br>Next at {{ format(tmp.nextAt[layer]) }} {{ LAYER_AMT_NAMES[layer] }}</button>
<button v-if="LAYER_TYPE[layer]=='static'" v-bind:class="{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.nextAt[layer]), can: tmp.layerAmt[layer].gte(tmp.nextAt[layer]) }" v-on:click="doReset(layer)">+{{formatWhole(tmp.resetGain[layer])}} {{LAYER_RES[layer]}}<br>Req: {{format(tmp.nextAt[layer])}} {{ LAYER_AMT_NAMES[layer] }}</button>
<br><br><br>
<table>
<tr v-for="row in LAYER_UPGS[layer].rows">

View file

@ -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;

View file

@ -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))

View file

@ -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])

View file

@ -24,6 +24,7 @@ function loadVue() {
LAYER_TYPE,
LAYER_UPGS,
LAYER_EFFS,
LAYER_AMT_NAMES
},
})
}

View file

@ -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;