'use client'; import { ELEMENTS, GUARDIANS, SKILLS_DEF } from '@/lib/game/constants'; import { SKILL_EVOLUTION_PATHS, getTierMultiplier } from '@/lib/game/skill-evolution'; import { hasSpecial, SPECIAL_EFFECTS } from '@/lib/game/effects'; import { fmt, fmtDec, calcDamage } from '@/lib/game/store'; import type { SkillUpgradeChoice, GameStore, UnifiedEffects } from '@/lib/game/types'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Separator } from '@/components/ui/separator'; import { Droplet, Swords, BookOpen, FlaskConical, Trophy, RotateCcw, Star } from 'lucide-react'; export interface StatsTabProps { store: GameStore; upgradeEffects: UnifiedEffects; maxMana: number; baseRegen: number; clickMana: number; meditationMultiplier: number; effectiveRegen: number; incursionStrength: number; manaCascadeBonus: number; studySpeedMult: number; studyCostMult: number; } export function StatsTab({ store, upgradeEffects, maxMana, baseRegen, clickMana, meditationMultiplier, effectiveRegen, incursionStrength, manaCascadeBonus, studySpeedMult, studyCostMult, }: StatsTabProps) { // Compute element max const elemMax = (() => { const ea = store.skillTiers?.elemAttune || 1; const tieredSkillId = ea > 1 ? `elemAttune_t${ea}` : 'elemAttune'; const level = store.skills[tieredSkillId] || store.skills.elemAttune || 0; const tierMult = getTierMultiplier(tieredSkillId); return 10 + level * 50 * tierMult + (store.prestigeUpgrades.elementalAttune || 0) * 25; })(); // Get all selected skill upgrades const getAllSelectedUpgrades = () => { const upgrades: { skillId: string; upgrade: SkillUpgradeChoice }[] = []; for (const [skillId, selectedIds] of Object.entries(store.skillUpgrades)) { const baseSkillId = skillId.includes('_t') ? skillId.split('_t')[0] : skillId; const path = SKILL_EVOLUTION_PATHS[baseSkillId]; if (!path) continue; for (const tier of path.tiers) { if (tier.skillId === skillId) { for (const upgradeId of selectedIds) { const upgrade = tier.upgrades.find(u => u.id === upgradeId); if (upgrade) { upgrades.push({ skillId, upgrade }); } } } } } return upgrades; }; const selectedUpgrades = getAllSelectedUpgrades(); return (