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

More fixes and improvements

This commit is contained in:
Acamaeda 2020-09-24 19:32:34 -04:00
parent 4ac7199547
commit 350e941ced
4 changed files with 12 additions and 13 deletions

View file

@ -130,8 +130,8 @@
<button v-if="layers[layer].type=='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-bind:style="{'background-color': layers[layer].color}" v-on:click="doReset(layer)"><span v-if="player[layer].points.lt(10)">Reset for </span>+<b>{{formatWhole(tmp.resetGain[layer])}}</b> {{layers[layer].resource}}<br><br><span v-if="player[layer].points.lt(10)">Req: {{formatWhole(tmp.layerAmt[layer])}} / </span>{{(layers[layer].resCeil ? formatWhole(tmp.nextAt[layer]) : format(tmp.nextAt[layer]))}} {{ layers[layer].baseResource }}</button>
<span v-if="layers[layer].type=='normal' && tmp.resetGain[layer].lt(100) && player[layer].points.lt(1e3)"><br>You have {{formatWhole(tmp.layerAmt[layer])}} {{layers[layer].baseResource}}</span>
<br><br>
<span v-if="layer!='c'">Your best {{layers[layer].resource}} is {{formatWhole(player[layer].best)}}<br></span>
<span v-if="player[layer].total">You have made a total of {{formatWhole(player[layer].total)}} {{layers[layer].resource}}<br></span>
<span v-if="player[layer].best != undefined">Your best {{layers[layer].resource}} is {{formatWhole(player[layer].best)}}<br></span>
<span v-if="player[layer].total != undefined">You have made a total of {{formatWhole(player[layer].total)}} {{layers[layer].resource}}<br></span>
<div v-if="layers[layer].milestones">
<table>
<tr v-for="id in Object.keys(layers[layer].milestones)">

View file

@ -118,7 +118,7 @@ function convertToDecimal() {
player.points = new Decimal(player.points)
for (layer in layers) {
player[layer].points = new Decimal(player[layer].points)
player[layer].best = new Decimal(player[layer].best)
if (player[layer].best != undefined) player[layer].best = new Decimal(player[layer].best)
if (player[layer].total !== undefined) player[layer].total = new Decimal(player[layer].total)
if (layers[layer].convertToDecimal) layers[layer].convertToDecimal();
}
@ -298,14 +298,14 @@ function doReset(layer, force=false) {
if (layers[layer].incr_order){
for (lr in layers[layer].incr_order)
player.lr.order++
if (!player[lr].unl) player[lr].order++
}
}
tmp.layerAmt[layer] = new Decimal(0) // quick fix
}
if (layers[layer].resetsNothing()) return
if (layers[layer].resetsNothing && layers[layer].resetsNothing()) return
for (layerResetting in layers) {

View file

@ -4,6 +4,7 @@ var layers = {
unl: true,
points: new Decimal(0),
best: new Decimal(0),
total: new Decimal(0),
upgrades: [],
milestones: [],
beep: false,
@ -102,7 +103,6 @@ var layers = {
startData() { return {
unl: false,
points: new Decimal(0),
best: new Decimal(0),
boop: false,
}},
color: "#FE0102",
@ -121,7 +121,6 @@ var layers = {
},
row: 1,
layerShown() {return true},
resetsNothing() {return false},
branches: [["c", 1]] // Each pair corresponds to a line added to the tree when this node is unlocked. The letter is the other end of the line, and the number affects the color, 1 is default
},
}

View file

@ -4,6 +4,8 @@ var layers = {
unl: true,
points: new Decimal(0),
best: new Decimal(0),
total: new Decimal(0),
order: 0, // Used for tracking other relevant layers unlocked before this one
upgrades: [],
milestones: [],
challs: [],
@ -103,7 +105,7 @@ var layers = {
},
},
convertToDecimal() {
// Convert any layer-specific values (besides points, total, and best) to Decimal
// Convert any layer-specific values (besides points, total, and best) to Decimal after loading
},
layerShown() {return true}, // Condition for when layer appears
update(diff) {
@ -118,11 +120,10 @@ var layers = {
incr_order: [], // Array of layer names to have their order increased when this one is first unlocked
branches: [] // Each pair corresponds to a line added to the tree when this node is unlocked. The letter is the other end of the line, and the number affects the color, 1 is default
},
f: { // This layer contains a more minimal set of things, besides a branch
f: { // This layer contains a more minimal set of things, besides a branch and "boop"
startData() { return {
unl: false,
points: new Decimal(0),
best: new Decimal(0),
boop: false,
}},
color: "#FE0102",
@ -141,7 +142,6 @@ var layers = {
},
row: 1,
layerShown() {return true}, // Condition for when layer appears
resetsNothing() {return false},
branches: [["c", 1]] // Each pair corresponds to a line added to the tree when this node is unlocked. The letter is the other end of the line, and the number affects the color, 1 is default
},
}