diff --git a/src/lib/game/data/enchantment-effects.ts b/src/lib/game/data/enchantment-effects.ts index 79439d4..da7ea85 100755 --- a/src/lib/game/data/enchantment-effects.ts +++ b/src/lib/game/data/enchantment-effects.ts @@ -1,846 +1,21 @@ // ─── Enchantment Effects Catalogue ──────────────────────────────────────────────── -// All available enchantment effects that can be applied to equipment +// Re-exports from category-specific files for backward compatibility +// All enchantment effect definitions have been moved to src/lib/game/data/enchantments/ -import type { EquipmentCategory } from './equipment' - -// Helper to define allowed equipment categories for each effect type -const ALL_CASTER: EquipmentCategory[] = ['caster'] -const CASTER_AND_SWORD: EquipmentCategory[] = ['caster', 'sword'] -const WEAPON_EQUIPMENT: EquipmentCategory[] = ['caster', 'catalyst', 'sword'] // All main hand equipment -const CASTER_AND_HANDS: EquipmentCategory[] = ['caster', 'hands'] -const BODY_AND_SHIELD: EquipmentCategory[] = ['body', 'shield'] -const CASTER_CATALYST_ACCESSORY: EquipmentCategory[] = ['caster', 'catalyst', 'accessory'] -const MANA_EQUIPMENT: EquipmentCategory[] = ['caster', 'catalyst', 'head', 'body', 'accessory'] -const UTILITY_EQUIPMENT: EquipmentCategory[] = ['caster', 'catalyst', 'head', 'body', 'hands', 'feet', 'accessory'] -const ALL_EQUIPMENT: EquipmentCategory[] = ['caster', 'shield', 'catalyst', 'sword', 'head', 'body', 'hands', 'feet', 'accessory'] - -export type EnchantmentEffectCategory = 'spell' | 'mana' | 'combat' | 'elemental' | 'defense' | 'utility' | 'special' - -export interface EnchantmentEffectDef { - id: string; - name: string; - description: string; - category: EnchantmentEffectCategory; - baseCapacityCost: number; - maxStacks: number; - allowedEquipmentCategories: EquipmentCategory[]; - effect: { - type: 'spell' | 'bonus' | 'multiplier' | 'special'; - spellId?: string; - stat?: string; - value?: number; - specialId?: string; - }; -} - -export const ENCHANTMENT_EFFECTS: Record = { - // ═══════════════════════════════════════════════════════════════════════════ - // SPELL EFFECTS - Only for CASTER equipment (staves, wands, rods, orbs) - // ═══════════════════════════════════════════════════════════════════════════ - - // Tier 0 - Basic Spells - spell_manaBolt: { - id: 'spell_manaBolt', - name: 'Mana Bolt', - description: 'Grants the ability to cast Mana Bolt (5 base damage, raw mana cost)', - category: 'spell', - baseCapacityCost: 50, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'manaBolt' } - }, - spell_manaStrike: { - id: 'spell_manaStrike', - name: 'Mana Strike', - description: 'Grants the ability to cast Mana Strike (8 base damage, raw mana cost)', - category: 'spell', - baseCapacityCost: 40, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'manaStrike' } - }, - - // Tier 1 - Basic Elemental Spells - spell_fireball: { - id: 'spell_fireball', - name: 'Fireball', - description: 'Grants the ability to cast Fireball (15 fire damage)', - category: 'spell', - baseCapacityCost: 80, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'fireball' } - }, - spell_emberShot: { - id: 'spell_emberShot', - name: 'Ember Shot', - description: 'Grants the ability to cast Ember Shot (10 fire damage, fast cast)', - category: 'spell', - baseCapacityCost: 60, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'emberShot' } - }, - spell_waterJet: { - id: 'spell_waterJet', - name: 'Water Jet', - description: 'Grants the ability to cast Water Jet (12 water damage)', - category: 'spell', - baseCapacityCost: 70, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'waterJet' } - }, - spell_iceShard: { - id: 'spell_iceShard', - name: 'Ice Shard', - description: 'Grants the ability to cast Ice Shard (14 water damage)', - category: 'spell', - baseCapacityCost: 75, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'iceShard' } - }, - spell_gust: { - id: 'spell_gust', - name: 'Gust', - description: 'Grants the ability to cast Gust (10 air damage, fast cast)', - category: 'spell', - baseCapacityCost: 60, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'gust' } - }, - spell_stoneBullet: { - id: 'spell_stoneBullet', - name: 'Stone Bullet', - description: 'Grants the ability to cast Stone Bullet (16 earth damage)', - category: 'spell', - baseCapacityCost: 80, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'stoneBullet' } - }, - spell_lightLance: { - id: 'spell_lightLance', - name: 'Light Lance', - description: 'Grants the ability to cast Light Lance (18 light damage)', - category: 'spell', - baseCapacityCost: 95, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'lightLance' } - }, - spell_shadowBolt: { - id: 'spell_shadowBolt', - name: 'Shadow Bolt', - description: 'Grants the ability to cast Shadow Bolt (16 dark damage)', - category: 'spell', - baseCapacityCost: 95, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'shadowBolt' } - }, - spell_drain: { - id: 'spell_drain', - name: 'Drain', - description: 'Grants the ability to cast Drain (10 death damage)', - category: 'spell', - baseCapacityCost: 85, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'drain' } - }, - - // Tier 2 - Advanced Spells - spell_inferno: { - id: 'spell_inferno', - name: 'Inferno', - description: 'Grants the ability to cast Inferno (60 fire damage)', - category: 'spell', - baseCapacityCost: 180, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'inferno' } - }, - spell_tidalWave: { - id: 'spell_tidalWave', - name: 'Tidal Wave', - description: 'Grants the ability to cast Tidal Wave (55 water damage)', - category: 'spell', - baseCapacityCost: 175, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'tidalWave' } - }, - spell_hurricane: { - id: 'spell_hurricane', - name: 'Hurricane', - description: 'Grants the ability to cast Hurricane (50 air damage)', - category: 'spell', - baseCapacityCost: 170, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'hurricane' } - }, - spell_earthquake: { - id: 'spell_earthquake', - name: 'Earthquake', - description: 'Grants the ability to cast Earthquake (70 earth damage)', - category: 'spell', - baseCapacityCost: 200, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'earthquake' } - }, - spell_solarFlare: { - id: 'spell_solarFlare', - name: 'Solar Flare', - description: 'Grants the ability to cast Solar Flare (65 light damage)', - category: 'spell', - baseCapacityCost: 190, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'solarFlare' } - }, - spell_voidRift: { - id: 'spell_voidRift', - name: 'Void Rift', - description: 'Grants the ability to cast Void Rift (55 dark damage)', - category: 'spell', - baseCapacityCost: 175, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'voidRift' } - }, - - // Additional Tier 1 Spells - spell_windSlash: { - id: 'spell_windSlash', - name: 'Wind Slash', - description: 'Grants the ability to cast Wind Slash (12 air damage)', - category: 'spell', - baseCapacityCost: 72, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'windSlash' } - }, - spell_rockSpike: { - id: 'spell_rockSpike', - name: 'Rock Spike', - description: 'Grants the ability to cast Rock Spike (18 earth damage)', - category: 'spell', - baseCapacityCost: 88, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'rockSpike' } - }, - spell_radiance: { - id: 'spell_radiance', - name: 'Radiance', - description: 'Grants the ability to cast Radiance (14 light damage)', - category: 'spell', - baseCapacityCost: 80, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'radiance' } - }, - spell_darkPulse: { - id: 'spell_darkPulse', - name: 'Dark Pulse', - description: 'Grants the ability to cast Dark Pulse (12 dark damage)', - category: 'spell', - baseCapacityCost: 68, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'darkPulse' } - }, - - // Additional Tier 2 Spells - spell_flameWave: { - id: 'spell_flameWave', - name: 'Flame Wave', - description: 'Grants the ability to cast Flame Wave (45 fire damage)', - category: 'spell', - baseCapacityCost: 165, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'flameWave' } - }, - spell_iceStorm: { - id: 'spell_iceStorm', - name: 'Ice Storm', - description: 'Grants the ability to cast Ice Storm (50 water damage)', - category: 'spell', - baseCapacityCost: 170, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'iceStorm' } - }, - spell_windBlade: { - id: 'spell_windBlade', - name: 'Wind Blade', - description: 'Grants the ability to cast Wind Blade (40 air damage)', - category: 'spell', - baseCapacityCost: 155, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'windBlade' } - }, - spell_stoneBarrage: { - id: 'spell_stoneBarrage', - name: 'Stone Barrage', - description: 'Grants the ability to cast Stone Barrage (55 earth damage)', - category: 'spell', - baseCapacityCost: 175, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'stoneBarrage' } - }, - spell_divineSmite: { - id: 'spell_divineSmite', - name: 'Divine Smite', - description: 'Grants the ability to cast Divine Smite (55 light damage)', - category: 'spell', - baseCapacityCost: 175, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'divineSmite' } - }, - spell_shadowStorm: { - id: 'spell_shadowStorm', - name: 'Shadow Storm', - description: 'Grants the ability to cast Shadow Storm (48 dark damage)', - category: 'spell', - baseCapacityCost: 168, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'shadowStorm' } - }, - - // Tier 3 - Master Spells - spell_pyroclasm: { - id: 'spell_pyroclasm', - name: 'Pyroclasm', - description: 'Grants the ability to cast Pyroclasm (250 fire damage)', - category: 'spell', - baseCapacityCost: 400, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'pyroclasm' } - }, - spell_tsunami: { - id: 'spell_tsunami', - name: 'Tsunami', - description: 'Grants the ability to cast Tsunami (220 water damage)', - category: 'spell', - baseCapacityCost: 380, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'tsunami' } - }, - spell_meteorStrike: { - id: 'spell_meteorStrike', - name: 'Meteor Strike', - description: 'Grants the ability to cast Meteor Strike (280 earth damage)', - category: 'spell', - baseCapacityCost: 420, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'meteorStrike' } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // MANA EFFECTS - Boost mana capacity and regeneration - // ═══════════════════════════════════════════════════════════════════════════ - - mana_cap_50: { - id: 'mana_cap_50', - name: 'Mana Reserve', - description: '+50 maximum mana', - category: 'mana', - baseCapacityCost: 20, - maxStacks: 3, - allowedEquipmentCategories: MANA_EQUIPMENT, - effect: { type: 'bonus', stat: 'maxMana', value: 50 } - }, - mana_cap_100: { - id: 'mana_cap_100', - name: 'Mana Reservoir', - description: '+100 maximum mana', - category: 'mana', - baseCapacityCost: 35, - maxStacks: 3, - allowedEquipmentCategories: MANA_EQUIPMENT, - effect: { type: 'bonus', stat: 'maxMana', value: 100 } - }, - mana_regen_1: { - id: 'mana_regen_1', - name: 'Trickle', - description: '+1 mana per hour regeneration', - category: 'mana', - baseCapacityCost: 15, - maxStacks: 5, - allowedEquipmentCategories: MANA_EQUIPMENT, - effect: { type: 'bonus', stat: 'regen', value: 1 } - }, - mana_regen_2: { - id: 'mana_regen_2', - name: 'Stream', - description: '+2 mana per hour regeneration', - category: 'mana', - baseCapacityCost: 28, - maxStacks: 4, - allowedEquipmentCategories: MANA_EQUIPMENT, - effect: { type: 'bonus', stat: 'regen', value: 2 } - }, - mana_regen_5: { - id: 'mana_regen_5', - name: 'River', - description: '+5 mana per hour regeneration', - category: 'mana', - baseCapacityCost: 50, - maxStacks: 3, - allowedEquipmentCategories: MANA_EQUIPMENT, - effect: { type: 'bonus', stat: 'regen', value: 5 } - }, - click_mana_1: { - id: 'click_mana_1', - name: 'Mana Tap', - description: '+1 mana per click', - category: 'mana', - baseCapacityCost: 20, - maxStacks: 5, - allowedEquipmentCategories: MANA_EQUIPMENT, - effect: { type: 'bonus', stat: 'clickMana', value: 1 } - }, - click_mana_3: { - id: 'click_mana_3', - name: 'Mana Surge', - description: '+3 mana per click', - category: 'mana', - baseCapacityCost: 35, - maxStacks: 3, - allowedEquipmentCategories: MANA_EQUIPMENT, - effect: { type: 'bonus', stat: 'clickMana', value: 3 } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // COMBAT EFFECTS - Damage and attack enhancements - // ═══════════════════════════════════════════════════════════════════════════ - - damage_5: { - id: 'damage_5', - name: 'Minor Power', - description: '+5 base damage', - category: 'combat', - baseCapacityCost: 15, - maxStacks: 5, - allowedEquipmentCategories: CASTER_AND_HANDS, - effect: { type: 'bonus', stat: 'baseDamage', value: 5 } - }, - damage_10: { - id: 'damage_10', - name: 'Moderate Power', - description: '+10 base damage', - category: 'combat', - baseCapacityCost: 28, - maxStacks: 4, - allowedEquipmentCategories: CASTER_AND_HANDS, - effect: { type: 'bonus', stat: 'baseDamage', value: 10 } - }, - damage_pct_10: { - id: 'damage_pct_10', - name: 'Amplification', - description: '+10% damage', - category: 'combat', - baseCapacityCost: 30, - maxStacks: 3, - allowedEquipmentCategories: CASTER_AND_HANDS, - effect: { type: 'multiplier', stat: 'baseDamage', value: 1.10 } - }, - crit_5: { - id: 'crit_5', - name: 'Sharp Edge', - description: '+5% critical hit chance', - category: 'combat', - baseCapacityCost: 20, - maxStacks: 4, - allowedEquipmentCategories: CASTER_AND_HANDS, - effect: { type: 'bonus', stat: 'critChance', value: 0.05 } - }, - attack_speed_10: { - id: 'attack_speed_10', - name: 'Swift Casting', - description: '+10% attack speed', - category: 'combat', - baseCapacityCost: 22, - maxStacks: 4, - allowedEquipmentCategories: CASTER_AND_HANDS, - effect: { type: 'multiplier', stat: 'attackSpeed', value: 1.10 } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // UTILITY EFFECTS - Study speed, insight, meditation - // ═══════════════════════════════════════════════════════════════════════════ - - meditate_10: { - id: 'meditate_10', - name: 'Meditative Focus', - description: '+10% meditation efficiency', - category: 'utility', - baseCapacityCost: 18, - maxStacks: 5, - allowedEquipmentCategories: ['head', 'body', 'accessory'], - effect: { type: 'multiplier', stat: 'meditationEfficiency', value: 1.10 } - }, - study_10: { - id: 'study_10', - name: 'Quick Study', - description: '+10% study speed', - category: 'utility', - baseCapacityCost: 22, - maxStacks: 4, - allowedEquipmentCategories: UTILITY_EQUIPMENT, - effect: { type: 'multiplier', stat: 'studySpeed', value: 1.10 } - }, - insight_5: { - id: 'insight_5', - name: 'Insightful', - description: '+5% insight gain', - category: 'utility', - baseCapacityCost: 25, - maxStacks: 4, - allowedEquipmentCategories: ['head', 'accessory'], - effect: { type: 'multiplier', stat: 'insightGain', value: 1.05 } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // SPECIAL EFFECTS - Unique and powerful effects - // ═══════════════════════════════════════════════════════════════════════════ - - spell_echo_10: { - id: 'spell_echo_10', - name: 'Echo Chamber', - description: '10% chance to cast a spell twice', - category: 'special', - baseCapacityCost: 60, - maxStacks: 2, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'special', specialId: 'spellEcho10' } - }, - guardian_dmg_10: { - id: 'guardian_dmg_10', - name: 'Bane', - description: '+10% damage to guardians', - category: 'special', - baseCapacityCost: 35, - maxStacks: 3, - allowedEquipmentCategories: CASTER_CATALYST_ACCESSORY, - effect: { type: 'multiplier', stat: 'guardianDamage', value: 1.10 } - }, - overpower_80: { - id: 'overpower_80', - name: 'Overpower', - description: '+50% damage when mana above 80%', - category: 'special', - baseCapacityCost: 55, - maxStacks: 1, - allowedEquipmentCategories: CASTER_AND_HANDS, - effect: { type: 'special', specialId: 'overpower' } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // WEAPON MANA EFFECTS - Enchanter level 3+ unlocks these - // These add mana capacity and regeneration to weapons for their enchantments - // ═══════════════════════════════════════════════════════════════════════════ - - weapon_mana_cap_20: { - id: 'weapon_mana_cap_20', - name: 'Mana Cell', - description: '+20 weapon mana capacity (for weapon enchantments)', - category: 'mana', - baseCapacityCost: 25, - maxStacks: 5, - allowedEquipmentCategories: WEAPON_EQUIPMENT, - effect: { type: 'bonus', stat: 'weaponManaMax', value: 20 } - }, - weapon_mana_cap_50: { - id: 'weapon_mana_cap_50', - name: 'Mana Vessel', - description: '+50 weapon mana capacity (for weapon enchantments)', - category: 'mana', - baseCapacityCost: 50, - maxStacks: 3, - allowedEquipmentCategories: WEAPON_EQUIPMENT, - effect: { type: 'bonus', stat: 'weaponManaMax', value: 50 } - }, - weapon_mana_cap_100: { - id: 'weapon_mana_cap_100', - name: 'Mana Core', - description: '+100 weapon mana capacity (for weapon enchantments)', - category: 'mana', - baseCapacityCost: 80, - maxStacks: 2, - allowedEquipmentCategories: WEAPON_EQUIPMENT, - effect: { type: 'bonus', stat: 'weaponManaMax', value: 100 } - }, - weapon_mana_regen_1: { - id: 'weapon_mana_regen_1', - name: 'Mana Wick', - description: '+1 weapon mana regeneration per hour', - category: 'mana', - baseCapacityCost: 20, - maxStacks: 5, - allowedEquipmentCategories: WEAPON_EQUIPMENT, - effect: { type: 'bonus', stat: 'weaponManaRegen', value: 1 } - }, - weapon_mana_regen_2: { - id: 'weapon_mana_regen_2', - name: 'Mana Siphon', - description: '+2 weapon mana regeneration per hour', - category: 'mana', - baseCapacityCost: 35, - maxStacks: 3, - allowedEquipmentCategories: WEAPON_EQUIPMENT, - effect: { type: 'bonus', stat: 'weaponManaRegen', value: 2 } - }, - weapon_mana_regen_5: { - id: 'weapon_mana_regen_5', - name: 'Mana Well', - description: '+5 weapon mana regeneration per hour', - category: 'mana', - baseCapacityCost: 60, - maxStacks: 2, - allowedEquipmentCategories: WEAPON_EQUIPMENT, - effect: { type: 'bonus', stat: 'weaponManaRegen', value: 5 } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // LIGHTNING SPELL EFFECTS - Fast, armor-piercing, harder to dodge - // ═══════════════════════════════════════════════════════════════════════════ - - spell_spark: { - id: 'spell_spark', - name: 'Spark', - description: 'Grants the ability to cast Spark (8 lightning damage, very fast, armor pierce)', - category: 'spell', - baseCapacityCost: 70, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'spark' } - }, - spell_lightningBolt: { - id: 'spell_lightningBolt', - name: 'Lightning Bolt', - description: 'Grants the ability to cast Lightning Bolt (14 lightning damage, armor pierce)', - category: 'spell', - baseCapacityCost: 90, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'lightningBolt' } - }, - spell_chainLightning: { - id: 'spell_chainLightning', - name: 'Chain Lightning', - description: 'Grants the ability to cast Chain Lightning (25 lightning damage, hits 3 targets)', - category: 'spell', - baseCapacityCost: 160, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'chainLightning' } - }, - spell_stormCall: { - id: 'spell_stormCall', - name: 'Storm Call', - description: 'Grants the ability to cast Storm Call (40 lightning damage, hits 2 targets)', - category: 'spell', - baseCapacityCost: 190, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'stormCall' } - }, - spell_thunderStrike: { - id: 'spell_thunderStrike', - name: 'Thunder Strike', - description: 'Grants the ability to cast Thunder Strike (150 lightning damage, 50% armor pierce)', - category: 'spell', - baseCapacityCost: 350, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'thunderStrike' } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // ═══════════════════════════════════════════════════════════════════════════ - // METAL SPELL EFFECTS - Fire + Earth compound, armor pierce focus - // ═══════════════════════════════════════════════════════════════════════════ - - spell_metalShard: { - id: 'spell_metalShard', - name: 'Metal Shard', - description: 'Grants the ability to cast Metal Shard (16 metal damage, 25% armor pierce)', - category: 'spell', - baseCapacityCost: 85, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'metalShard' } - }, - spell_ironFist: { - id: 'spell_ironFist', - name: 'Iron Fist', - description: 'Grants the ability to cast Iron Fist (28 metal damage, 35% armor pierce)', - category: 'spell', - baseCapacityCost: 120, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'ironFist' } - }, - spell_steelTempest: { - id: 'spell_steelTempest', - name: 'Steel Tempest', - description: 'Grants the ability to cast Steel Tempest (55 metal damage, 45% armor pierce)', - category: 'spell', - baseCapacityCost: 190, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'steelTempest' } - }, - spell_furnaceBlast: { - id: 'spell_furnaceBlast', - name: 'Furnace Blast', - description: 'Grants the ability to cast Furnace Blast (200 metal damage, 60% armor pierce)', - category: 'spell', - baseCapacityCost: 400, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'furnaceBlast' } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // ═══════════════════════════════════════════════════════════════════════════ - // SAND SPELL EFFECTS - Earth + Water compound, AOE focus - // ═══════════════════════════════════════════════════════════════════════════ - - spell_sandBlast: { - id: 'spell_sandBlast', - name: 'Sand Blast', - description: 'Grants the ability to cast Sand Blast (11 sand damage, very fast)', - category: 'spell', - baseCapacityCost: 72, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'sandBlast' } - }, - spell_sandstorm: { - id: 'spell_sandstorm', - name: 'Sandstorm', - description: 'Grants the ability to cast Sandstorm (22 sand damage, hits 2 enemies)', - category: 'spell', - baseCapacityCost: 100, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'sandstorm' } - }, - spell_desertWind: { - id: 'spell_desertWind', - name: 'Desert Wind', - description: 'Grants the ability to cast Desert Wind (38 sand damage, hits 3 enemies)', - category: 'spell', - baseCapacityCost: 155, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'desertWind' } - }, - spell_duneCollapse: { - id: 'spell_duneCollapse', - name: 'Dune Collapse', - description: 'Grants the ability to cast Dune Collapse (100 sand damage, hits 5 enemies)', - category: 'spell', - baseCapacityCost: 300, - maxStacks: 1, - allowedEquipmentCategories: ALL_CASTER, - effect: { type: 'spell', spellId: 'duneCollapse' } - }, - - // ═══════════════════════════════════════════════════════════════════════════ - // ═══════════════════════════════════════════════════════════════════════════ - // ═══════════════════════════════════════════════════════════════════════════ - // ═══════════════════════════════════════════════════════════════════════════ - // MAGIC SWORD ENCHANTMENTS - Elemental weapon effects - // ═══════════════════════════════════════════════════════════════════════════ - - sword_fire: { - id: 'sword_fire', - name: 'Fire Enchant', - description: 'Enchant blade with fire. Burns enemies over time.', - category: 'elemental', - baseCapacityCost: 40, - maxStacks: 1, - allowedEquipmentCategories: CASTER_AND_SWORD, - effect: { type: 'special', specialId: 'fireBlade' } - }, - sword_frost: { - id: 'sword_frost', - name: 'Frost Enchant', - description: 'Enchant blade with frost. Prevents enemy dodge.', - category: 'elemental', - baseCapacityCost: 40, - maxStacks: 1, - allowedEquipmentCategories: CASTER_AND_SWORD, - effect: { type: 'special', specialId: 'frostBlade' } - }, - sword_lightning: { - id: 'sword_lightning', - name: 'Lightning Enchant', - description: 'Enchant blade with lightning. Pierces 30% armor.', - category: 'elemental', - baseCapacityCost: 50, - maxStacks: 1, - allowedEquipmentCategories: CASTER_AND_SWORD, - effect: { type: 'special', specialId: 'lightningBlade' } - }, - sword_void: { - id: 'sword_void', - name: 'Void Enchant', - description: 'Enchant blade with void. +20% damage bonus.', - category: 'elemental', - baseCapacityCost: 60, - maxStacks: 1, - allowedEquipmentCategories: CASTER_AND_SWORD, - effect: { type: 'special', specialId: 'voidBlade' } - }, -}; - -// ─── Helper Functions ──────────────────────────────────────────────────────────── - -export function getEnchantmentEffect(id: string): EnchantmentEffectDef | undefined { - return ENCHANTMENT_EFFECTS[id]; -} - -export function getEffectsForEquipment(equipmentCategory: EquipmentCategory): EnchantmentEffectDef[] { - return Object.values(ENCHANTMENT_EFFECTS).filter(effect => - effect.allowedEquipmentCategories.includes(equipmentCategory) - ); -} - -export function canApplyEffect(effectId: string, equipmentCategory: EquipmentCategory): boolean { - const effect = ENCHANTMENT_EFFECTS[effectId]; - if (!effect) return false; - return effect.allowedEquipmentCategories.includes(equipmentCategory); -} - -export function calculateEffectCapacityCost(effectId: string, stacks: number, efficiencyBonus: number = 0): number { - const effect = ENCHANTMENT_EFFECTS[effectId]; - if (!effect) return 0; - - let totalCost = 0; - for (let i = 0; i < stacks; i++) { - // Each additional stack costs 20% more - const stackMultiplier = 1 + (i * 0.2); - totalCost += effect.baseCapacityCost * stackMultiplier; - } - - // Apply efficiency bonus (reduces cost) - return Math.floor(totalCost * (1 - efficiencyBonus)); -} +export { + ENCHANTMENT_EFFECTS, + type EnchantmentEffectCategory, + type EnchantmentEffectDef, + getEnchantmentEffect, + getEffectsForEquipment, + canApplyEffect, + calculateEffectCapacityCost, + // Also export category-specific collections + SPELL_EFFECTS, + MANA_EFFECTS, + COMBAT_EFFECTS, + ELEMENTAL_EFFECTS, + DEFENSE_EFFECTS, + UTILITY_EFFECTS, + SPECIAL_EFFECTS, +} from './enchantments/index' diff --git a/src/lib/game/data/enchantment-types.ts b/src/lib/game/data/enchantment-types.ts new file mode 100644 index 0000000..c64c694 --- /dev/null +++ b/src/lib/game/data/enchantment-types.ts @@ -0,0 +1,23 @@ +// ─── Enchantment Types ───────────────────────────────────────────────── +// Shared types for enchantment effects + +import type { EquipmentCategory } from './equipment' + +export type EnchantmentEffectCategory = 'spell' | 'mana' | 'combat' | 'elemental' | 'defense' | 'utility' | 'special' + +export interface EnchantmentEffectDef { + id: string; + name: string; + description: string; + category: EnchantmentEffectCategory; + baseCapacityCost: number; + maxStacks: number; + allowedEquipmentCategories: EquipmentCategory[]; + effect: { + type: 'spell' | 'bonus' | 'multiplier' | 'special'; + spellId?: string; + stat?: string; + value?: number; + specialId?: string; + }; +} diff --git a/src/lib/game/data/enchantments/combat-effects.ts b/src/lib/game/data/enchantments/combat-effects.ts new file mode 100644 index 0000000..a2125a2 --- /dev/null +++ b/src/lib/game/data/enchantments/combat-effects.ts @@ -0,0 +1,65 @@ +// ─── Combat Enchantment Effects ───────────────────────────────────────────── +// All combat-related enchantment effects that can be applied to equipment + +import type { EquipmentCategory } from '../equipment' +import type { EnchantmentEffectDef } from '../enchantment-types' + +// Helper to define allowed equipment categories for each effect type +const CASTER_AND_HANDS: EquipmentCategory[] = ['caster', 'hands'] + +export const COMBAT_EFFECTS: Record = { + // ═══════════════════════════════════════════════════════════════════════════ + // COMBAT EFFECTS - Damage and attack enhancements + // ═══════════════════════════════════════════════════════════════════════════ + + damage_5: { + id: 'damage_5', + name: 'Minor Power', + description: '+5 base damage', + category: 'combat', + baseCapacityCost: 15, + maxStacks: 5, + allowedEquipmentCategories: CASTER_AND_HANDS, + effect: { type: 'bonus', stat: 'baseDamage', value: 5 } + }, + damage_10: { + id: 'damage_10', + name: 'Moderate Power', + description: '+10 base damage', + category: 'combat', + baseCapacityCost: 28, + maxStacks: 4, + allowedEquipmentCategories: CASTER_AND_HANDS, + effect: { type: 'bonus', stat: 'baseDamage', value: 10 } + }, + damage_pct_10: { + id: 'damage_pct_10', + name: 'Amplification', + description: '+10% damage', + category: 'combat', + baseCapacityCost: 30, + maxStacks: 3, + allowedEquipmentCategories: CASTER_AND_HANDS, + effect: { type: 'multiplier', stat: 'baseDamage', value: 1.10 } + }, + crit_5: { + id: 'crit_5', + name: 'Sharp Edge', + description: '+5% critical hit chance', + category: 'combat', + baseCapacityCost: 20, + maxStacks: 4, + allowedEquipmentCategories: CASTER_AND_HANDS, + effect: { type: 'bonus', stat: 'critChance', value: 0.05 } + }, + attack_speed_10: { + id: 'attack_speed_10', + name: 'Swift Casting', + description: '+10% attack speed', + category: 'combat', + baseCapacityCost: 22, + maxStacks: 4, + allowedEquipmentCategories: CASTER_AND_HANDS, + effect: { type: 'multiplier', stat: 'attackSpeed', value: 1.10 } + }, +}; diff --git a/src/lib/game/data/enchantments/defense-effects.ts b/src/lib/game/data/enchantments/defense-effects.ts new file mode 100644 index 0000000..40af153 --- /dev/null +++ b/src/lib/game/data/enchantments/defense-effects.ts @@ -0,0 +1,8 @@ +// ─── Defense Enchantment Effects ───────────────────────────────────────── +// All defense-related enchantment effects that can be applied to equipment +// Currently empty - no defense effects defined in the original enchantment-effects.ts + +import type { EquipmentCategory } from '../equipment' +import type { EnchantmentEffectDef } from '../enchantment-types' + +export const DEFENSE_EFFECTS: Record = {}; diff --git a/src/lib/game/data/enchantments/elemental-effects.ts b/src/lib/game/data/enchantments/elemental-effects.ts new file mode 100644 index 0000000..2d05dd6 --- /dev/null +++ b/src/lib/game/data/enchantments/elemental-effects.ts @@ -0,0 +1,55 @@ +// ─── Elemental Enchantment Effects ───────────────────────────────────────── +// All elemental-related enchantment effects that can be applied to equipment + +import type { EquipmentCategory } from '../equipment' +import type { EnchantmentEffectDef } from '../enchantment-types' + +// Helper to define allowed equipment categories for each effect type +const CASTER_AND_SWORD: EquipmentCategory[] = ['caster', 'sword'] + +export const ELEMENTAL_EFFECTS: Record = { + // ═══════════════════════════════════════════════════════════════════════════ + // MAGIC SWORD ENCHANTMENTS - Elemental weapon effects + // ═══════════════════════════════════════════════════════════════════════════ + + sword_fire: { + id: 'sword_fire', + name: 'Fire Enchant', + description: 'Enchant blade with fire. Burns enemies over time.', + category: 'elemental', + baseCapacityCost: 40, + maxStacks: 1, + allowedEquipmentCategories: CASTER_AND_SWORD, + effect: { type: 'special', specialId: 'fireBlade' } + }, + sword_frost: { + id: 'sword_frost', + name: 'Frost Enchant', + description: 'Enchant blade with frost. Prevents enemy dodge.', + category: 'elemental', + baseCapacityCost: 40, + maxStacks: 1, + allowedEquipmentCategories: CASTER_AND_SWORD, + effect: { type: 'special', specialId: 'frostBlade' } + }, + sword_lightning: { + id: 'sword_lightning', + name: 'Lightning Enchant', + description: 'Enchant blade with lightning. Pierces 30% armor.', + category: 'elemental', + baseCapacityCost: 50, + maxStacks: 1, + allowedEquipmentCategories: CASTER_AND_SWORD, + effect: { type: 'special', specialId: 'lightningBlade' } + }, + sword_void: { + id: 'sword_void', + name: 'Void Enchant', + description: 'Enchant blade with void. +20% damage bonus.', + category: 'elemental', + baseCapacityCost: 60, + maxStacks: 1, + allowedEquipmentCategories: CASTER_AND_SWORD, + effect: { type: 'special', specialId: 'voidBlade' } + }, +}; diff --git a/src/lib/game/data/enchantments/index.ts b/src/lib/game/data/enchantments/index.ts new file mode 100644 index 0000000..7e27d67 --- /dev/null +++ b/src/lib/game/data/enchantments/index.ts @@ -0,0 +1,69 @@ +// ─── Enchantment Effects Index ───────────────────────────────────────── +// Re-exports everything from category-specific files for backward compatibility + +// Import types +import type { EnchantmentEffectCategory, EnchantmentEffectDef } from '../enchantment-types' + +// Import all category-specific effect collections +import { SPELL_EFFECTS } from './spell-effects' +import { MANA_EFFECTS } from './mana-effects' +import { COMBAT_EFFECTS } from './combat-effects' +import { ELEMENTAL_EFFECTS } from './elemental-effects' +import { DEFENSE_EFFECTS } from './defense-effects' +import { UTILITY_EFFECTS } from './utility-effects' +import { SPECIAL_EFFECTS } from './special-effects' + +// Merge all effects into a single record for backward compatibility +export const ENCHANTMENT_EFFECTS: Record = { + ...SPELL_EFFECTS, + ...MANA_EFFECTS, + ...COMBAT_EFFECTS, + ...ELEMENTAL_EFFECTS, + ...DEFENSE_EFFECTS, + ...UTILITY_EFFECTS, + ...SPECIAL_EFFECTS, +} + +// ─── Helper Functions ──────────────────────────────────────────────────────── + +export function getEnchantmentEffect(id: string): EnchantmentEffectDef | undefined { + return ENCHANTMENT_EFFECTS[id]; +} + +export function getEffectsForEquipment(equipmentCategory: EquipmentCategory): EnchantmentEffectDef[] { + return Object.values(ENCHANTMENT_EFFECTS).filter(effect => + effect.allowedEquipmentCategories.includes(equipmentCategory) + ); +} + +export function canApplyEffect(effectId: string, equipmentCategory: EquipmentCategory): boolean { + const effect = ENCHANTMENT_EFFECTS[effectId]; + if (!effect) return false; + return effect.allowedEquipmentCategories.includes(equipmentCategory); +} + +export function calculateEffectCapacityCost(effectId: string, stacks: number, efficiencyBonus: number = 0): number { + const effect = ENCHANTMENT_EFFECTS[effectId]; + if (!effect) return 0; + + let totalCost = 0; + for (let i = 0; i < stacks; i++) { + // Each additional stack costs 20% more + const stackMultiplier = 1 + (i * 0.2); + totalCost += effect.baseCapacityCost * stackMultiplier; + } + + // Apply efficiency bonus (reduces cost) + return Math.floor(totalCost * (1 - efficiencyBonus)); +} + +// Re-export category-specific collections for direct access if needed +export { + SPELL_EFFECTS, + MANA_EFFECTS, + COMBAT_EFFECTS, + ELEMENTAL_EFFECTS, + DEFENSE_EFFECTS, + UTILITY_EFFECTS, + SPECIAL_EFFECTS, +} diff --git a/src/lib/game/data/enchantments/mana-effects.ts b/src/lib/game/data/enchantments/mana-effects.ts new file mode 100644 index 0000000..47564f1 --- /dev/null +++ b/src/lib/game/data/enchantments/mana-effects.ts @@ -0,0 +1,152 @@ +// ─── Mana Enchantment Effects ──────────────────────────────────────────────── +// All mana-related enchantment effects that can be applied to equipment + +import type { EquipmentCategory } from '../equipment' +import type { EnchantmentEffectDef } from '../enchantment-types' + +// Helper to define allowed equipment categories for each effect type +const MANA_EQUIPMENT: EquipmentCategory[] = ['caster', 'catalyst', 'head', 'body', 'accessory'] +const WEAPON_EQUIPMENT: EquipmentCategory[] = ['caster', 'catalyst', 'sword'] // All main hand equipment + +export const MANA_EFFECTS: Record = { + // ═══════════════════════════════════════════════════════════════════════════ + // MANA EFFECTS - Boost mana capacity and regeneration + // ═══════════════════════════════════════════════════════════════════════════ + + mana_cap_50: { + id: 'mana_cap_50', + name: 'Mana Reserve', + description: '+50 maximum mana', + category: 'mana', + baseCapacityCost: 20, + maxStacks: 3, + allowedEquipmentCategories: MANA_EQUIPMENT, + effect: { type: 'bonus', stat: 'maxMana', value: 50 } + }, + mana_cap_100: { + id: 'mana_cap_100', + name: 'Mana Reservoir', + description: '+100 maximum mana', + category: 'mana', + baseCapacityCost: 35, + maxStacks: 3, + allowedEquipmentCategories: MANA_EQUIPMENT, + effect: { type: 'bonus', stat: 'maxMana', value: 100 } + }, + mana_regen_1: { + id: 'mana_regen_1', + name: 'Trickle', + description: '+1 mana per hour regeneration', + category: 'mana', + baseCapacityCost: 15, + maxStacks: 5, + allowedEquipmentCategories: MANA_EQUIPMENT, + effect: { type: 'bonus', stat: 'regen', value: 1 } + }, + mana_regen_2: { + id: 'mana_regen_2', + name: 'Stream', + description: '+2 mana per hour regeneration', + category: 'mana', + baseCapacityCost: 28, + maxStacks: 4, + allowedEquipmentCategories: MANA_EQUIPMENT, + effect: { type: 'bonus', stat: 'regen', value: 2 } + }, + mana_regen_5: { + id: 'mana_regen_5', + name: 'River', + description: '+5 mana per hour regeneration', + category: 'mana', + baseCapacityCost: 50, + maxStacks: 3, + allowedEquipmentCategories: MANA_EQUIPMENT, + effect: { type: 'bonus', stat: 'regen', value: 5 } + }, + click_mana_1: { + id: 'click_mana_1', + name: 'Mana Tap', + description: '+1 mana per click', + category: 'mana', + baseCapacityCost: 20, + maxStacks: 5, + allowedEquipmentCategories: MANA_EQUIPMENT, + effect: { type: 'bonus', stat: 'clickMana', value: 1 } + }, + click_mana_3: { + id: 'click_mana_3', + name: 'Mana Surge', + description: '+3 mana per click', + category: 'mana', + baseCapacityCost: 35, + maxStacks: 3, + allowedEquipmentCategories: MANA_EQUIPMENT, + effect: { type: 'bonus', stat: 'clickMana', value: 3 } + }, + + // ═══════════════════════════════════════════════════════════════════════════ + // WEAPON MANA EFFECTS - Enchanter level 3+ unlocks these + // These add mana capacity and regeneration to weapons for their enchantments + // ═══════════════════════════════════════════════════════════════════════════ + + weapon_mana_cap_20: { + id: 'weapon_mana_cap_20', + name: 'Mana Cell', + description: '+20 weapon mana capacity (for weapon enchantments)', + category: 'mana', + baseCapacityCost: 25, + maxStacks: 5, + allowedEquipmentCategories: WEAPON_EQUIPMENT, + effect: { type: 'bonus', stat: 'weaponManaMax', value: 20 } + }, + weapon_mana_cap_50: { + id: 'weapon_mana_cap_50', + name: 'Mana Vessel', + description: '+50 weapon mana capacity (for weapon enchantments)', + category: 'mana', + baseCapacityCost: 50, + maxStacks: 3, + allowedEquipmentCategories: WEAPON_EQUIPMENT, + effect: { type: 'bonus', stat: 'weaponManaMax', value: 50 } + }, + weapon_mana_cap_100: { + id: 'weapon_mana_cap_100', + name: 'Mana Core', + description: '+100 weapon mana capacity (for weapon enchantments)', + category: 'mana', + baseCapacityCost: 80, + maxStacks: 2, + allowedEquipmentCategories: WEAPON_EQUIPMENT, + effect: { type: 'bonus', stat: 'weaponManaMax', value: 100 } + }, + weapon_mana_regen_1: { + id: 'weapon_mana_regen_1', + name: 'Mana Wick', + description: '+1 weapon mana regeneration per hour', + category: 'mana', + baseCapacityCost: 20, + maxStacks: 5, + allowedEquipmentCategories: WEAPON_EQUIPMENT, + effect: { type: 'bonus', stat: 'weaponManaRegen', value: 1 } + }, + weapon_mana_regen_2: { + id: 'weapon_mana_regen_2', + name: 'Mana Siphon', + description: '+2 weapon mana regeneration per hour', + category: 'mana', + baseCapacityCost: 35, + maxStacks: 3, + allowedEquipmentCategories: WEAPON_EQUIPMENT, + effect: { type: 'bonus', stat: 'weaponManaRegen', value: 2 } + }, + weapon_mana_regen_5: { + id: 'weapon_mana_regen_5', + name: 'Mana Well', + description: '+5 weapon mana regeneration per hour', + category: 'mana', + baseCapacityCost: 60, + maxStacks: 2, + allowedEquipmentCategories: WEAPON_EQUIPMENT, + effect: { type: 'bonus', stat: 'weaponManaRegen', value: 5 } + }, +}; diff --git a/src/lib/game/data/enchantments/special-effects.ts b/src/lib/game/data/enchantments/special-effects.ts new file mode 100644 index 0000000..a438a29 --- /dev/null +++ b/src/lib/game/data/enchantments/special-effects.ts @@ -0,0 +1,47 @@ +// ─── Special Enchantment Effects ───────────────────────────────────────── +// All special-related enchantment effects that can be applied to equipment + +import type { EquipmentCategory } from '../equipment' +import type { EnchantmentEffectDef } from '../enchantment-types' + +// Helper to define allowed equipment categories for each effect type +const ALL_CASTER: EquipmentCategory[] = ['caster'] +const CASTER_AND_HANDS: EquipmentCategory[] = ['caster', 'hands'] +const CASTER_CATALYST_ACCESSORY: EquipmentCategory[] = ['caster', 'catalyst', 'accessory'] + +export const SPECIAL_EFFECTS: Record = { + // ═══════════════════════════════════════════════════════════════════════════ + // SPECIAL EFFECTS - Unique and powerful effects + // ═══════════════════════════════════════════════════════════════════════════ + + spell_echo_10: { + id: 'spell_echo_10', + name: 'Echo Chamber', + description: '10% chance to cast a spell twice', + category: 'special', + baseCapacityCost: 60, + maxStacks: 2, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'special', specialId: 'spellEcho10' } + }, + guardian_dmg_10: { + id: 'guardian_dmg_10', + name: 'Bane', + description: '+10% damage to guardians', + category: 'special', + baseCapacityCost: 35, + maxStacks: 3, + allowedEquipmentCategories: CASTER_CATALYST_ACCESSORY, + effect: { type: 'multiplier', stat: 'guardianDamage', value: 1.10 } + }, + overpower_80: { + id: 'overpower_80', + name: 'Overpower', + description: '+50% damage when mana above 80%', + category: 'special', + baseCapacityCost: 55, + maxStacks: 1, + allowedEquipmentCategories: CASTER_AND_HANDS, + effect: { type: 'special', specialId: 'overpower' } + }, +}; diff --git a/src/lib/game/data/enchantments/spell-effects.ts b/src/lib/game/data/enchantments/spell-effects.ts new file mode 100644 index 0000000..4fb7c2d --- /dev/null +++ b/src/lib/game/data/enchantments/spell-effects.ts @@ -0,0 +1,473 @@ +// ─── Spell Enchantment Effects ──────────────────────────────────────────────── +// All spell-related enchantment effects that can be applied to equipment + +import type { EquipmentCategory } from '../equipment' +import type { EnchantmentEffectDef } from '../enchantment-types' + +// Helper to define allowed equipment categories for each effect type +const ALL_CASTER: EquipmentCategory[] = ['caster'] + +export const SPELL_EFFECTS: Record = { + // ═══════════════════════════════════════════════════════════════════════════ + // SPELL EFFECTS - Only for CASTER equipment (staves, wands, rods, orbs) + // ═══════════════════════════════════════════════════════════════════════════ + + // Tier 0 - Basic Spells + spell_manaBolt: { + id: 'spell_manaBolt', + name: 'Mana Bolt', + description: 'Grants the ability to cast Mana Bolt (5 base damage, raw mana cost)', + category: 'spell', + baseCapacityCost: 50, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'manaBolt' } + }, + spell_manaStrike: { + id: 'spell_manaStrike', + name: 'Mana Strike', + description: 'Grants the ability to cast Mana Strike (8 base damage, raw mana cost)', + category: 'spell', + baseCapacityCost: 40, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'manaStrike' } + }, + + // Tier 1 - Basic Elemental Spells + spell_fireball: { + id: 'spell_fireball', + name: 'Fireball', + description: 'Grants the ability to cast Fireball (15 fire damage)', + category: 'spell', + baseCapacityCost: 80, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'fireball' } + }, + spell_emberShot: { + id: 'spell_emberShot', + name: 'Ember Shot', + description: 'Grants the ability to cast Ember Shot (10 fire damage, fast cast)', + category: 'spell', + baseCapacityCost: 60, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'emberShot' } + }, + spell_waterJet: { + id: 'spell_waterJet', + name: 'Water Jet', + description: 'Grants the ability to cast Water Jet (12 water damage)', + category: 'spell', + baseCapacityCost: 70, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'waterJet' } + }, + spell_iceShard: { + id: 'spell_iceShard', + name: 'Ice Shard', + description: 'Grants the ability to cast Ice Shard (14 water damage)', + category: 'spell', + baseCapacityCost: 75, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'iceShard' } + }, + spell_gust: { + id: 'spell_gust', + name: 'Gust', + description: 'Grants the ability to cast Gust (10 air damage, fast cast)', + category: 'spell', + baseCapacityCost: 60, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'gust' } + }, + spell_stoneBullet: { + id: 'spell_stoneBullet', + name: 'Stone Bullet', + description: 'Grants the ability to cast Stone Bullet (16 earth damage)', + category: 'spell', + baseCapacityCost: 80, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'stoneBullet' } + }, + spell_lightLance: { + id: 'spell_lightLance', + name: 'Light Lance', + description: 'Grants the ability to cast Light Lance (18 light damage)', + category: 'spell', + baseCapacityCost: 95, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'lightLance' } + }, + spell_shadowBolt: { + id: 'spell_shadowBolt', + name: 'Shadow Bolt', + description: 'Grants the ability to cast Shadow Bolt (16 dark damage)', + category: 'spell', + baseCapacityCost: 95, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'shadowBolt' } + }, + spell_drain: { + id: 'spell_drain', + name: 'Drain', + description: 'Grants the ability to cast Drain (10 death damage)', + category: 'spell', + baseCapacityCost: 85, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'drain' } + }, + + // Tier 2 - Advanced Spells + spell_inferno: { + id: 'spell_inferno', + name: 'Inferno', + description: 'Grants the ability to cast Inferno (60 fire damage)', + category: 'spell', + baseCapacityCost: 180, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'inferno' } + }, + spell_tidalWave: { + id: 'spell_tidalWave', + name: 'Tidal Wave', + description: 'Grants the ability to cast Tidal Wave (55 water damage)', + category: 'spell', + baseCapacityCost: 175, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'tidalWave' } + }, + spell_hurricane: { + id: 'spell_hurricane', + name: 'Hurricane', + description: 'Grants the ability to cast Hurricane (50 air damage)', + category: 'spell', + baseCapacityCost: 170, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'hurricane' } + }, + spell_earthquake: { + id: 'spell_earthquake', + name: 'Earthquake', + description: 'Grants the ability to cast Earthquake (70 earth damage)', + category: 'spell', + baseCapacityCost: 200, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'earthquake' } + }, + spell_solarFlare: { + id: 'spell_solarFlare', + name: 'Solar Flare', + description: 'Grants the ability to cast Solar Flare (65 light damage)', + category: 'spell', + baseCapacityCost: 190, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'solarFlare' } + }, + spell_voidRift: { + id: 'spell_voidRift', + name: 'Void Rift', + description: 'Grants the ability to cast Void Rift (55 dark damage)', + category: 'spell', + baseCapacityCost: 175, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'voidRift' } + }, + + // Additional Tier 1 Spells + spell_windSlash: { + id: 'spell_windSlash', + name: 'Wind Slash', + description: 'Grants the ability to cast Wind Slash (12 air damage)', + category: 'spell', + baseCapacityCost: 72, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'windSlash' } + }, + spell_rockSpike: { + id: 'spell_rockSpike', + name: 'Rock Spike', + description: 'Grants the ability to cast Rock Spike (18 earth damage)', + category: 'spell', + baseCapacityCost: 88, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'rockSpike' } + }, + spell_radiance: { + id: 'spell_radiance', + name: 'Radiance', + description: 'Grants the ability to cast Radiance (14 light damage)', + category: 'spell', + baseCapacityCost: 80, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'radiance' } + }, + spell_darkPulse: { + id: 'spell_darkPulse', + name: 'Dark Pulse', + description: 'Grants the ability to cast Dark Pulse (12 dark damage)', + category: 'spell', + baseCapacityCost: 68, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'darkPulse' } + }, + + // Additional Tier 2 Spells + spell_flameWave: { + id: 'spell_flameWave', + name: 'Flame Wave', + description: 'Grants the ability to cast Flame Wave (45 fire damage)', + category: 'spell', + baseCapacityCost: 165, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'flameWave' } + }, + spell_iceStorm: { + id: 'spell_iceStorm', + name: 'Ice Storm', + description: 'Grants the ability to cast Ice Storm (50 water damage)', + category: 'spell', + baseCapacityCost: 170, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'iceStorm' } + }, + spell_windBlade: { + id: 'spell_windBlade', + name: 'Wind Blade', + description: 'Grants the ability to cast Wind Blade (40 air damage)', + category: 'spell', + baseCapacityCost: 155, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'windBlade' } + }, + spell_stoneBarrage: { + id: 'spell_stoneBarrage', + name: 'Stone Barrage', + description: 'Grants the ability to cast Stone Barrage (55 earth damage)', + category: 'spell', + baseCapacityCost: 175, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'stoneBarrage' } + }, + spell_divineSmite: { + id: 'spell_divineSmite', + name: 'Divine Smite', + description: 'Grants the ability to cast Divine Smite (55 light damage)', + category: 'spell', + baseCapacityCost: 175, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'divineSmite' } + }, + spell_shadowStorm: { + id: 'spell_shadowStorm', + name: 'Shadow Storm', + description: 'Grants the ability to cast Shadow Storm (48 dark damage)', + category: 'spell', + baseCapacityCost: 168, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'shadowStorm' } + }, + + // Tier 3 - Master Spells + spell_pyroclasm: { + id: 'spell_pyroclasm', + name: 'Pyroclasm', + description: 'Grants the ability to cast Pyroclasm (250 fire damage)', + category: 'spell', + baseCapacityCost: 400, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'pyroclasm' } + }, + spell_tsunami: { + id: 'spell_tsunami', + name: 'Tsunami', + description: 'Grants the ability to cast Tsunami (220 water damage)', + category: 'spell', + baseCapacityCost: 380, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'tsunami' } + }, + spell_meteorStrike: { + id: 'spell_meteorStrike', + name: 'Meteor Strike', + description: 'Grants the ability to cast Meteor Strike (280 earth damage)', + category: 'spell', + baseCapacityCost: 420, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'meteorStrike' } + }, + + // ═══════════════════════════════════════════════════════════════════════════ + // LIGHTNING SPELL EFFECTS - Fast, armor-piercing, harder to dodge + // ═══════════════════════════════════════════════════════════════════════════ + + spell_spark: { + id: 'spell_spark', + name: 'Spark', + description: 'Grants the ability to cast Spark (8 lightning damage, very fast, armor pierce)', + category: 'spell', + baseCapacityCost: 70, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'spark' } + }, + spell_lightningBolt: { + id: 'spell_lightningBolt', + name: 'Lightning Bolt', + description: 'Grants the ability to cast Lightning Bolt (14 lightning damage, armor pierce)', + category: 'spell', + baseCapacityCost: 90, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'lightningBolt' } + }, + spell_chainLightning: { + id: 'spell_chainLightning', + name: 'Chain Lightning', + description: 'Grants the ability to cast Chain Lightning (25 lightning damage, hits 3 targets)', + category: 'spell', + baseCapacityCost: 160, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'chainLightning' } + }, + spell_stormCall: { + id: 'spell_stormCall', + name: 'Storm Call', + description: 'Grants the ability to cast Storm Call (40 lightning damage, hits 2 targets)', + category: 'spell', + baseCapacityCost: 190, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'stormCall' } + }, + spell_thunderStrike: { + id: 'spell_thunderStrike', + name: 'Thunder Strike', + description: 'Grants the ability to cast Thunder Strike (150 lightning damage, 50% armor pierce)', + category: 'spell', + baseCapacityCost: 350, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'thunderStrike' } + }, + + // ═══════════════════════════════════════════════════════════════════════════ + // METAL SPELL EFFECTS - Fire + Earth compound, armor pierce focus + // ═══════════════════════════════════════════════════════════════════════════ + + spell_metalShard: { + id: 'spell_metalShard', + name: 'Metal Shard', + description: 'Grants the ability to cast Metal Shard (16 metal damage, 25% armor pierce)', + category: 'spell', + baseCapacityCost: 85, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'metalShard' } + }, + spell_ironFist: { + id: 'spell_ironFist', + name: 'Iron Fist', + description: 'Grants the ability to cast Iron Fist (28 metal damage, 35% armor pierce)', + category: 'spell', + baseCapacityCost: 120, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'ironFist' } + }, + spell_steelTempest: { + id: 'spell_steelTempest', + name: 'Steel Tempest', + description: 'Grants the ability to cast Steel Tempest (55 metal damage, 45% armor pierce)', + category: 'spell', + baseCapacityCost: 190, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'steelTempest' } + }, + spell_furnaceBlast: { + id: 'spell_furnaceBlast', + name: 'Furnace Blast', + description: 'Grants the ability to cast Furnace Blast (200 metal damage, 60% armor pierce)', + category: 'spell', + baseCapacityCost: 400, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'furnaceBlast' } + }, + + // ═══════════════════════════════════════════════════════════════════════════ + // SAND SPELL EFFECTS - Earth + Water compound, AOE focus + // ═══════════════════════════════════════════════════════════════════════════ + + spell_sandBlast: { + id: 'spell_sandBlast', + name: 'Sand Blast', + description: 'Grants the ability to cast Sand Blast (11 sand damage, very fast)', + category: 'spell', + baseCapacityCost: 72, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'sandBlast' } + }, + spell_sandstorm: { + id: 'spell_sandstorm', + name: 'Sandstorm', + description: 'Grants the ability to cast Sandstorm (22 sand damage, hits 2 enemies)', + category: 'spell', + baseCapacityCost: 100, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'sandstorm' } + }, + spell_desertWind: { + id: 'spell_desertWind', + name: 'Desert Wind', + description: 'Grants the ability to cast Desert Wind (38 sand damage, hits 3 enemies)', + category: 'spell', + baseCapacityCost: 155, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'desertWind' } + }, + spell_duneCollapse: { + id: 'spell_duneCollapse', + name: 'Dune Collapse', + description: 'Grants the ability to cast Dune Collapse (100 sand damage, hits 5 enemies)', + category: 'spell', + baseCapacityCost: 300, + maxStacks: 1, + allowedEquipmentCategories: ALL_CASTER, + effect: { type: 'spell', spellId: 'duneCollapse' } + }, +}; + + diff --git a/src/lib/game/data/enchantments/utility-effects.ts b/src/lib/game/data/enchantments/utility-effects.ts new file mode 100644 index 0000000..733cfd0 --- /dev/null +++ b/src/lib/game/data/enchantments/utility-effects.ts @@ -0,0 +1,45 @@ +// ─── Utility Enchantment Effects ───────────────────────────────────────── +// All utility-related enchantment effects that can be applied to equipment + +import type { EquipmentCategory } from '../equipment' +import type { EnchantmentEffectDef } from '../enchantment-types' + +// Helper to define allowed equipment categories for each effect type +const UTILITY_EQUIPMENT: EquipmentCategory[] = ['caster', 'catalyst', 'head', 'body', 'hands', 'feet', 'accessory'] + +export const UTILITY_EFFECTS: Record = { + // ═══════════════════════════════════════════════════════════════════════════ + // UTILITY EFFECTS - Study speed, insight, meditation + // ═══════════════════════════════════════════════════════════════════════════ + + meditate_10: { + id: 'meditate_10', + name: 'Meditative Focus', + description: '+10% meditation efficiency', + category: 'utility', + baseCapacityCost: 18, + maxStacks: 5, + allowedEquipmentCategories: ['head', 'body', 'accessory'], + effect: { type: 'multiplier', stat: 'meditationEfficiency', value: 1.10 } + }, + study_10: { + id: 'study_10', + name: 'Quick Study', + description: '+10% study speed', + category: 'utility', + baseCapacityCost: 22, + maxStacks: 4, + allowedEquipmentCategories: UTILITY_EQUIPMENT, + effect: { type: 'multiplier', stat: 'studySpeed', value: 1.10 } + }, + insight_5: { + id: 'insight_5', + name: 'Insightful', + description: '+5% insight gain', + category: 'utility', + baseCapacityCost: 25, + maxStacks: 4, + allowedEquipmentCategories: ['head', 'accessory'], + effect: { type: 'multiplier', stat: 'insightGain', value: 1.05 } + }, +};