mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-23 17:01:47 +00:00
Beta v1.0
This commit is contained in:
parent
76a60008f8
commit
156925f97c
5 changed files with 61 additions and 15 deletions
30
index.html
30
index.html
|
@ -63,9 +63,17 @@
|
||||||
<li>Rebalanced the Super-Booster era (now up to 1e9,250 points)</li>
|
<li>Rebalanced the Super-Booster era (now up to 1e9,250 points)</li>
|
||||||
<li>Implemented a game version variable</li>
|
<li>Implemented a game version variable</li>
|
||||||
</ul><br><br>
|
</ul><br><br>
|
||||||
|
<h3>Beta v1.0</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Made sure any built-in saves had Auto-Save turned on</li>
|
||||||
|
<li>Fixed a visual bug for mobile users</li>
|
||||||
|
<li>Added a "time played" display in the info tab</li>
|
||||||
|
<li>Implemented a NaN check system</li>
|
||||||
|
</ul><br><br>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="player.tab=='info'" class="col right">
|
<div v-if="player.tab=='info'" 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>
|
||||||
|
Time Played: {{ formatTime(player.timePlayed) }}<br><br><br>
|
||||||
<div id="cl" onclick="showTab('changelog')">Changelog</div><br><br><br>
|
<div id="cl" onclick="showTab('changelog')">Changelog</div><br><br><br>
|
||||||
<h3>Hotkeys</h3><br><br>
|
<h3>Hotkeys</h3><br><br>
|
||||||
P: Prestige reset<br>
|
P: Prestige reset<br>
|
||||||
|
@ -161,25 +169,25 @@
|
||||||
<tr><td v-bind:class="{ milestone: player.s.best.lt(12), milestoneDone: player.s.best.gte(12) }">12 space energy<br>Generators reset nothing</td></tr>
|
<tr><td v-bind:class="{ milestone: player.s.best.lt(12), milestoneDone: player.s.best.gte(12) }">12 space energy<br>Generators reset nothing</td></tr>
|
||||||
</table><br><br>
|
</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>
|
<div class="upgRow">
|
||||||
<td v-for="id in 5">
|
<div v-for="id in 5">
|
||||||
<button v-if="tmp.sbUnl>=id" 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>
|
<button v-if="tmp.sbUnl>=id" 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>
|
</div>
|
||||||
</tr></table>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="layer=='sb'">
|
<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>
|
<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><tr><td v-bind:class="{ milestone: player.sb.best.lt(4), milestoneDone: player.sb.best.gte(4) }">4 Super-Boosters<br>Keep Booster/Generator milestones on reset</td></tr></table>
|
<tr><td v-bind:class="{ milestone: player.sb.best.lt(4), milestoneDone: player.sb.best.gte(4) }">4 Super-Boosters<br>Keep Booster/Generator milestones on reset</td></tr></table>
|
||||||
</div>
|
</div>
|
||||||
<br><br><br>
|
<br><br><br>
|
||||||
<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]=='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>
|
<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>
|
<br><br><br>
|
||||||
<table>
|
<div class="upgTable">
|
||||||
<tr v-for="row in LAYER_UPGS[layer].rows">
|
<div v-for="row in LAYER_UPGS[layer].rows" class="upgRow">
|
||||||
<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>
|
<div 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></div>
|
||||||
</tr>
|
</div>
|
||||||
</table>
|
</div>
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
25
js/game.js
25
js/game.js
|
@ -1,15 +1,17 @@
|
||||||
var player;
|
var player;
|
||||||
var tmp = {};
|
var tmp = {};
|
||||||
var needCanvasUpdate = true;
|
var needCanvasUpdate = true;
|
||||||
|
var NaNalert = false;
|
||||||
|
|
||||||
function getStartPlayer() {
|
function getStartPlayer() {
|
||||||
return {
|
return {
|
||||||
tab: "tree",
|
tab: "tree",
|
||||||
time: Date.now(),
|
time: Date.now(),
|
||||||
autosave: true,
|
autosave: true,
|
||||||
versionType: "alpha",
|
versionType: "beta",
|
||||||
version: 10,
|
version: 1.0,
|
||||||
timePlayed: 0,
|
timePlayed: 0,
|
||||||
|
hasNaN: false,
|
||||||
points: new Decimal(10),
|
points: new Decimal(10),
|
||||||
p: {
|
p: {
|
||||||
unl: false,
|
unl: false,
|
||||||
|
@ -718,7 +720,7 @@ function versionCheck() {
|
||||||
}
|
}
|
||||||
if (player.versionType=="alpha") {
|
if (player.versionType=="alpha") {
|
||||||
if (player.version<10&&player.sb.unl) {
|
if (player.version<10&&player.sb.unl) {
|
||||||
if (confirm("The Super-Booster era has been rebalanced since the last time you were here, so... would you like to import a built-in save for where you should start at?")) importSave(SAVES.PRE_SUPER_BOOSTERS)
|
if (confirm("Since the last time you played, several changes to Super-Booster effects have been made. Would you like to roll back your save to that point in the progression, in order for you to experience the new features properly?")) importSave(SAVES.PRE_SUPER_BOOSTERS)
|
||||||
setVersion = false;
|
setVersion = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -746,6 +748,7 @@ function checkForVars() {
|
||||||
if (player.s.buildings[5] === undefined) player.s.buildings[5] = new Decimal(0);
|
if (player.s.buildings[5] === undefined) player.s.buildings[5] = new Decimal(0);
|
||||||
if (player.sb === undefined) player.sb = getStartPlayer().sb
|
if (player.sb === undefined) player.sb = getStartPlayer().sb
|
||||||
if (player.timePlayed === undefined) player.timePlayed = 0
|
if (player.timePlayed === undefined) player.timePlayed = 0
|
||||||
|
if (player.hasNaN === undefined) player.hasNaN = false
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertToDecimal() {
|
function convertToDecimal() {
|
||||||
|
@ -789,6 +792,10 @@ function commaFormat(num, precision) {
|
||||||
|
|
||||||
function format(decimal, precision=3) {
|
function format(decimal, precision=3) {
|
||||||
decimal = new Decimal(decimal)
|
decimal = new Decimal(decimal)
|
||||||
|
if (isNaN(decimal.sign)||isNaN(decimal.layer)||isNaN(decimal.mag)) {
|
||||||
|
player.hasNaN = true;
|
||||||
|
return "NaN"
|
||||||
|
}
|
||||||
if (decimal.eq(1/0)) return "Infinity"
|
if (decimal.eq(1/0)) return "Infinity"
|
||||||
if (decimal.gte("eee1000")) return exponentialFormat(decimal, precision)
|
if (decimal.gte("eee1000")) return exponentialFormat(decimal, precision)
|
||||||
else if (decimal.gte("ee1000")) return "ee"+format(decimal.log10().log10())
|
else if (decimal.gte("ee1000")) return "ee"+format(decimal.log10().log10())
|
||||||
|
@ -802,6 +809,12 @@ function formatWhole(decimal) {
|
||||||
return format(decimal, 0)
|
return format(decimal, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatTime(s) {
|
||||||
|
if (s<60) return format(s)+"s"
|
||||||
|
else if (s<3600) return formatWhole(Math.floor(s/60))+"m "+format(s%60)+"s"
|
||||||
|
else return formatWhole(Math.floor(s/3600))+"h "+formatWhole(Math.floor(s/60)%60)+"m "+format(s%60)+"s"
|
||||||
|
}
|
||||||
|
|
||||||
function showTab(name) {
|
function showTab(name) {
|
||||||
if (!TAB_REQS[name]()) return
|
if (!TAB_REQS[name]()) return
|
||||||
player.tab = name
|
player.tab = name
|
||||||
|
@ -1323,6 +1336,7 @@ function getSuperBoosterPow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gameLoop(diff) {
|
function gameLoop(diff) {
|
||||||
|
if (isNaN(diff)) diff = 0;
|
||||||
player.timePlayed += diff
|
player.timePlayed += diff
|
||||||
if (player.p.upgrades.includes(11)) player.points = player.points.plus(tmp.pointGen.times(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))
|
if (player.g.unl) player.g.power = player.g.power.plus(tmp.layerEffs.g.times(diff))
|
||||||
|
@ -1333,6 +1347,11 @@ function gameLoop(diff) {
|
||||||
}
|
}
|
||||||
if (player.b.auto&&player.t.best.gte(5)) doReset("b")
|
if (player.b.auto&&player.t.best.gte(5)) doReset("b")
|
||||||
if (player.g.auto&&player.s.best.gte(5)) doReset("g")
|
if (player.g.auto&&player.s.best.gte(5)) doReset("g")
|
||||||
|
|
||||||
|
if (player.hasNaN&&!NaNalert) {
|
||||||
|
alert("We have detected a corruption in your save. Please visit https://discord.gg/wwQfgPa for help.")
|
||||||
|
NaNalert = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hardReset() {
|
function hardReset() {
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
const SAVES = {
|
const SAVES = {
|
||||||
PRE_SUPER_BOOSTERS: "eyJ0YWIiOiJvcHRpb25zIiwidGltZSI6MTU5ODE5ODI4NjQ4OCwiYXV0b3NhdmUiOmZhbHNlLCJwb2ludHMiOiIzLjM2MDE5MjY3OTg3MzQ4M2U0MTQzIiwicCI6eyJ1bmwiOnRydWUsInBvaW50cyI6IjIuMTIyNTcyOTgwNzY0MzE0NmUyNzYzIiwidXBncmFkZXMiOlsxMSwxMiwyMSwyMiwxMywyM10sImJlc3QiOiI1MTAyMjYwMDYifSwiYiI6eyJ1bmwiOnRydWUsInBvaW50cyI6IjE4MCIsInVwZ3JhZGVzIjpbMTEsMTIsMTMsMjIsMjEsMjNdLCJiZXN0IjoiMTgwIiwiYXV0byI6dHJ1ZX0sImciOnsidW5sIjp0cnVlLCJwb2ludHMiOiIxMzkiLCJwb3dlciI6IjIuMzQzMTU4NzU3MzI3NDg1ZTMzOSIsInVwZ3JhZGVzIjpbMTEsMTIsMTMsMTQ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idmVyc2lvblR5cGUiOiJhbHBoYSIsInZlcnNpb24iOjEwfQ==",
|
||||||
}
|
}
|
1
js/v.js
1
js/v.js
|
@ -8,6 +8,7 @@ function loadVue() {
|
||||||
tmp,
|
tmp,
|
||||||
format,
|
format,
|
||||||
formatWhole,
|
formatWhole,
|
||||||
|
formatTime,
|
||||||
layerUnl,
|
layerUnl,
|
||||||
getLayerEffDesc,
|
getLayerEffDesc,
|
||||||
doReset,
|
doReset,
|
||||||
|
|
18
style.css
18
style.css
|
@ -23,6 +23,24 @@ html, body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.upgTable {
|
||||||
|
display: flex !important;
|
||||||
|
flex-flow: column wrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upgRow {
|
||||||
|
display: flex !important;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
h1, h2 {
|
h1, h2 {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue