From e9d4adda9ca9c4744420c4633563cf6b45d299d3 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 23 Apr 2023 23:02:13 -0500 Subject: [PATCH] Fill factory based on affordability --- src/data/projEntry.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index 9557f65..d3e46d1 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -652,6 +652,18 @@ export const main = createLayer("main", function (this: BaseLayer) { : { text: "Cannot afford", color: "var(--danger)" } } ], + progress: node => + node.state == null || toolNodes.value[node.state as Resources] != null + ? 0 + : Decimal.div(energy.value, tools[node.state as Resources].cost) + .clampMax(1) + .toNumber(), + progressDisplay: ProgressDisplay.Fill, + progressColor: node => + node.state != null && + Decimal.gte(energy.value, tools[node.state as Resources].cost) + ? "var(--accent2)" + : "var(--foreground)", canAccept(node, otherNode) { return otherNode.type === "resource"; }, @@ -808,7 +820,7 @@ export const main = createLayer("main", function (this: BaseLayer) { actionDistance: Math.PI / 4, actions: [ deselectAllAction, - getIncreaseConnectionsAction(x => x.add(2).pow_base(10000), 16), + getIncreaseConnectionsAction(x => x.add(3).pow_base(1000), 16), togglePoweredAction ], canAccept: canAcceptTool,