mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-21 16:13:54 +00:00
Fill factory based on affordability
This commit is contained in:
parent
3c8f1be7d4
commit
e9d4adda9c
1 changed files with 13 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue