mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-04-10 19:43:11 +00:00
More fixes and improvements
This commit is contained in:
parent
4ac7199547
commit
350e941ced
4 changed files with 12 additions and 13 deletions
|
@ -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>
|
<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>
|
<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>
|
<br><br>
|
||||||
<span v-if="layer!='c'">Your best {{layers[layer].resource}} is {{formatWhole(player[layer].best)}}<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">You have made a total of {{formatWhole(player[layer].total)}} {{layers[layer].resource}}<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">
|
<div v-if="layers[layer].milestones">
|
||||||
<table>
|
<table>
|
||||||
<tr v-for="id in Object.keys(layers[layer].milestones)">
|
<tr v-for="id in Object.keys(layers[layer].milestones)">
|
||||||
|
|
|
@ -118,7 +118,7 @@ function convertToDecimal() {
|
||||||
player.points = new Decimal(player.points)
|
player.points = new Decimal(player.points)
|
||||||
for (layer in layers) {
|
for (layer in layers) {
|
||||||
player[layer].points = new Decimal(player[layer].points)
|
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 (player[layer].total !== undefined) player[layer].total = new Decimal(player[layer].total)
|
||||||
if (layers[layer].convertToDecimal) layers[layer].convertToDecimal();
|
if (layers[layer].convertToDecimal) layers[layer].convertToDecimal();
|
||||||
}
|
}
|
||||||
|
@ -298,14 +298,14 @@ function doReset(layer, force=false) {
|
||||||
|
|
||||||
if (layers[layer].incr_order){
|
if (layers[layer].incr_order){
|
||||||
for (lr in 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
|
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) {
|
for (layerResetting in layers) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ var layers = {
|
||||||
unl: true,
|
unl: true,
|
||||||
points: new Decimal(0),
|
points: new Decimal(0),
|
||||||
best: new Decimal(0),
|
best: new Decimal(0),
|
||||||
|
total: new Decimal(0),
|
||||||
upgrades: [],
|
upgrades: [],
|
||||||
milestones: [],
|
milestones: [],
|
||||||
beep: false,
|
beep: false,
|
||||||
|
@ -102,7 +103,6 @@ var layers = {
|
||||||
startData() { return {
|
startData() { return {
|
||||||
unl: false,
|
unl: false,
|
||||||
points: new Decimal(0),
|
points: new Decimal(0),
|
||||||
best: new Decimal(0),
|
|
||||||
boop: false,
|
boop: false,
|
||||||
}},
|
}},
|
||||||
color: "#FE0102",
|
color: "#FE0102",
|
||||||
|
@ -121,7 +121,6 @@ var layers = {
|
||||||
},
|
},
|
||||||
row: 1,
|
row: 1,
|
||||||
layerShown() {return true},
|
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
|
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
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ var layers = {
|
||||||
unl: true,
|
unl: true,
|
||||||
points: new Decimal(0),
|
points: new Decimal(0),
|
||||||
best: new Decimal(0),
|
best: new Decimal(0),
|
||||||
|
total: new Decimal(0),
|
||||||
|
order: 0, // Used for tracking other relevant layers unlocked before this one
|
||||||
upgrades: [],
|
upgrades: [],
|
||||||
milestones: [],
|
milestones: [],
|
||||||
challs: [],
|
challs: [],
|
||||||
|
@ -103,7 +105,7 @@ var layers = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
convertToDecimal() {
|
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
|
layerShown() {return true}, // Condition for when layer appears
|
||||||
update(diff) {
|
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
|
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
|
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 {
|
startData() { return {
|
||||||
unl: false,
|
unl: false,
|
||||||
points: new Decimal(0),
|
points: new Decimal(0),
|
||||||
best: new Decimal(0),
|
|
||||||
boop: false,
|
boop: false,
|
||||||
}},
|
}},
|
||||||
color: "#FE0102",
|
color: "#FE0102",
|
||||||
|
@ -141,7 +142,6 @@ var layers = {
|
||||||
},
|
},
|
||||||
row: 1,
|
row: 1,
|
||||||
layerShown() {return true}, // Condition for when layer appears
|
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
|
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
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue