mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2025-02-16 09:41:40 +00:00
Fill in portal generator based on affordability
This commit is contained in:
parent
852050f474
commit
d64610f7e0
1 changed files with 15 additions and 0 deletions
|
@ -590,6 +590,21 @@ export const portalGenerator = {
|
|||
}
|
||||
main.board.selectedNode.value = node;
|
||||
},
|
||||
progress: node =>
|
||||
(node.state as unknown as PortalGeneratorState).tier == null
|
||||
? 0
|
||||
: Decimal.div(
|
||||
Decimal.sqrt(main.energy.value),
|
||||
Decimal.sqrt(main.computedPortalCost.value)
|
||||
)
|
||||
.clampMax(1)
|
||||
.toNumber(),
|
||||
progressDisplay: ProgressDisplay.Fill,
|
||||
progressColor: node =>
|
||||
(node.state as unknown as PortalGeneratorState).tier != null &&
|
||||
Decimal.gte(main.energy.value, main.computedPortalCost.value)
|
||||
? "var(--accent2)"
|
||||
: "var(--foreground)",
|
||||
draggable: true
|
||||
} as NodeTypeOptions;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue