mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-22 00:21:34 +00:00
Fix energy efficiency
This commit is contained in:
parent
ab6e04de4b
commit
fa556849c1
1 changed files with 6 additions and 6 deletions
|
@ -129,16 +129,16 @@ const factory = createLayer(id, () => {
|
|||
.map(c => FACTORY_COMPONENTS[c.type]?.energyCost ?? 0)
|
||||
.reduce((a, b) => a + b, 0)
|
||||
);
|
||||
const energyEfficiency = computed(() =>
|
||||
Decimal.div(energyConsumption.value, computedEnergy.value).recip().pow(2).min(1)
|
||||
);
|
||||
const tickRate = createSequentialModifier(() => [
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: elvesEffect,
|
||||
description: "Trained Elves"
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: Decimal.div(energyConsumption.value, computedEnergy.value)
|
||||
.recip()
|
||||
.pow(2)
|
||||
.min(1),
|
||||
multiplier: energyEfficiency,
|
||||
description: "Energy Consumption",
|
||||
enabled: () => Decimal.gt(energyConsumption.value, computedEnergy.value)
|
||||
}))
|
||||
|
@ -166,8 +166,8 @@ const factory = createLayer(id, () => {
|
|||
<div>
|
||||
{formatWhole(energyConsumption.value)} / {formatWhole(computedEnergy.value)}{" "}
|
||||
energy used
|
||||
{Decimal.lt(tickRate.value, 1) ? (
|
||||
<>{" (" + format(Decimal.mul(tickRate.value, 100))}% efficiency)</>
|
||||
{Decimal.gt(energyConsumption.value, computedEnergy.value) ? (
|
||||
<>{" (" + format(Decimal.mul(energyEfficiency.value, 100))}% efficiency)</>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue