From 2edce9680a9930d4419d6b6856a4722dc299ae6b Mon Sep 17 00:00:00 2001 From: Z User Date: Mon, 30 Mar 2026 15:37:47 +0000 Subject: [PATCH] Add magic swords, weapon mana enchantments, and elemental sword enchantments - Added 'sword' equipment category with multiple blade types - Magic swords have low base damage but high cast speed - Added weapon mana capacity enchantments (Mana Cell, Mana Vessel, Mana Core) - Added weapon mana regeneration enchantments (Mana Wick, Mana Siphon, Mana Well) - Added elemental sword enchantments (Fire, Frost, Lightning, Void) - Updated equipment helper functions to handle sword category --- src/lib/game/data/enchantment-effects.ts | 115 ++++++++++++++++++++++- src/lib/game/data/equipment.ts | 59 +++++++++++- 2 files changed, 172 insertions(+), 2 deletions(-) diff --git a/src/lib/game/data/enchantment-effects.ts b/src/lib/game/data/enchantment-effects.ts index ffd0f43..8d800d3 100755 --- a/src/lib/game/data/enchantment-effects.ts +++ b/src/lib/game/data/enchantment-effects.ts @@ -5,12 +5,14 @@ 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', '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' @@ -567,6 +569,117 @@ export const ENCHANTMENT_EFFECTS: Record = { 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 } + }, + + // ═══════════════════════════════════════════════════════════════════════════ + // 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. 10% lifesteal.', + category: 'elemental', + baseCapacityCost: 60, + maxStacks: 1, + allowedEquipmentCategories: CASTER_AND_SWORD, + effect: { type: 'special', specialId: 'voidBlade' } + }, }; // ─── Helper Functions ──────────────────────────────────────────────────────────── diff --git a/src/lib/game/data/equipment.ts b/src/lib/game/data/equipment.ts index b7ae4c5..7a4a329 100755 --- a/src/lib/game/data/equipment.ts +++ b/src/lib/game/data/equipment.ts @@ -1,7 +1,7 @@ // ─── Equipment Types ───────────────────────────────────────────────────────── export type EquipmentSlot = 'mainHand' | 'offHand' | 'head' | 'body' | 'hands' | 'feet' | 'accessory1' | 'accessory2'; -export type EquipmentCategory = 'caster' | 'shield' | 'catalyst' | 'head' | 'body' | 'hands' | 'feet' | 'accessory'; +export type EquipmentCategory = 'caster' | 'shield' | 'catalyst' | 'sword' | 'head' | 'body' | 'hands' | 'feet' | 'accessory'; // All equipment slots in order export const EQUIPMENT_SLOTS: EquipmentSlot[] = ['mainHand', 'offHand', 'head', 'body', 'hands', 'feet', 'accessory1', 'accessory2']; @@ -13,6 +13,8 @@ export interface EquipmentType { slot: EquipmentSlot; baseCapacity: number; description: string; + baseDamage?: number; // For swords + baseCastSpeed?: number; // For swords (higher = faster) } // ─── Equipment Types Definition ───────────────────────────────────────────── @@ -94,6 +96,60 @@ export const EQUIPMENT_TYPES: Record = { description: 'A rare catalyst touched by void energy. High capacity but volatile.', }, + // ─── Main Hand - Magic Swords ───────────────────────────────────────────── + // Magic swords have low base damage but high cast speed + // They can be enchanted with elemental effects that use mana over time + ironBlade: { + id: 'ironBlade', + name: 'Iron Blade', + category: 'sword', + slot: 'mainHand', + baseCapacity: 30, + baseDamage: 3, + baseCastSpeed: 4, + description: 'A simple iron sword. Can be enchanted with elemental effects.', + }, + steelBlade: { + id: 'steelBlade', + name: 'Steel Blade', + category: 'sword', + slot: 'mainHand', + baseCapacity: 40, + baseDamage: 4, + baseCastSpeed: 4, + description: 'A well-crafted steel sword. Balanced for combat and enchanting.', + }, + crystalBlade: { + id: 'crystalBlade', + name: 'Crystal Blade', + category: 'sword', + slot: 'mainHand', + baseCapacity: 55, + baseDamage: 3, + baseCastSpeed: 5, + description: 'A blade made of crystallized mana. Excellent for elemental enchantments.', + }, + arcanistBlade: { + id: 'arcanistBlade', + name: 'Arcanist Blade', + category: 'sword', + slot: 'mainHand', + baseCapacity: 65, + baseDamage: 5, + baseCastSpeed: 4, + description: 'A sword forged for battle mages. High capacity for powerful enchantments.', + }, + voidBlade: { + id: 'voidBlade', + name: 'Void-Touched Blade', + category: 'sword', + slot: 'mainHand', + baseCapacity: 50, + baseDamage: 6, + baseCastSpeed: 3, + description: 'A blade corrupted by void energy. Powerful but consumes more mana.', + }, + // ─── Off Hand - Shields ─────────────────────────────────────────────────── basicShield: { id: 'basicShield', @@ -386,6 +442,7 @@ export function getValidSlotsForCategory(category: EquipmentCategory): Equipment switch (category) { case 'caster': case 'catalyst': + case 'sword': return ['mainHand']; case 'shield': return ['offHand'];