From 45b89ebae152bc139264900fac2df08669175fed Mon Sep 17 00:00:00 2001 From: Tetardtek Date: Sat, 28 Mar 2026 21:11:19 +0100 Subject: [PATCH] feat: click gain scales with passive production (+1% of prod/s) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clickGain = base × prestige × tree × (1 + prod/s × 0.01) At 3.1k/s passive: 10 × 32 = 320 per click instead of 10. Clicking stays relevant as production grows — always ~1% of prod/s worth per click. ClickPanel shows the prod multiplier in breakdown. --- Frontend/src/lib/components/ClickPanel.svelte | 10 +++----- Frontend/src/lib/core/economy.ts | 25 ++++++++++--------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Frontend/src/lib/components/ClickPanel.svelte b/Frontend/src/lib/components/ClickPanel.svelte index 66c3c6d..7dc17a3 100644 --- a/Frontend/src/lib/components/ClickPanel.svelte +++ b/Frontend/src/lib/components/ClickPanel.svelte @@ -14,17 +14,15 @@ - +
- Valeur attendue par clic + Gain par clic - {formatNumber(b.total)} base - {#if b.doubleChance > 0} + {(b.doubleChance * 100).toFixed(0)}% double{/if} - {#if b.critChance > 0} + {(b.critChance * 100).toFixed(0)}% crit x10{/if} + x{b.prestigeMult.toFixed(1)} prestige · x{b.treeMult.toFixed(0)} arbre · x{b.prodBonus.toFixed(1)} prod
- {formatNumber(expected)} + {formatNumber(b.total)}
diff --git a/Frontend/src/lib/core/economy.ts b/Frontend/src/lib/core/economy.ts index efecc1d..fcc3122 100644 --- a/Frontend/src/lib/core/economy.ts +++ b/Frontend/src/lib/core/economy.ts @@ -611,10 +611,12 @@ export function applyIdleGains(state: GameState, now: number): GameState { }; } -// Gain de base par clic (sans RNG — pour affichage tooltip) +// Gain par clic — scale avec la production passive (1% de prod/s en bonus) export function getClickGain(state: GameState): number { const treeClickMult = getClickMultiplierFromTree(state.evolutionTree); - return state.clickMultiplier * state.prestigeMultiplier * treeClickMult; + const base = state.clickMultiplier * state.prestigeMultiplier * treeClickMult; + const prodBonus = 1 + totalProductionPerSecond(state) * 0.01; + return Math.floor(base * prodBonus); } // Breakdown complet du clic (pour affichage cockpit) @@ -622,28 +624,27 @@ export interface ClickBreakdown { base: number; prestigeMult: number; treeMult: number; - total: number; - doubleChance: number; // 0-1 - critChance: number; // 0-1 + prodBonus: number; // multiplicateur depuis prod passive (1 + prod/s × 0.01) + total: number; // gain par clic (floor) + doubleChance: number; + critChance: number; autoClicksPerSec: number; - effectivePerSec: number; // total × (1 + double × 1 + crit × 9) + autoClicks × total + effectivePerSec: number; } export function getClickBreakdown(state: GameState): ClickBreakdown { const base = state.clickMultiplier; const prestigeMult = state.prestigeMultiplier; const treeMult = getClickMultiplierFromTree(state.evolutionTree); - const total = base * prestigeMult * treeMult; + const pps = totalProductionPerSecond(state); + const prodBonus = 1 + pps * 0.01; + const total = Math.floor(base * prestigeMult * treeMult * prodBonus); const doubleChance = getDoubleClickChance(state.evolutionTree); const critChance = getCritClickChance(state.evolutionTree); const autoClicksPerSec = getAutoClicksPerSecond(state.evolutionTree); - - // Expected value per click = total × (1 + doubleChance × 1 + critChance × 9) - const expectedPerClick = total * (1 + doubleChance + critChance * 9); - // Auto-clicks produce total per auto-click (no double/crit on auto) const effectivePerSec = autoClicksPerSec * total; - return { base, prestigeMult, treeMult, total, doubleChance, critChance, autoClicksPerSec, effectivePerSec }; + return { base, prestigeMult, treeMult, prodBonus, total, doubleChance, critChance, autoClicksPerSec, effectivePerSec }; } export interface ClickResult {