Made green glow only appear when resetting would make the next upgrade affordable

This commit is contained in:
thepaperpilot 2021-04-02 17:36:16 -05:00
parent 81e8dc5c46
commit dc2769d10c

View file

@ -275,7 +275,7 @@ class Layer {
let purchaseAvailable = Object.values(this.upgrades).some(upg => !upg.bought && upg.canBuy()) ||
(this.parent_layer != undefined && this.child_left != undefined && this.child_left.points.gte(this.child_left.final_goal) && !this.left_branch) ||
(this.parent_layer != undefined && this.child_right != undefined && this.child_right.points.gte(this.child_right.final_goal) && !this.right_branch);
let ascensionAvailable = this.calculateProduction(0).eq(0) && this.prestigeGain().gt(0);
let ascensionAvailable = Object.values(this.upgrades).some(upg => !upg.bought && !upg.canBuy() && this.points.add(this.prestigeGain()).gte(upg.cost));
this.nodeEl.className = `tree-node${ascensionAvailable ? ' ascensionAvailable' : ''}${purchaseAvailable ? ' purchaseAvailable' : ''}`;
}