import { useGameStore } from '@/state/gameStore' import { useMetaStore } from '@/state/metaStore' interface Level { id: string name: string nameRu: string waves: number difficulty: 'Новобранец' | 'Рыцарь' | 'Архимаг' | 'Босс' unlockedBy: string | null x: string y: string biomeColor: string biomeGlow: string icon: string } const LEVELS: Level[] = [ { id: 'kings_road', name: "King's Road", nameRu: 'Королевский Тракт', waves: 20, difficulty: 'Новобранец', unlockedBy: null, x: '18%', y: '62%', biomeColor: 'border-emerald-500/60', biomeGlow: 'rgba(74,222,128,0.2)', icon: '⚔', }, { id: 'whispering_woods', name: 'Whispering Woods', nameRu: 'Шепчущий Лес', waves: 20, difficulty: 'Рыцарь', unlockedBy: 'kings_road', x: '46%', y: '36%', biomeColor: 'border-gold/60', biomeGlow: 'rgba(201,161,74,0.2)', icon: '🌲', }, { id: 'frostfall_pass', name: 'Frostfall Pass', nameRu: 'Морозный Перевал', waves: 20, difficulty: 'Архимаг', unlockedBy: 'whispering_woods', x: '70%', y: '22%', biomeColor: 'border-frost/60', biomeGlow: 'rgba(110,203,213,0.2)', icon: '❄', }, { id: 'obsidian_keep', name: 'Obsidian Keep', nameRu: 'Обсидиановая Цитадель', waves: 10, difficulty: 'Босс', unlockedBy: 'frostfall_pass', x: '84%', y: '56%', biomeColor: 'border-arcane/60', biomeGlow: 'rgba(155,77,232,0.22)', icon: '💀', }, ] const difficultyStyle: Record = { 'Новобранец': 'text-emerald-400', 'Рыцарь': 'text-gold', 'Архимаг': 'text-rose-400', 'Босс': 'text-arcane', } export function CampaignMap() { const setScreen = useGameStore((s) => s.setScreen) const resetGame = useGameStore((s) => s.resetGame) const setCurrentLevelId = useGameStore((s) => s.setCurrentLevelId) const completedLevels = useMetaStore((s) => s.completedLevels) const isUnlocked = (level: Level) => level.unlockedBy === null || completedLevels.includes(level.unlockedBy) const handlePlay = (levelId: string) => { setCurrentLevelId(levelId) resetGame() setScreen('game') } return (
{/* Header */}

Карта Кампании

{completedLevels.length} / {LEVELS.length} уровней завершено

{/* Map area */}
{/* Background atmosphere */}
{/* SVG connection lines */} {/* Level nodes */} {LEVELS.map((level) => { const completed = completedLevels.includes(level.id) const unlocked = isUnlocked(level) return (
{/* Node button */} {/* Label card */}

{level.name}

{level.nameRu}

{level.difficulty} · {level.waves} волн
{completed && (

✦ Пройдено

)}
) })} {/* Bottom lore */}

«Тьма не знает покоя — каждый рубеж должен устоять»

) }