Files
Mana-Loop/crafting-implementation-summary.md
Z User b78c979647
Some checks failed
Build and Publish Mana Loop Docker Image / build-and-publish (push) Has been cancelled
Redesign skill system with upgrade trees and tier progression
Major changes:
- Created docs/skills.md with comprehensive skill system documentation
- Rewrote skill-evolution.ts with new upgrade tree structure:
  - Upgrades organized in branching paths with prerequisites
  - Each choice can lead to upgraded versions at future milestones
  - Support for upgrade children and requirement chains
- Added getBaseSkillId and generateTierSkillDef helper functions
- Fixed getFloorElement to use FLOOR_ELEM_CYCLE.length
- Updated test files to match current skill definitions
- Removed tests for non-existent skills

Skill system now supports:
- Levels 1-10 for most skills, level 5 caps for specialized, level 1 for research
- Tier up system: Tier N Level 1 = Tier N-1 Level 10 in power
- Milestone upgrades at levels 5 and 10 with branching upgrade trees
- Attunement requirements for skill access and tier up
- Study costs and time for leveling
2026-04-03 11:08:58 +00:00

6.7 KiB
Executable File
Raw Blame History

Crafting & Equipment System Implementation Summary

Overview

Replaced the combat skills system with a comprehensive equipment and enchantment system. Players now gain combat abilities through enchanted equipment rather than skills.

Completed Tasks

1. Equipment System ( Complete)

  • File: /src/lib/game/data/equipment.ts
  • 8 equipment slots: mainHand, offHand, head, body, hands, feet, accessory1, accessory2
  • 20+ equipment types across categories: caster, shield, catalyst, head, body, hands, feet, accessory
  • Capacity system: Each equipment has base capacity for enchantments
  • Starting equipment: Basic Staff (with Mana Bolt), Civilian Shirt/Gloves/Shoes

2. Enchantment Effects Catalogue ( Complete)

  • File: /src/lib/game/data/enchantment-effects.ts
  • 100+ enchantment effects across 7 categories:
    • Spell (40+): Grant ability to cast specific spells
    • Mana (20+): Capacity, regen, efficiency bonuses
    • Combat (15+): Damage, crit, attack speed
    • Elemental (10+): Elemental damage bonuses
    • Defense (4): Damage reduction, mana shields
    • Utility (8): Study speed, meditation, insight
    • Special (12): Unique effects like echo, lifesteal, executioner

3. Crafting Store Slice ( Complete)

  • File: /src/lib/game/store/craftingSlice.ts
  • Equipment instance management
  • Enchantment design workflow
  • Preparation progress tracking
  • Application progress with mana consumption
  • Helper functions for computing equipment effects

4. CraftingTab UI Component ( Complete)

  • File: /src/components/game/tabs/CraftingTab.tsx
  • 4 sub-tabs: Equipment, Design, Enchant, Craft
  • Equipment slot visualization with rarity colors
  • Effect catalogue with capacity preview
  • Design creation workflow

5. Type Definitions ( Complete)

  • File: /src/lib/game/types.ts
  • EquipmentInstance, AppliedEnchantment, EnchantmentDesign interfaces
  • Crafting progress states (DesignProgress, PreparationProgress, ApplicationProgress)

6. Skill Evolution Cleanup ( Complete)

  • File: /src/lib/game/skill-evolution.ts
  • Removed combatTrain evolution path (orphaned - skill not in SKILLS_DEF)
  • Removed COMBAT_TRAIN upgrade definitions

7. Bug Fixes ( Complete)

  • Fixed CraftingTab icon imports (Ring → Circle, HandMetal → Hand)

Remaining Tasks (Future Work)

1. Equipment-Granted Spells in Combat (Medium Priority)

  • The equipmentSpellStates array exists but isn't fully utilized
  • Combat tick should check for equipment-granted spells
  • Multi-spell casting from different equipment pieces
  • Individual spell cooldown tracking

2. SpellsTab Integration (Low Priority)

  • Add section showing equipment-granted spells
  • Indicate which equipment piece grants each spell
  • Distinguish between learned vs equipment-granted spells

3. Evolution Paths for Crafting Skills (Low Priority)

  • Add evolution paths for existing crafting skills:
    • effCrafting → Efficient Enchanter
    • durableConstruct → Master Artisan
    • fieldRepair → Field Engineer

System Architecture

Equipment System Flow:
┌─────────────────────────────────────────────────────────────┐
│                    Equipment Instance                        │
│  - typeId: Reference to EquipmentTypeDef                    │
│  - enchantments: AppliedEnchantment[]                       │
│  - usedCapacity / totalCapacity                             │
│  - rarity: Based on total capacity used                     │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                  Enchantment Design                          │
│  1. Select effects from catalogue                           │
│  2. Check capacity constraints                              │
│  3. Pay design time cost                                    │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                   Preparation                                │
│  - Clear existing enchantments                              │
│  - Pay mana cost (equipment capacity × 5)                   │
│  - Wait preparation time (capacity / 5 hours)               │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                   Application                                │
│  - Continuous mana drain during application                 │
│  - Time based on total effect capacity                      │
│  - Can be paused if mana runs low                           │
│  - On completion: Apply enchantments to equipment           │
└─────────────────────────────────────────────────────────────┘

Key Design Decisions

  1. Capacity System: Equipment has capacity that limits total enchantment power. This creates meaningful choices about which effects to apply.

  2. Effect Categories: Each equipment type only accepts certain effect categories, creating specialization:

    • Staves: All spell types + mana + combat + elemental
    • Shields: Defense + utility only
    • Accessories: Small bonuses, no spells
  3. Stacking Effects: Many effects can be stacked multiple times for increased power, with increasing capacity costs.

  4. Rarity from Power: Rarity is automatically calculated from total capacity used, making powerful enchantments visually distinctive.

  5. Time-Gated Application: Enchantment application takes real time with continuous mana drain, preventing instant power spikes.