'use client'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; import { ChevronUp, ChevronDown, Mountain, Shield, Skull, Heart, Wind, ShieldCheck } from 'lucide-react'; import { ELEMENTS } from '@/lib/game/constants'; import type { FloorControlsProps } from '@/lib/game/types'; const ROOM_TYPE_CONFIG: Record = { combat: { label: 'Combat', icon: '⚔️', color: '#EF4444' }, swarm: { label: 'Swarm', icon: '🐝', color: '#F59E0B' }, speed: { label: 'Speed', icon: '💨', color: '#3B82F6' }, guardian: { label: 'Guardian', icon: '🛡️', color: '#EF4444' }, puzzle: { label: 'Puzzle', icon: '🧩', color: '#8B5CF6' }, }; export function FloorControls({ store, climbDirection, isGuardianFloor, currentRoom, currentGuardian, isFloorCleared, floorElemDef, roomType, roomConfig, activeEquipmentSpells, upgradeEffects, floorElem, totalDPS, getEnemyName, calcDamage, SPELLS_DEF, canCastSpell, storeCurrentAction, handleClimb, formatSpellCost, getSpellCostColor, }: FloorControlsProps) { return ( Floor Navigation
{storeCurrentAction === 'climb' && (
Climbing {climbDirection === 'up' ? 'Up' : 'Down'} {isGuardianFloor && ( GUARDIAN )}
{currentGuardian && (
{currentGuardian.name}
)} {!(roomType === 'swarm' || roomType === 'puzzle') && (
{fmt(store.floorHP)} / {fmt(store.floorMaxHP)} HP DPS: {activeEquipmentSpells.length > 0 ? fmtDec(totalDPS) : '—'}
)} {activeEquipmentSpells.length > 0 ? (
{activeEquipmentSpells.map(({ spellId, equipmentId }) => { const spellDef = SPELLS_DEF[spellId]; if (!spellDef) return null; const spellState = store.equipmentSpellStates?.find( s => s.spellId === spellId && s.sourceEquipment === equipmentId ); const progress = spellState?.castProgress || 0; const canCast = canCastSpell(spellId); return (
{spellDef.name} {canCast ? '✓' : '✗'}
⚔️ {fmt(calcDamage(store, spellId))} dmg • {' '} {formatSpellCost(spellDef.cost)}
Cast {(progress * 100).toFixed(0)}%
); })}
) : (
No active spells. Equip staves with spell effects.
)}
)} {storeCurrentAction !== 'climb' && (
Click Climb Up/Down to begin climbing
)} ); } function fmt(value: number): string { if (value >= 1e12) return (value / 1e12).toFixed(2) + 't'; if (value >= 1e9) return (value / 1e9).toFixed(2) + 'b'; if (value >= 1e6) return (value / 1e6).toFixed(2) + 'm'; if (value >= 1e3) return (value / 1e3).toFixed(2) + 'k'; return value.toFixed(0); } function fmtDec(value: number): string { if (value >= 1e12) return (value / 1e12).toFixed(2) + 't'; if (value >= 1e9) return (value / 1e9).toFixed(2) + 'b'; if (value >= 1e6) return (value / 1e6).toFixed(2) + 'm'; if (value >= 1e3) return (value / 1e3).toFixed(2) + 'k'; return value.toFixed(0); }