From 9d27cb6648441d7e0d9acaf04aba20b76af562fc Mon Sep 17 00:00:00 2001 From: Tetardtek Date: Sat, 28 Mar 2026 20:47:24 +0100 Subject: [PATCH] feat: show effective production per generator with all bonuses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New generatorEffectiveProduction() — applies prestige mult, tree mult, nid boost, synergy, and convergence to per-generator production. GeneratorShop now shows: - Effective prod/s (green, with all bonuses) - % share of total production - Mini progress bar per generator - When owned=0: shows effective prod per unit (so you see upgrade impact) --- .../src/lib/components/GeneratorShop.svelte | 26 +++++++++++++------ Frontend/src/lib/core/economy.ts | 23 ++++++++-------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Frontend/src/lib/components/GeneratorShop.svelte b/Frontend/src/lib/components/GeneratorShop.svelte index 9e39006..3521246 100644 --- a/Frontend/src/lib/components/GeneratorShop.svelte +++ b/Frontend/src/lib/components/GeneratorShop.svelte @@ -2,6 +2,7 @@ import { scale } from 'svelte/transition'; import { quintOut } from 'svelte/easing'; import { game } from '$lib/stores/game.svelte'; + import { generatorEffectiveProduction } from '$lib/core/economy'; import { formatNumber } from '$lib/utils/formatNumber'; import CollapsiblePanel from './CollapsiblePanel.svelte'; @@ -14,12 +15,14 @@ {#each game.state.generators as gen, i} {@const cost = game.generatorCostWithTree(gen)} {@const canAfford = game.state.resources >= cost} - {@const currentProd = gen.baseProduction * gen.owned} + {@const effectiveProd = generatorEffectiveProduction(gen, game.state)} + {@const nextUnitProd = generatorEffectiveProduction({ ...gen, owned: 1 }, game.state)} + {@const share = game.productionPerSecond > 0 ? (effectiveProd / game.productionPerSecond * 100) : 0}
-
+
{gen.name} {#if gen.owned > 0} @@ -31,12 +34,19 @@ {/if}
- - +{gen.baseProduction}/s - {#if gen.owned > 0} - · {formatNumber(currentProd)}/s - {/if} - + {#if gen.owned > 0} +
+ {formatNumber(effectiveProd)}/s + · + {share.toFixed(0)}% +
+ +
+
+
+ {:else} + +{formatNumber(nextUnitProd)}/s par unite + {/if}