Add magic swords, weapon mana enchantments, and elemental sword enchantments
Some checks failed
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m12s

- 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
This commit is contained in:
Z User
2026-03-30 15:37:47 +00:00
parent cd10918a3b
commit 2edce9680a
2 changed files with 172 additions and 2 deletions

View File

@@ -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<string, EnchantmentEffectDef> = {
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 ────────────────────────────────────────────────────────────

View File

@@ -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<string, EquipmentType> = {
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'];