'use client'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Separator } from '@/components/ui/separator'; import { FlaskConical } from 'lucide-react'; import { ELEMENTS } from '@/lib/game/constants'; import { getTierMultiplier } from '@/lib/game/skill-evolution'; import { fmt, fmtDec } from '@/lib/game/stores'; import { useSkillStore, usePrestigeStore, useManaStore } from '@/lib/game/stores'; interface ElementStatsSectionProps { elemMax: number; } export function ElementStatsSection({ elemMax }: ElementStatsSectionProps) { const skills = useSkillStore((s) => s.skills); const skillTiers = useSkillStore((s) => s.skillTiers); const prestigeUpgrades = usePrestigeStore((s) => s.prestigeUpgrades); const elements = useManaStore((s) => s.elements); const getElemAttunementBonus = () => { const ea = skillTiers?.elemAttune || 1; const tieredSkillId = ea > 1 ? `elemAttune_t${ea}` : 'elemAttune'; const level = skills[tieredSkillId] || skills.elemAttune || 0; const tierMult = getTierMultiplier(tieredSkillId); return level * 50 * tierMult; }; return ( Element Stats
Element Capacity: {elemMax}
Elem. Attunement Bonus: +{getElemAttunementBonus()}
Prestige Attunement: +{(prestigeUpgrades.elementalAttune || 0) * 25}
Unlocked Elements: {Object.values(elements || {}).filter((e: any) => e.unlocked).length} / {Object.keys(ELEMENTS).length}
Elem. Crafting Bonus: ×{fmtDec(1 + (skills.elemCrafting || 0) * 0.25, 2)}
Elemental Mana Pools:
{Object.entries(elements) .filter(([, state]: [string, any]) => state.unlocked) .map(([id, state]: [string, any]) => { const def = ELEMENTS[id]; return (
{def?.sym}
{state.current}/{state.max}
); })}
); }