mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-24 09:21:46 +00:00
Alpha Build 2
This commit is contained in:
parent
eac0ef7411
commit
220b9fd841
3 changed files with 119 additions and 13 deletions
19
index.html
19
index.html
|
@ -11,8 +11,19 @@
|
||||||
<body onload="load()">
|
<body onload="load()">
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<img id="optionWheel" v-if="player.tab!='options'" src="options_wheel.png" onclick="showTab('options')"></img>
|
<img id="optionWheel" v-if="player.tab!='options'" src="options_wheel.png" onclick="showTab('options')"></img>
|
||||||
|
<div id="info" v-if="player.tab=='tree'" onclick="showTab('info')"><br>i</div>
|
||||||
<div class="vl"></div>
|
<div class="vl"></div>
|
||||||
<br>You have <h2>{{format(player.points)}}</h2> Points
|
<br><br>
|
||||||
|
<div v-if="player.tab=='info'" class="col right">
|
||||||
|
<button class="back" onclick="showTab('tree')">←</button><br><br><br><br><br>
|
||||||
|
<h3>Hotkeys</h3><br><br>
|
||||||
|
P: Prestige reset<br>
|
||||||
|
<span v-if="player.b.unl">B: Booster reset</span><br>
|
||||||
|
<span v-if="player.g.unl">G: Generator reset</span><br>
|
||||||
|
<span v-if="player.t.unl">T: Time reset</span><br>
|
||||||
|
<span v-if="player.e.unl">E: Enhance reset</span><br>
|
||||||
|
<span v-if="player.s.unl">S: Space reset</span><br>
|
||||||
|
</div>
|
||||||
<div v-if="player.tab=='options'" class="col right">
|
<div v-if="player.tab=='options'" class="col right">
|
||||||
<button class="back" onclick="showTab('tree')">←</button><br><br><br><br><br>
|
<button class="back" onclick="showTab('tree')">←</button><br><br><br><br><br>
|
||||||
<table>
|
<table>
|
||||||
|
@ -30,6 +41,7 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col left">
|
<div class="col left">
|
||||||
|
You have <h2>{{format(player.points)}}</h2> Points
|
||||||
<br><br><br><br><br>
|
<br><br><br><br><br>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -80,13 +92,16 @@
|
||||||
You have {{format(player.t.energy)}} Time Energy, which multiplies Point gain & Prestige Point gain by {{format(getTimeEnergyEff())}}<br><br>
|
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><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>
|
||||||
<tr><td v-bind:class="{ milestone: player.t.best.lt(3), milestoneDone: player.t.best.gte(3) }">3 time capsules<br>Keep Prestige Upgrades on reset</td></tr>
|
<tr><td v-bind:class="{ milestone: player.t.best.lt(3), milestoneDone: player.t.best.gte(3) }">3 time capsules<br>Keep Prestige Upgrades on reset</td></tr>
|
||||||
|
<tr><td v-bind:class="{ milestone: player.t.best.lt(4), milestoneDone: player.t.best.gte(4) }">4 time capsules<br>Keep Booster Upgrades on all row 3 resets</td></tr>
|
||||||
</table><br><br>
|
</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>
|
<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>
|
||||||
<div v-if="layer=='s'">
|
<div v-if="layer=='s'">
|
||||||
You have {{formatWhole(getSpace())}} Space.<br><br>
|
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><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>
|
||||||
<tr><td v-bind:class="{ milestone: player.s.best.lt(3), milestoneDone: player.s.best.gte(3) }">3 space energy<br>Keep Prestige Upgrades on reset</td></tr></table><br><br>
|
<tr><td v-bind:class="{ milestone: player.s.best.lt(3), milestoneDone: player.s.best.gte(3) }">3 space energy<br>Keep Prestige Upgrades on reset</td></tr>
|
||||||
|
<tr><td v-bind:class="{ milestone: player.s.best.lt(4), milestoneDone: player.s.best.gte(4) }">4 space energy<br>Keep Generator Upgrades on all row 3 resets</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>
|
<button onclick="respecSpaceBuildings()" v-bind:class="{ longUpg: true, can: player.s.unl, locked: !player.s.unl }">Respec Space Buildings</button><br>
|
||||||
<table><tr>
|
<table><tr>
|
||||||
<td v-for="id in 4">
|
<td v-for="id in 4">
|
||||||
|
|
93
js/game.js
93
js/game.js
|
@ -126,7 +126,7 @@ const LAYER_EFFS = {
|
||||||
b: function() { return Decimal.pow(Decimal.add(2, addToBoosterBase()), player.b.points) },
|
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()) },
|
g: function() { return Decimal.pow(Decimal.add(2, addToGenBase()), player.g.points).sub(1).times(getGenPowerGainMult()) },
|
||||||
t: function() { return {
|
t: function() { return {
|
||||||
gain: Decimal.pow(3, player.t.points.plus(player.t.extCapsules.plus(getFreeExtCapsules()))).sub(1),
|
gain: Decimal.pow(3, player.t.points.plus(player.t.extCapsules.plus(getFreeExtCapsules()))).sub(1).times(getTimeEnergyGainMult()),
|
||||||
limit: Decimal.pow(2, player.t.points.plus(player.t.extCapsules.plus(getFreeExtCapsules()))).sub(1).times(100).times(getTimeEnergyLimitMult()),
|
limit: Decimal.pow(2, player.t.points.plus(player.t.extCapsules.plus(getFreeExtCapsules()))).sub(1).times(100).times(getTimeEnergyLimitMult()),
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ const LAYER_UPGS = {
|
||||||
desc: "Generators add to the Booster effect.",
|
desc: "Generators add to the Booster effect.",
|
||||||
cost: new Decimal(7),
|
cost: new Decimal(7),
|
||||||
unl: function() { return player.g.unl },
|
unl: function() { return player.g.unl },
|
||||||
currently: function() { return player.g.points.plus(1).log10().sqrt().div(3).times(player.t.upgrades.includes(14)?5:1) },
|
currently: function() { return player.g.points.plus(1).log10().sqrt().div(3).times(player.t.upgrades.includes(14)?8.5:1) },
|
||||||
effDisp: function(x) { return "+"+format(x)+" to base" },
|
effDisp: function(x) { return "+"+format(x)+" to base" },
|
||||||
},
|
},
|
||||||
13: {
|
13: {
|
||||||
|
@ -238,7 +238,7 @@ const LAYER_UPGS = {
|
||||||
desc: "Boosters boost Generator Power gain.",
|
desc: "Boosters boost Generator Power gain.",
|
||||||
cost: new Decimal(7),
|
cost: new Decimal(7),
|
||||||
unl: function() { return player.b.unl },
|
unl: function() { return player.b.unl },
|
||||||
currently: function() { return player.b.points.plus(1).log10().sqrt().div(3).times(player.t.upgrades.includes(14)?2.75:1) },
|
currently: function() { return player.b.points.plus(1).log10().sqrt().div(3).times(player.t.upgrades.includes(14)?3.75:1) },
|
||||||
effDisp: function(x) { return "+"+format(x)+" to base" },
|
effDisp: function(x) { return "+"+format(x)+" to base" },
|
||||||
},
|
},
|
||||||
13: {
|
13: {
|
||||||
|
@ -318,7 +318,7 @@ const LAYER_UPGS = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
t: {
|
t: {
|
||||||
rows: 1,
|
rows: 2,
|
||||||
cols: 4,
|
cols: 4,
|
||||||
11: {
|
11: {
|
||||||
desc: "Non-extra Time Capsules boost the Booster effect.",
|
desc: "Non-extra Time Capsules boost the Booster effect.",
|
||||||
|
@ -342,13 +342,35 @@ const LAYER_UPGS = {
|
||||||
effDisp: function(x) { return "+"+format(x) },
|
effDisp: function(x) { return "+"+format(x) },
|
||||||
},
|
},
|
||||||
14: {
|
14: {
|
||||||
desc: "Generator Upgrades 2 & 10 is 175% stronger, and Booster Upgrade 2 is 400% stronger.",
|
desc: "Generator Upgrades 2 & 10 are 275% stronger, and Booster Upgrade 2 is 750% stronger.",
|
||||||
cost: new Decimal(4),
|
cost: new Decimal(4),
|
||||||
unl: function() { return player.t.upgrades.includes(12)||player.t.upgrades.includes(13) },
|
unl: function() { return player.t.upgrades.includes(12)||player.t.upgrades.includes(13) },
|
||||||
},
|
},
|
||||||
|
21: {
|
||||||
|
desc: "Time Energy boosts its own production & cap, and the Time Energy effect uses a better formula.",
|
||||||
|
cost: new Decimal(4),
|
||||||
|
unl: function() { return player.t.upgrades.includes(14) },
|
||||||
|
currently: function() { return player.t.energy.plus(1).log10().pow(1.1).plus(1) },
|
||||||
|
effDisp: function(x) { return format(x)+"x" },
|
||||||
|
},
|
||||||
|
22: {
|
||||||
|
desc: "???",
|
||||||
|
cost: new Decimal(1/0),
|
||||||
|
unl: function() { return false },
|
||||||
|
},
|
||||||
|
23: {
|
||||||
|
desc: "???",
|
||||||
|
cost: new Decimal(1/0),
|
||||||
|
unl: function() { return false },
|
||||||
|
},
|
||||||
|
24: {
|
||||||
|
desc: "???",
|
||||||
|
cost: new Decimal(1/0),
|
||||||
|
unl: function() { return false },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
s: {
|
s: {
|
||||||
rows: 1,
|
rows: 2,
|
||||||
cols: 4,
|
cols: 4,
|
||||||
11: {
|
11: {
|
||||||
desc: "Add a free level to all Space Buildings.",
|
desc: "Add a free level to all Space Buildings.",
|
||||||
|
@ -374,12 +396,35 @@ const LAYER_UPGS = {
|
||||||
cost: new Decimal(4),
|
cost: new Decimal(4),
|
||||||
unl: function() { return player.s.upgrades.includes(12)&&player.s.upgrades.includes(13) },
|
unl: function() { return player.s.upgrades.includes(12)&&player.s.upgrades.includes(13) },
|
||||||
},
|
},
|
||||||
|
21: {
|
||||||
|
desc: "All Space Buildings are stronger based on your Generators.",
|
||||||
|
cost: new Decimal(4),
|
||||||
|
unl: function() { return player.s.upgrades.includes(14) },
|
||||||
|
currently: function() { return player.g.points.plus(1).log10().div(1.5).plus(1) },
|
||||||
|
effDisp: function(x) { return format(x.sub(1).times(100))+"% stronger" },
|
||||||
|
},
|
||||||
|
22: {
|
||||||
|
desc: "???",
|
||||||
|
cost: new Decimal(1/0),
|
||||||
|
unl: function() { return false },
|
||||||
|
},
|
||||||
|
23: {
|
||||||
|
desc: "???",
|
||||||
|
cost: new Decimal(1/0),
|
||||||
|
unl: function() { return false },
|
||||||
|
},
|
||||||
|
24: {
|
||||||
|
desc: "???",
|
||||||
|
cost: new Decimal(1/0),
|
||||||
|
unl: function() { return false },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const TAB_REQS = {
|
const TAB_REQS = {
|
||||||
tree: function() { return true },
|
tree: function() { return true },
|
||||||
options: function() { return true },
|
options: function() { return true },
|
||||||
|
info: function() { return true },
|
||||||
p: function() { return (player.p.unl||player.points.gte(getLayerReq('p')))&&layerUnl('p') },
|
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') },
|
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') },
|
g: function() { return (player.g.unl||player.points.gte(getLayerReq('g')))&&layerUnl('g') },
|
||||||
|
@ -634,11 +679,11 @@ function rowReset(row, layer) {
|
||||||
case 2:
|
case 2:
|
||||||
player.b.points = new Decimal(0);
|
player.b.points = new Decimal(0);
|
||||||
player.b.best = new Decimal(0);
|
player.b.best = new Decimal(0);
|
||||||
player.b.upgrades = [];
|
if (!player.t.best.gte(4)) player.b.upgrades = [];
|
||||||
player.g.points = new Decimal(0);
|
player.g.points = new Decimal(0);
|
||||||
player.g.power = new Decimal(0);
|
player.g.power = new Decimal(0);
|
||||||
player.g.best = new Decimal(0);
|
player.g.best = new Decimal(0);
|
||||||
player.g.upgrades = [];
|
if (!player.s.best.gte(4)) player.g.upgrades = [];
|
||||||
player.t.energy = new Decimal(0);
|
player.t.energy = new Decimal(0);
|
||||||
if (layer=="t"||layer=="e"||layer=="s") {
|
if (layer=="t"||layer=="e"||layer=="s") {
|
||||||
if (player[layer].best.gte(2)) {
|
if (player[layer].best.gte(2)) {
|
||||||
|
@ -802,14 +847,24 @@ function getFreeExtCapsules() {
|
||||||
|
|
||||||
function getTimeEnergyEff() {
|
function getTimeEnergyEff() {
|
||||||
if (!player.t.unl) return new Decimal(1)
|
if (!player.t.unl) return new Decimal(1)
|
||||||
let eff = player.t.energy.plus(1).pow(1.2)
|
let exp = 1.2
|
||||||
|
if (player.t.upgrades.includes(21)) exp = 1.75
|
||||||
|
let eff = player.t.energy.plus(1).pow(exp)
|
||||||
return eff;
|
return eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getTimeEnergyGainMult() {
|
||||||
|
if (!player.t.unl) return new Decimal(1)
|
||||||
|
let mult = new Decimal(1);
|
||||||
|
if (player.t.upgrades.includes(21)) mult = mult.times(LAYER_UPGS.t[21].currently())
|
||||||
|
return mult;
|
||||||
|
}
|
||||||
|
|
||||||
function getTimeEnergyLimitMult() {
|
function getTimeEnergyLimitMult() {
|
||||||
if (!player.t.unl) return new Decimal(1)
|
if (!player.t.unl) return new Decimal(1)
|
||||||
let mult = new Decimal(1);
|
let mult = new Decimal(1);
|
||||||
if (player.t.upgrades.includes(12)) mult = mult.times(LAYER_UPGS.t[12].currently())
|
if (player.t.upgrades.includes(12)) mult = mult.times(LAYER_UPGS.t[12].currently())
|
||||||
|
if (player.t.upgrades.includes(21)) mult = mult.times(LAYER_UPGS.t[21].currently())
|
||||||
return mult;
|
return mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,6 +894,13 @@ function getSpaceBuildingCost(x) {
|
||||||
return cost
|
return cost
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSpaceBuildingPow() {
|
||||||
|
if (!player.s.unl) return new Decimal(0)
|
||||||
|
let pow = new Decimal(1)
|
||||||
|
if (player.s.upgrades.includes(21)) pow = pow.times(LAYER_UPGS.s[21].currently())
|
||||||
|
return pow
|
||||||
|
}
|
||||||
|
|
||||||
function getExtraBuildingLevels(x) {
|
function getExtraBuildingLevels(x) {
|
||||||
let lvl = new Decimal(0)
|
let lvl = new Decimal(0)
|
||||||
if (player.s.upgrades.includes(11)) lvl = lvl.plus(1);
|
if (player.s.upgrades.includes(11)) lvl = lvl.plus(1);
|
||||||
|
@ -850,6 +912,8 @@ function getSpaceBuildingEff(x) {
|
||||||
let bought = player.s.buildings[x].plus(getExtraBuildingLevels(x));
|
let bought = player.s.buildings[x].plus(getExtraBuildingLevels(x));
|
||||||
if (!player.s.unl) bought = new Decimal(0);
|
if (!player.s.unl) bought = new Decimal(0);
|
||||||
if (getSpaceBuildingsUnl()<x) bought = new Decimal(0);
|
if (getSpaceBuildingsUnl()<x) bought = new Decimal(0);
|
||||||
|
let power = getSpaceBuildingPow()
|
||||||
|
bought = bought.times(power)
|
||||||
switch(x) {
|
switch(x) {
|
||||||
case 1:
|
case 1:
|
||||||
return Decimal.pow(Decimal.add(1, bought), player.s.points.sqrt()).times(Decimal.mul(4, bought)).max(1)
|
return Decimal.pow(Decimal.add(1, bought), player.s.points.sqrt()).times(Decimal.mul(4, bought)).max(1)
|
||||||
|
@ -897,7 +961,7 @@ function buyBuilding(x) {
|
||||||
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<=3;i++) player.s.buildings[i] = new Decimal(0)
|
for (let i=1;i<=4;i++) player.s.buildings[i] = new Decimal(0)
|
||||||
player.s.spent = new Decimal(0)
|
player.s.spent = new Decimal(0)
|
||||||
doReset("s", true)
|
doReset("s", true)
|
||||||
}
|
}
|
||||||
|
@ -934,4 +998,11 @@ var interval = setInterval(function() {
|
||||||
player.time = Date.now()
|
player.time = Date.now()
|
||||||
if (needCanvasUpdate && player.tab=="tree") resizeCanvas();
|
if (needCanvasUpdate && player.tab=="tree") resizeCanvas();
|
||||||
gameLoop(diff)
|
gameLoop(diff)
|
||||||
}, 50)
|
}, 50)
|
||||||
|
|
||||||
|
document.onkeydown = function(e) {
|
||||||
|
let shiftDown = e.shiftKey
|
||||||
|
let key = e.key
|
||||||
|
if (!LAYERS.includes(key)) return
|
||||||
|
if (player[key].unl) doReset(key)
|
||||||
|
}
|
20
style.css
20
style.css
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
*:focus {
|
*:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
webkit-outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
@ -172,6 +173,25 @@ h1, h2 {
|
||||||
transform: rotate(360deg);
|
transform: rotate(360deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#info {
|
||||||
|
font-size: 20px;
|
||||||
|
color: white;
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
right: 0px;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
-webkit-text-stroke-width: 1px;
|
||||||
|
-webkit-text-stroke-color: #02f2f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#info:hover {
|
||||||
|
transform: scale(1.2, 1.2);
|
||||||
|
text-shadow: 5px 0px 10px #02f2f2,
|
||||||
|
-3px 0px 12px #02f2f2;
|
||||||
|
}
|
||||||
|
|
||||||
.opt {
|
.opt {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
|
|
Loading…
Reference in a new issue