'use client'; import { ELEMENTS, GUARDIANS } from '@/lib/game/constants'; import { getTierMultiplier } from '@/lib/game/skill-evolution'; import { hasSpecial, SPECIAL_EFFECTS } from '@/lib/game/effects'; import { fmt, fmtDec } from '@/lib/game/store'; import type { 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 { FlaskConical, Trophy, RotateCcw } from 'lucide-react'; import { ManaStatsSection } from '../stats/ManaStatsSection'; import { ManaTypeBreakdown } from '../stats/ManaTypeBreakdown'; import { CombatStatsSection } from '../stats/CombatStatsSection'; import { StudyStatsSection } from '../stats/StudyStatsSection'; import { UpgradeEffectsSection } from '../stats/UpgradeEffectsSection'; export interface StatsTabProps { store: GameStore; upgradeEffects: UnifiedEffects; maxMana: number; baseRegen: number; clickMana: number; meditationMultiplier: number; effectiveRegen: number; incursionStrength: number; manaCascadeBonus: number; manaWaterfallBonus: number; hasManaWaterfall: boolean; hasFlowSurge: boolean; hasManaOverflow: boolean; hasEternalFlow: boolean; studySpeedMult: number; studyCostMult: number; } export function StatsTab({ store, upgradeEffects, maxMana, baseRegen, clickMana, meditationMultiplier, effectiveRegen, incursionStrength, manaCascadeBonus, manaWaterfallBonus, hasManaWaterfall, hasFlowSurge, hasManaOverflow, hasEternalFlow, 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; })(); return (
{/* Mana Stats */} {/* Mana Type Breakdown */} {/* Combat Stats */} {/* Study Stats */} {/* Element Stats */} Element Stats
Element Capacity: {elemMax}
Elem. Attunement Bonus: {(() => { 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 `+${level * 50 * tierMult}`; })()}
Prestige Attunement: +{(store.prestigeUpgrades.elementalAttune || 0) * 25}
Unlocked Elements: {Object.values(store.elements).filter(e => e.unlocked).length} / {Object.keys(ELEMENTS).length}
Elem. Crafting Bonus: ×{fmtDec(1 + (store.skills.elemCrafting || 0) * 0.25, 2)}
Elemental Mana Pools:
{Object.entries(store.elements) .filter(([, state]) => state.unlocked) .map(([id, state]) => { const def = ELEMENTS[id]; return (
{def?.sym}
{state.current}/{state.max}
); })}
{/* Active Upgrades */} {/* Enchantment Power (placeholder for Task 5) */} ✨ Enchantment Power
Enchantment Power: {upgradeEffects?.enchantmentPowerMultiplier?.toFixed(2) || '1.0'}×

Increases the power of all enchantments by {((upgradeEffects?.enchantmentPowerMultiplier || 1) - 1) * 100}%. Multiplier applied to all enchantment effects.

{/* Pact Bonuses */} Signed Pacts ({store.signedPacts.length}/10) {store.signedPacts.length === 0 ? (
No pacts signed yet. Defeat guardians to earn pacts.
) : (
{store.signedPacts.map((floor) => { const guardian = GUARDIANS[floor]; if (!guardian) return null; return (
{guardian.name}
Floor {floor}
{guardian.pact}x multiplier
); })}
Combined Pact Multiplier: ×{fmtDec(store.signedPacts.reduce((m, f) => m * (GUARDIANS[f]?.pact || 1), 1), 2)}
)}
{/* Loop Stats */} Loop Stats
{store.loopCount}
Loops Completed
{fmt(store.insight)}
Current Insight
{fmt(store.totalInsight)}
Total Insight
{store.maxFloorReached}
Max Floor
{Object.values(store.spells).filter(s => s.learned).length}
Spells Learned
{Object.values(store.skills).reduce((a, b) => a + b, 0)}
Total Skill Levels
{fmt(store.totalManaGathered)}
Total Mana Gathered
{store.memorySlots}
Memory Slots
); } StatsTab.displayName = "StatsTab";