1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-02-17 18:12:45 +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 amt -> amount
desc -> description desc -> description
resCeil -> roundUpCost resCeil -> roundUpCost
order -> unlockOrderS
incr_order -> increaseUnlockOrder
Challenges: Challenges:
desc -> challengeDescription desc -> challengeDescription

View file

@ -26,7 +26,7 @@ Key:
Optional: Optional:
total: A Decimal, tracks total amount of main prestige currency total: A Decimal, tracks total amount of main prestige currency
best: A Decimal, tracks highest 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 #) - 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. - requires: A Decimal, the amount of the base needed to gain 1 of the prestige currency.
Also the amount required to unlock the layer. 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. - 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. - 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. 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. - 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; player[layer].unlocked = true;
needCanvasUpdate = true; needCanvasUpdate = true;
if (layers[layer].incr_order){ if (layers[layer].increaseUnlockOrder){
lrs = layers[layer].incr_order lrs = layers[layer].increaseUnlockOrder
for (lr in lrs) 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) doReset(pre_layers[0], true)
for (let layer in layers) { for (let layer in layers) {
player[layers[layer]].unlocked = false 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) player.points = new Decimal(10)
updateTemp(); updateTemp();

View file

@ -112,6 +112,7 @@ function updateLayers(){
if(!layers[layer].componentStyles) layers[layer].componentStyles = {} 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].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 row = layers[layer].row
if(!ROW_LAYERS[row]) ROW_LAYERS[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" currencyLayer: "", // Leave empty if not in a layer "e.g. points"
unlocked() { return (hasUpgrade(this.layer, 12))}, unlocked() { return (hasUpgrade(this.layer, 12))},
onPurchase() { // This function triggers when the upgrade is purchased onPurchase() { // This function triggers when the upgrade is purchased
player[this.layer].order = 0 player[this.layer].unlockOrder = 0
}, },
style() { style() {
if (hasUpgrade(this.layer, this.id)) return { 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: "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)}}, {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: { microtabs: {
stuff: { stuff: {