import type { CardData } from './card.types'; /** * Central card library. All card definitions live here, keyed by id. * Content is data — add cards by adding entries, not code paths. */ export const CARD_LIBRARY: Record = { strike: { id: 'strike', name: 'Strike', type: 'attack', rarity: 'starter', cost: 1, target: 'enemy', description: 'Deal 6 damage.', effect: { damage: 6 }, }, defend: { id: 'defend', name: 'Defend', type: 'skill', rarity: 'starter', cost: 1, target: 'self', description: 'Gain 5 block.', effect: { block: 5 }, }, bash: { id: 'bash', name: 'Bash', type: 'attack', rarity: 'starter', cost: 2, target: 'enemy', description: 'Deal 10 damage.', effect: { damage: 10 }, }, quick_slash: { id: 'quick_slash', name: 'Quick Slash', type: 'attack', rarity: 'common', cost: 1, target: 'enemy', description: 'Deal 4 damage. Draw 1 card.', effect: { damage: 4, draw: 1 }, }, cleave: { id: 'cleave', name: 'Cleave', type: 'attack', rarity: 'common', cost: 1, target: 'all-enemies', description: 'Deal 8 damage to ALL enemies.', effect: { damage: 8 }, }, flurry: { id: 'flurry', name: 'Flurry', type: 'attack', rarity: 'uncommon', cost: 1, target: 'enemy', description: 'Deal 3 damage 3 times.', effect: { damage: 3, hits: 3 }, }, adrenaline: { id: 'adrenaline', name: 'Adrenaline', type: 'skill', rarity: 'uncommon', cost: 0, target: 'none', description: 'Gain 1 energy. Draw 2 cards. Exhaust.', effect: { energy: 1, draw: 2 }, exhaust: true, }, }; /** Look up a card definition by id; throws early on typos rather than failing silently. */ export function getCard(id: string): CardData { const card = CARD_LIBRARY[id]; if (!card) throw new Error(`Unknown card id: ${id}`); return card; } /** The deck every run begins with (Slay the Spire-style: 5 Strike, 4 Defend, 1 Bash). */ export const STARTER_DECK: readonly string[] = [ 'strike', 'strike', 'strike', 'strike', 'strike', 'defend', 'defend', 'defend', 'defend', 'bash', ];