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
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:
@@ -14,17 +14,15 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<CollapsiblePanel title="Ponte (clic)" badge="{formatNumber(expected)}" accentClass="gp-accent-amber" defaultOpen={false}>
|
<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="gp-row gp-row--active">
|
||||||
<div class="flex flex-col flex-1">
|
<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">
|
<span class="gp-label">
|
||||||
{formatNumber(b.total)} base
|
x{b.prestigeMult.toFixed(1)} prestige · x{b.treeMult.toFixed(0)} arbre · x{b.prodBonus.toFixed(1)} prod
|
||||||
{#if b.doubleChance > 0} + {(b.doubleChance * 100).toFixed(0)}% double{/if}
|
|
||||||
{#if b.critChance > 0} + {(b.critChance * 100).toFixed(0)}% crit x10{/if}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<!-- Click contribution estimate -->
|
<!-- Click contribution estimate -->
|
||||||
|
|||||||
@@ -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 {
|
export function getClickGain(state: GameState): number {
|
||||||
const treeClickMult = getClickMultiplierFromTree(state.evolutionTree);
|
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)
|
// Breakdown complet du clic (pour affichage cockpit)
|
||||||
@@ -622,28 +624,27 @@ export interface ClickBreakdown {
|
|||||||
base: number;
|
base: number;
|
||||||
prestigeMult: number;
|
prestigeMult: number;
|
||||||
treeMult: number;
|
treeMult: number;
|
||||||
total: number;
|
prodBonus: number; // multiplicateur depuis prod passive (1 + prod/s × 0.01)
|
||||||
doubleChance: number; // 0-1
|
total: number; // gain par clic (floor)
|
||||||
critChance: number; // 0-1
|
doubleChance: number;
|
||||||
|
critChance: number;
|
||||||
autoClicksPerSec: number;
|
autoClicksPerSec: number;
|
||||||
effectivePerSec: number; // total × (1 + double × 1 + crit × 9) + autoClicks × total
|
effectivePerSec: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getClickBreakdown(state: GameState): ClickBreakdown {
|
export function getClickBreakdown(state: GameState): ClickBreakdown {
|
||||||
const base = state.clickMultiplier;
|
const base = state.clickMultiplier;
|
||||||
const prestigeMult = state.prestigeMultiplier;
|
const prestigeMult = state.prestigeMultiplier;
|
||||||
const treeMult = getClickMultiplierFromTree(state.evolutionTree);
|
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 doubleChance = getDoubleClickChance(state.evolutionTree);
|
||||||
const critChance = getCritClickChance(state.evolutionTree);
|
const critChance = getCritClickChance(state.evolutionTree);
|
||||||
const autoClicksPerSec = getAutoClicksPerSecond(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;
|
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 {
|
export interface ClickResult {
|
||||||
|
|||||||
Reference in New Issue
Block a user