mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-22 00:21:32 +00:00
Fixed several issues
This commit is contained in:
parent
eca8970c38
commit
28282790d5
3 changed files with 14 additions and 13 deletions
14
js/layers.js
14
js/layers.js
|
@ -46,7 +46,7 @@ addLayer("c", {
|
|||
done() {return player[this.layer].best.gte(4)},
|
||||
effectDesc:() => "You can toggle beep and boop (which do nothing)",
|
||||
toggles: [
|
||||
[this.layer, "beep"], // Each toggle is defined by a layer and the data toggled for that layer
|
||||
["c", "beep"], // Each toggle is defined by a layer and the data toggled for that layer
|
||||
["f", "boop"]],
|
||||
}
|
||||
},
|
||||
|
@ -129,18 +129,18 @@ addLayer("c", {
|
|||
return eff;
|
||||
},
|
||||
display() { // Everything else displayed in the buyable button after the title
|
||||
let data = tmp.buyables[this.layer]["11"]
|
||||
let data = tmp.buyables[this.layer][this.id]
|
||||
return "Cost: " + format(data.cost) + " lollipops\n\
|
||||
Amount: " + player[this.layer].buyables["11"] + "\n\
|
||||
Amount: " + player[this.layer].buyables[this.id] + "\n\
|
||||
Adds + " + format(data.effect.first) + " things and multiplies stuff by " + format(data.effect.second)
|
||||
},
|
||||
unl() { return player[this.layer].unl },
|
||||
canAfford() {
|
||||
return player[this.layer].points.gte(tmp.buyables["c"][11].cost)},
|
||||
return player[this.layer].points.gte(tmp.buyables[this.layer][this.id].cost)},
|
||||
buy() {
|
||||
cost = tmp.buyables[this.layer][11].cost
|
||||
cost = tmp.buyables[this.layer][this.id].cost
|
||||
player[this.layer].points = player[this.layer].points.sub(cost)
|
||||
player[this.layer].buyables[11] = player[this.layer].buyables[11].add(1)
|
||||
player[this.layer].buyables[this.id] = player[this.layer].buyables[this.id].add(1)
|
||||
player[this.layer].spentOnBuyables = player[this.layer].spentOnBuyables.add(cost) // This is a built-in system that you can use for respeccing but it only works with a single Decimal value
|
||||
},
|
||||
buyMax() {}, // You'll have to handle this yourself if you want
|
||||
|
@ -179,7 +179,7 @@ addLayer("c", {
|
|||
function() {return 'I have ' + format(player.points) + ' pointy points!'},
|
||||
{"color": "red", "font-size": "32px", "font-family": "Comic Sans MS"}],
|
||||
["buyables", "150px"],
|
||||
["toggle", [this.layer, "beep"]],
|
||||
["toggle", ["c", "beep"]],
|
||||
"milestones", "upgrades", "challs"],
|
||||
style() {return {
|
||||
'background-color': 'blue'
|
||||
|
|
|
@ -93,7 +93,7 @@ function updateChallTemp(layer) {
|
|||
}
|
||||
|
||||
function updateUpgradeTemp(layer) {
|
||||
if (player[layer] === undefined) return
|
||||
if (layers[layer] === undefined) return
|
||||
if (!tmp.upgrades[layer]) tmp.upgrades[layer] = {}
|
||||
|
||||
let data2 = layers[layer].upgrades
|
||||
|
@ -114,7 +114,7 @@ function updateUpgradeTemp(layer) {
|
|||
}
|
||||
|
||||
function updateMilestoneTemp(layer) {
|
||||
if (player[layer] === undefined) return
|
||||
if (layers[layer] === undefined) return
|
||||
if (!tmp.milestones[layer]) tmp.milestones[layer] = {}
|
||||
|
||||
let data2 = layers[layer].milestones
|
||||
|
@ -127,7 +127,7 @@ function updateMilestoneTemp(layer) {
|
|||
}
|
||||
|
||||
function updateBuyableTemp(layer) {
|
||||
if (player[layer] === undefined) return
|
||||
if (layers[layer] === undefined) return
|
||||
if (!tmp.buyables[layer]) tmp.buyables[layer] = {}
|
||||
let data2 = layers[layer].buyables
|
||||
if(data2.respecText) tmp.buyables[layer].respecText = data2.respecText()
|
||||
|
|
7
js/v.js
7
js/v.js
|
@ -17,7 +17,7 @@ function loadVue() {
|
|||
treeNode: true,
|
||||
[layer]: true,
|
||||
hidden: !tmp.layerShown[layer],
|
||||
locked: player[layer].unl && !tmp.layerAmt[layer].gte(tmp.layerReqs[layer]),
|
||||
locked: !player[layer].unl && !tmp.layerAmt[layer].gte(tmp.layerReqs[layer]),
|
||||
can: layerUnl(layer),
|
||||
}"
|
||||
v-bind:style="{
|
||||
|
@ -72,7 +72,8 @@ function loadVue() {
|
|||
<div v-if="layers[layer].milestones">
|
||||
<table>
|
||||
<tr v-for="id in Object.keys(layers[layer].milestones)">
|
||||
<td v-if="milestoneShown(layer, id)" v-bind:class="{milestone: !player[layer].milestones.includes(id), milestoneDone: player[layer].milestones.includes(id)}"><h3>{{tmp.milestones[layer][id].requirementDesc}}</h3><br>{{tmp.milestones[layer][id].effectDesc}}<br><span v-if="(layers[layer].milestones[id].toggles)&&(player[layer].milestones.includes(id))" v-for="toggle in layers[layer].milestones[id].toggles"><toggle :layer= "layer" :data= "toggle"></toggle> </span></td></tr>
|
||||
<td v-if="milestoneShown(layer, id)" v-bind:class="{milestone: !player[layer].milestones.includes(id), milestoneDone: player[layer].milestones.includes(id)}"><h3>{{tmp.milestones[layer][id].requirementDesc}}</h3><br>{{tmp.milestones[layer][id].effectDesc}}<br>
|
||||
<span v-if="(layers[layer].milestones[id].toggles)&&(player[layer].milestones.includes(id))" v-for="toggle in layers[layer].milestones[id].toggles"><toggle :layer= "layer" :data= "toggle"></toggle> </span></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
@ -83,7 +84,7 @@ function loadVue() {
|
|||
Vue.component('toggle', {
|
||||
props: ['layer', 'data'],
|
||||
template: `
|
||||
<button class="smallUpg can" v-bind:style="{'background-color': tmp.layerColor[layer])}" v-on:click="toggleAuto(data)">{{player[data[0]][data[1]]?"ON":"OFF"}}</button>
|
||||
<button class="smallUpg can" v-bind:style="{'background-color': tmp.layerColor[data[0]]}" v-on:click="toggleAuto(data)">{{player[data[0]][data[1]]?"ON":"OFF"}}</button>
|
||||
`
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue