feat: click expected value + contribution display
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 21s

CockpitHeader: /clic shows expected value (double+crit included), amber.
ClickPanel: full breakdown with expected value, contribution estimate
(~5 clics/s → X/s + auto → Y% of total), formula visible.
Passif/clic distinction clear in the cockpit.
This commit is contained in:
2026-03-28 21:01:17 +01:00
parent 25768e3665
commit f4bc25b3b1
2 changed files with 48 additions and 15 deletions

View File

@@ -1,17 +1,22 @@
<script lang="ts">
import { game } from '$lib/stores/game.svelte';
import { getClickBreakdown } from '$lib/core/economy';
import { formatNumber } from '$lib/utils/formatNumber';
let cb = $derived(getClickBreakdown(game.state));
// Expected value per click = total × (1 + doubleChance + critChance × 9)
let expectedPerClick = $derived(cb.total * (1 + cb.doubleChance + cb.critChance * 9));
</script>
<div class="gp">
<div class="grid grid-cols-5 gap-0.5 px-1">
<div class="gp-stat" title="Production automatique par seconde">
<span class="gp-label">Prod/s</span>
<span class="gp-value gp-accent-green text-[0.8rem]!">{formatNumber(game.productionPerSecond)}</span>
<div class="gp-stat" title="Production passive par seconde (generateurs)">
<span class="gp-label">Passif</span>
<span class="gp-value gp-accent-green text-[0.8rem]!">{formatNumber(game.productionPerSecond)}/s</span>
</div>
<div class="gp-stat" title="Tetards gagnes par clic">
<div class="gp-stat" title="Valeur attendue par clic (double + crit inclus)">
<span class="gp-label">/clic</span>
<span class="gp-value text-[0.8rem]!">{formatNumber(game.clickGain)}</span>
<span class="gp-value gp-accent-amber text-[0.8rem]!">{formatNumber(expectedPerClick)}</span>
</div>
<div class="gp-stat" title="Multiplicateur global (prestige)">
<span class="gp-label">Mult</span>