1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-12 04:51:06 +00:00

Added onPrestige, now displays layer currency effects, other fixes.

This commit is contained in:
Acamaeda 2020-09-24 18:42:52 -04:00
parent 84a8f85c33
commit 4ac7199547
5 changed files with 17 additions and 11 deletions

View file

@ -284,9 +284,14 @@ function doReset(layer, force=false) {
let gain = tmp.resetGain[layer]
if (layers[layer].type=="static") {
if (tmp.layerAmt[layer].lt(tmp.nextAt[layer])) return;
addPoints(layer, canBuyMax(layer) ? gain : 1)
} else addPoints(layer, gain)
gain =(canBuyMax(layer) ? gain : 1)
}
if (layers[layer].onPrestige)
layers[layer].onPrestige(gain)
addPoints(layer, gain)
if (!player[layer].unl) {
player[layer].unl = true;
needCanvasUpdate = true;

View file

@ -33,7 +33,7 @@ var layers = {
icecreamCap: (player.c.points * 10)
}},
effectDescription() {
eff = layer.c.effect();
eff = layers.c.effect();
return "which are boosting waffles by "+format(eff.waffleBoost)+" and increasing the Ice Cream cap by "+format(eff.icecreamCap)
},
milestones: {
@ -107,8 +107,8 @@ var layers = {
}},
color: "#FE0102",
requires() {return new Decimal(200)},
resource: "things",
baseResource: "points",
resource: "farm points",
baseResource: "candies",
baseAmount() {return player.points},
type: "normal",
exponent: 0.5,
@ -120,7 +120,6 @@ var layers = {
return new Decimal(1)
},
row: 1,
effect() {return},
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

@ -10,7 +10,7 @@ function updateTemp() {
if (!tmp.layerEffs) tmp.layerEffs = {}
for (layer in layers) tmp.layerEffs[layer] = layers[layer].effect()
for (layer in layers) if (layers[layer].effect) tmp.layerEffs[layer] = layers[layer].effect()
if (!tmp.layerReqs) tmp.layerReqs = {}
for (layer in layers) tmp.layerReqs[layer] = layers[layer].requires()