Files
ClickerZ/Frontend/src/lib/components/CockpitHeader.svelte
Tetardtek 7c651ded4e
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 21s
fix: game.game. double reference in PrestigeScreen + /clic label
PrestigeScreen had game.game.state (double ref) causing undefined error
on prestige. Fixed 5 occurrences. CockpitHeader label /clic → Clic.
2026-03-28 21:04:17 +01:00

35 lines
1.5 KiB
Svelte
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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 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="Valeur attendue par clic (double + crit inclus)">
<span class="gp-label">Clic</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>
<span class="gp-value text-[0.8rem]!">x{game.state.prestigeMultiplier.toFixed(1)}</span>
</div>
<div class="gp-stat" title="ADN Ancestral">
<span class="gp-label">ADN</span>
<span class="gp-value gp-accent-purple text-[0.8rem]!">{game.state.ancestralDna}</span>
</div>
<div class="gp-stat" title="Nombre de prestiges">
<span class="gp-label">Gen.</span>
<span class="gp-value text-[0.8rem]!">{game.state.prestigeCount}</span>
</div>
</div>
</div>