Phase 3: Split constants.ts into domain-specific files

This commit is contained in:
Unknown
2026-04-24 12:38:47 +02:00
parent eb81ccb5aa
commit f8520e15b8
9 changed files with 1471 additions and 1435 deletions
+77
View File
@@ -0,0 +1,77 @@
// ─── Element Definitions ─────────────────────────────────────────────────────
import type { ElementDef } from '../types';
// Helper function for creating raw mana cost
export function rawCost(amount: number): { type: 'raw'; amount: number } {
return { type: 'raw', amount };
}
// Helper function for creating elemental mana cost
export function elemCost(element: string, amount: number): { type: 'element'; element: string; amount: number } {
return { type: 'element', element, amount };
}
// Mana constants
export const MANA_PER_ELEMENT = 100;
export const ELEMENTS: Record<string, ElementDef> = {
// Base Elements
fire: { name: "Fire", sym: "🔥", color: "#FF6B35", glow: "#FF6B3540", cat: "base" },
water: { name: "Water", sym: "💧", color: "#4ECDC4", glow: "#4ECDC440", cat: "base" },
air: { name: "Air", sym: "🌬️", color: "#00D4FF", glow: "#00D4FF40", cat: "base" },
earth: { name: "Earth", sym: "⛰️", color: "#F4A261", glow: "#F4A26140", cat: "base" },
light: { name: "Light", sym: "☀️", color: "#FFD700", glow: "#FFD70040", cat: "base" },
dark: { name: "Dark", sym: "🌑", color: "#9B59B6", glow: "#9B59B640", cat: "base" },
death: { name: "Death", sym: "💀", color: "#778CA3", glow: "#778CA340", cat: "base" },
// Utility Elements
transference: { name: "Transference", sym: "🔗", color: "#1ABC9C", glow: "#1ABC9C40", cat: "utility" },
// Composite Elements
metal: { name: "Metal", sym: "⚙️", color: "#BDC3C7", glow: "#BDC3C740", cat: "composite", recipe: ["fire", "earth"] },
sand: { name: "Sand", sym: "⏳", color: "#D4AC0D", glow: "#D4AC0D40", cat: "composite", recipe: ["earth", "water"] },
lightning: { name: "Lightning", sym: "⚡", color: "#FFEB3B", glow: "#FFEB3B40", cat: "composite", recipe: ["fire", "air"] },
// Exotic Elements
crystal: { name: "Crystal", sym: "💎", color: "#85C1E9", glow: "#85C1E940", cat: "exotic", recipe: ["sand", "sand", "light"] },
stellar: { name: "Stellar", sym: "⭐", color: "#F0E68C", glow: "#F0E68C40", cat: "exotic", recipe: ["fire", "fire", "light"] },
void: { name: "Void", sym: "🕳️", color: "#4A235A", glow: "#4A235A40", cat: "exotic", recipe: ["dark", "dark", "death"] },
};
// NOTE: Life, Blood, Wood, Mental, and Force mana types have been removed.
// Lifesteal and healing are BANNED from player abilities - see AGENTS.md
// Crystal recipe updated to use light instead of mental.
export const FLOOR_ELEM_CYCLE = ["fire", "water", "air", "earth", "light", "dark", "death"];
// ─── Element Opposites for Damage Calculation ────────────────────────────────
export const ELEMENT_OPPOSITES: Record<string, string> = {
fire: 'water', water: 'fire',
air: 'earth', earth: 'air',
light: 'dark', dark: 'light',
lightning: 'earth', // Lightning is weak to earth (grounding)
};
// ─── Element Icon Mapping (Lucide Icons) ──────────────────────────────────────
// Note: These are string identifiers for dynamic icon loading
// The actual Lucide icons are imported in the components
export const ELEMENT_ICON_NAMES: Record<string, string> = {
fire: 'Flame',
water: 'Droplet',
air: 'Wind',
earth: 'Mountain',
light: 'Sun',
dark: 'Moon',
death: 'Skull',
transference: 'Link',
metal: 'Target',
sand: 'Hourglass',
lightning: 'Zap',
crystal: 'Gem',
stellar: 'Star',
void: 'CircleDot',
raw: 'Circle',
};
// ─── Base Unlocked Elements ───────────────────────────────────────────────────
export const BASE_UNLOCKED_ELEMENTS = ['fire', 'water', 'air', 'earth'];