fix: particule clic affiche le vrai gain (clickMult × prestigeMult × treeMult)

Ajout getClickGain() dans economy.ts — utilisé par la particule de feedback
et le cockpit header "Ponte". Avant : affichait toujours +1.
This commit is contained in:
2026-03-20 16:18:45 +01:00
parent 4ad60c9423
commit b475fb8953
3 changed files with 17 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import { useEffect, useCallback } from "react";
import { useGameStore } from "../store/useGameStore";
import { formatNumber } from "../utils/formatNumber";
import { getClickGain } from "../core/economy";
import { GeneratorShop } from "../components/GeneratorShop";
import { PrestigePanel } from "../components/PrestigePanel";
import { EvolutionTree } from "../components/EvolutionTree";
@@ -17,19 +18,20 @@ export default function Home() {
const [toggleRain] = useOutletContext();
const click = useGameStore((s) => s.click);
const resources = useGameStore((s) => s.state.resources);
const clickMultiplier = useGameStore((s) => s.state.clickMultiplier);
const state = useGameStore((s) => s.state);
const clickGain = getClickGain(state);
const createParticle = useCallback((clientX, clientY) => {
const particle = document.createElement("span");
particle.className = "click-particle";
particle.textContent = `+${formatNumber(clickMultiplier)}`;
particle.textContent = `+${formatNumber(clickGain)}`;
particle.style.left = `${clientX}px`;
particle.style.top = `${clientY}px`;
document.body.appendChild(particle);
setTimeout(() => {
if (particle.parentNode) particle.parentNode.removeChild(particle);
}, 800);
}, [clickMultiplier]);
}, [clickGain]);
const handleIncrement = useCallback((e) => {
click();