1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 17:31:50 +00:00

Renamed Order

This commit is contained in:
Acamaeda 2020-10-14 23:31:05 -04:00
parent af78b0d99b
commit 30673fd80d
5 changed files with 12 additions and 9 deletions

View file

@ -16,6 +16,8 @@ All instances of:
amt -> amount
desc -> description
resCeil -> roundUpCost
order -> unlockOrderS
incr_order -> increaseUnlockOrder
Challenges:
desc -> challengeDescription

View file

@ -26,7 +26,7 @@ Key:
Optional:
total: A Decimal, tracks total amount of main prestige currency
best: A Decimal, tracks highest amount of main prestige currency
order: used to keep track of relevant layers unlocked before this one.
unlockOrder: used to keep track of relevant layers unlocked before this one.
- color: A color associated with this layer, used in many places. (A string in hex format with a #)
@ -110,7 +110,7 @@ Key:
- requires: A Decimal, the amount of the base needed to gain 1 of the prestige currency.
Also the amount required to unlock the layer.
You can instead make this a function, to make it harder if another layer was unlocked first (based on "order").
You can instead make this a function, to make it harder if another layer was unlocked first (based on unlockOrder).
- exponent: Used as described above.
@ -174,7 +174,7 @@ Key:
- resetsNothing: **optional**, returns true if this layer shouldn't trigger any resets when you prestige.
- incr_order: **optional**, an array of layer ids. When this layer is unlocked for the first time, the "order" value
- increaseUnlockOrder: **optional**, an array of layer ids. When this layer is unlocked for the first time, the unlockOrder value
for any not-yet-unlocked layers in this list increases. This can be used to make them harder to unlock.
- should_notify: **optional**, a function to return true if this layer should be highlighted in the tree.

View file

@ -193,10 +193,10 @@ function doReset(layer, force=false) {
player[layer].unlocked = true;
needCanvasUpdate = true;
if (layers[layer].incr_order){
lrs = layers[layer].incr_order
if (layers[layer].increaseUnlockOrder){
lrs = layers[layer].increaseUnlockOrder
for (lr in lrs)
if (!player[lrs[lr]].unlocked) player[lrs[lr]].order++
if (!player[lrs[lr]].unlocked) player[lrs[lr]].unlockOrder++
}
}
@ -230,7 +230,7 @@ function resetRow(row) {
doReset(pre_layers[0], true)
for (let layer in layers) {
player[layers[layer]].unlocked = false
if (player[layers[layer]].order) player[layers[layer]].order = 0
if (player[layers[layer]].unlockOrder) player[layers[layer]].unlockOrder = 0
}
player.points = new Decimal(10)
updateTemp();

View file

@ -112,6 +112,7 @@ function updateLayers(){
if(!layers[layer].componentStyles) layers[layer].componentStyles = {}
if(layers[layer].symbol === undefined) layers[layer].symbol = layer.charAt(0).toUpperCase() + layer.slice(1)
if(layers[layer].unlockOrder === undefined) layers[layer].unlockOrder = 0
row = layers[layer].row
if(!ROW_LAYERS[row]) ROW_LAYERS[row] = {}

View file

@ -110,7 +110,7 @@ addLayer("c", {
currencyLayer: "", // Leave empty if not in a layer "e.g. points"
unlocked() { return (hasUpgrade(this.layer, 12))},
onPurchase() { // This function triggers when the upgrade is purchased
player[this.layer].order = 0
player[this.layer].unlockOrder = 0
},
style() {
if (hasUpgrade(this.layer, this.id)) return {
@ -189,7 +189,7 @@ addLayer("c", {
{key: "c", description: "C: reset for lollipops or whatever", onPress(){if (player[this.layer].unlocked) doReset(this.layer)}},
{key: "ctrl+c" + this.layer, description: "Ctrl+c: respec things", onPress(){if (player[this.layer].unlocked) respecBuyables(this.layer)}},
],
incr_order: [], // Array of layer names to have their order increased when this one is first unlocked
increaseUnlockOrder: [], // Array of layer names to have their order increased when this one is first unlocked
microtabs: {
stuff: {