'use client'; import { Progress } from '@/components/ui/progress'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Zap, Flame, Sparkles } from 'lucide-react'; import type { ComboState } from '@/lib/game/types'; import { ELEMENTS } from '@/lib/game/constants'; interface ComboMeterProps { combo: ComboState; isClimbing: boolean; } export function ComboMeter({ combo, isClimbing }: ComboMeterProps) { const comboPercent = Math.min(100, combo.count); const multiplierPercent = Math.min(100, ((combo.multiplier - 1) / 2) * 100); // Max 300% = 200% bonus // Combo tier names const getComboTier = (count: number): { name: string; color: string } => { if (count >= 100) return { name: 'LEGENDARY', color: 'text-amber-400' }; if (count >= 75) return { name: 'Master', color: 'text-purple-400' }; if (count >= 50) return { name: 'Expert', color: 'text-blue-400' }; if (count >= 25) return { name: 'Adept', color: 'text-green-400' }; if (count >= 10) return { name: 'Novice', color: 'text-cyan-400' }; return { name: 'Building...', color: 'text-gray-400' }; }; const tier = getComboTier(combo.count); const hasElementChain = combo.elementChain.length === 3 && new Set(combo.elementChain).size === 3; if (!isClimbing && combo.count === 0) { return null; } return ( Combo Meter {combo.count >= 10 && ( {tier.name} )} {/* Combo Count */}
Hits {combo.count} {combo.maxCombo > combo.count && ( max: {combo.maxCombo} )}
{/* Multiplier */}
Multiplier {combo.multiplier.toFixed(2)}x
{/* Element Chain */} {combo.elementChain.length > 0 && (
Element Chain {hasElementChain && ( +25% bonus! )}
{combo.elementChain.map((elem, i) => { const elemDef = ELEMENTS[elem]; return (
{elemDef?.sym || '?'}
); })} {/* Empty slots */} {Array.from({ length: 3 - combo.elementChain.length }).map((_, i) => (
?
))}
)} {/* Decay Warning */} {isClimbing && combo.count > 0 && combo.decayTimer <= 3 && (
Combo decaying soon!
)} {/* Not climbing warning */} {!isClimbing && combo.count > 0 && (
Resume climbing to maintain combo
)} ); }