feat: click gain scales with passive production (+1% of prod/s)
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 21s

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.
This commit is contained in:
2026-03-28 21:11:19 +01:00
parent 9caa6691fe
commit 45b89ebae1
2 changed files with 17 additions and 18 deletions

View File

@@ -14,17 +14,15 @@
</script>
<CollapsiblePanel title="Ponte (clic)" badge="{formatNumber(expected)}" accentClass="gp-accent-amber" defaultOpen={false}>
<!-- Expected value -->
<!-- Gain par clic -->
<div class="gp-row gp-row--active">
<div class="flex flex-col flex-1">
<span class="gp-value">Valeur attendue par clic</span>
<span class="gp-value">Gain par clic</span>
<span class="gp-label">
{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
</span>
</div>
<span class="gp-value gp-accent-amber text-lg!">{formatNumber(expected)}</span>
<span class="gp-value gp-accent-amber text-lg!">{formatNumber(b.total)}</span>
</div>
<!-- Click contribution estimate -->

View File

@@ -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 {