feat: Sprint 3 — Prestige Loop endless
Some checks failed
CI/CD — Build & Deploy / Build & Deploy (push) Failing after 35s
Some checks failed
CI/CD — Build & Deploy / Build & Deploy (push) Failing after 35s
- Migration saves: saveVersion pattern + migrateSave lazy (v1→v2) - Formule ADN rebalancée: log10 + clamp min 1 + cap bonus ×4 - Prestige Experience: modal fullscreen, preview ADN, stats run, best run - Arbre V2: 25 nœuds, 3 capstones, post-capstones repeatables (scaling par tranche) - Convergence évolutif Alpha→Omega (tier system) - Reset arbre: 1 gratuit/prestige, payant linéaire au-delà - Milestones prestige: 8 paliers (1→100), cosmétiques exclusifs, bonus gameplay - balance.ts: constantes centralisées pour playtest - 136 tests green, 0 regression
This commit is contained in:
89
Frontend/src/components/MilestonesPanel.tsx
Normal file
89
Frontend/src/components/MilestonesPanel.tsx
Normal file
@@ -0,0 +1,89 @@
|
||||
// MilestonesPanel.tsx — Paliers de prestige (Sprint 3)
|
||||
// Progress bar vers le prochain milestone, claim button, preview reward
|
||||
|
||||
import { useGameStore } from "../store/useGameStore";
|
||||
import { getClaimableMilestones, getNextMilestone } from "../core/economy";
|
||||
import { PRESTIGE_MILESTONES } from "../data/prestigeMilestones";
|
||||
|
||||
export function MilestonesPanel() {
|
||||
const state = useGameStore((s) => s.state);
|
||||
const claim = useGameStore((s) => s.claimMilestone);
|
||||
|
||||
if (state.prestigeCount < 1) return null;
|
||||
|
||||
const claimable = getClaimableMilestones(state);
|
||||
const nextMilestone = getNextMilestone(state);
|
||||
const totalClaimed = state.claimedMilestones.length;
|
||||
|
||||
return (
|
||||
<div className="gp">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="gp-title">Milestones</span>
|
||||
<span className="gp-label">{totalClaimed}/{PRESTIGE_MILESTONES.length}</span>
|
||||
</div>
|
||||
|
||||
{/* Claimable milestones */}
|
||||
{claimable.length > 0 && (
|
||||
<div className="flex flex-col gap-1.5">
|
||||
{claimable.map((m) => (
|
||||
<div key={m.id} className="gp-row gp-row--evolution border-purple-400/30!">
|
||||
<div className="flex flex-col min-w-0">
|
||||
<span className="gp-value text-[0.7rem]!">{m.name}</span>
|
||||
<span className="gp-label">{m.reward.label}</span>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => claim(m.id)}
|
||||
className="gp-btn gp-btn--buy"
|
||||
>
|
||||
Claim
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Progress vers le prochain milestone */}
|
||||
{nextMilestone && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="flex justify-between">
|
||||
<span className="gp-label">Prochain : {nextMilestone.name}</span>
|
||||
<span className="gp-label">
|
||||
{state.prestigeCount}/{nextMilestone.threshold}
|
||||
</span>
|
||||
</div>
|
||||
<div className="gp-progress">
|
||||
<div
|
||||
className="gp-progress-fill bg-gradient-to-r from-purple-600 to-purple-400"
|
||||
style={{
|
||||
width: `${Math.min((state.prestigeCount / nextMilestone.threshold) * 100, 100).toFixed(1)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="gp-label">{nextMilestone.reward.label}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Tous les milestones réclamés */}
|
||||
{!nextMilestone && claimable.length === 0 && (
|
||||
<span className="gp-label text-center gp-accent-purple">
|
||||
Tous les milestones reclames !
|
||||
</span>
|
||||
)}
|
||||
|
||||
{/* Liste compacte des milestones passés */}
|
||||
{totalClaimed > 0 && claimable.length === 0 && (
|
||||
<div className="flex flex-wrap gap-1 mt-1">
|
||||
{PRESTIGE_MILESTONES.filter((m) => state.claimedMilestones.includes(m.id)).map((m) => (
|
||||
<span
|
||||
key={m.id}
|
||||
className="gp-label text-[0.55rem]! px-1.5 py-0.5 rounded bg-purple-500/10 border border-purple-500/20"
|
||||
title={`${m.name} — ${m.description}`}
|
||||
>
|
||||
{m.threshold}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user