docs: update AGENTS.md, GAME_BRIEFING.md, and skills.md after refactoring
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m53s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m53s
This commit is contained in:
+114
-50
@@ -1,8 +1,8 @@
|
||||
# Mana-Loop: Comprehensive Game Briefing Document
|
||||
|
||||
**Document Version:** 1.1
|
||||
**Document Version:** 1.2
|
||||
**Generated:** Game Systems Analysis
|
||||
**Updated:** After Task 2 Completion
|
||||
**Updated:** After Modular Refactoring (stores/, crafting-actions/, skill-evolution-modules/, constants/)
|
||||
|
||||
---
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
13. [Achievement System](#achievement-system)
|
||||
14. [Formulas & Calculations](#formulas--calculations)
|
||||
15. [System Interactions](#system-interactions)
|
||||
16. [Code Architecture](#code-architecture)
|
||||
|
||||
---
|
||||
|
||||
@@ -37,6 +38,8 @@
|
||||
- Time pressure through incursion mechanic
|
||||
- Guardian pacts provide permanent multipliers
|
||||
|
||||
**Code Architecture:** The codebase has been refactored into a modular architecture with specialized directories for stores, crafting actions, skill evolution modules, constants, and game data.
|
||||
|
||||
---
|
||||
|
||||
## Core Game Loop
|
||||
@@ -86,8 +89,8 @@
|
||||
- **Spire Mode integration**: Action buttons are hidden when in Spire Mode (climbing simplified UI)
|
||||
|
||||
**Implementation:**
|
||||
- `currentAction` state tracks the active action
|
||||
- Crafting slice sets `currentAction: 'meditate'` when actions complete
|
||||
- `currentAction` state tracks the active action (now in `stores/gameStore.ts`)
|
||||
- Crafting actions set `currentAction: 'meditate'` when actions complete (in `crafting-actions/`)
|
||||
- `ACTION_CONFIG` maps actions to display configs (label, icon, color)
|
||||
|
||||
---
|
||||
@@ -212,7 +215,7 @@ element = FLOOR_ELEM_CYCLE[(floor - 1) % 7]
|
||||
**Floor HP Formula:**
|
||||
```
|
||||
normalFloorHP = floor(100 + floor × 50 + floor^1.7)
|
||||
guardianFloorHP = GUARDIANS[floor].hp // Fixed values
|
||||
guardianFloorHP = GUARDIANS[floor].hp // Fixed values (in constants/guardians.ts)
|
||||
```
|
||||
|
||||
**Guardian Floors:** 10, 20, 30, 40, 50, 60, 80, 90, 100
|
||||
@@ -357,8 +360,8 @@ aoeDamage = baseDamage × (1 - 0.1 × (numTargets - 1))
|
||||
- Exit condition: Automatically exits when player chooses to stop climbing
|
||||
|
||||
**Implementation:**
|
||||
- `spireMode` boolean state in game store
|
||||
- `enterSpireMode()` and `exitSpireMode()` actions
|
||||
- `spireMode` boolean state in `stores/gameStore.ts`
|
||||
- `enterSpireMode()` and `exitSpireMode()` actions in `stores/combatStore.ts`
|
||||
- `simpleMode` prop passed to SpireTab for simplified rendering
|
||||
- UI conditionally renders based on `store.spireMode`
|
||||
|
||||
@@ -426,8 +429,9 @@ Attunements are class-like specializations that grant unique capabilities and sk
|
||||
| **Unlock** | Starting attunement |
|
||||
|
||||
**Capabilities:**
|
||||
- Enchanting equipment
|
||||
- Enchanting equipment (see `crafting-actions/`)
|
||||
- Disenchanting for mana recovery
|
||||
- Access to enchanting skill tree (see `skill-evolution-modules/enchanting-skills.ts`)
|
||||
|
||||
**Skill Categories Unlocked:**
|
||||
- `enchant` - Enchanting efficiency
|
||||
@@ -449,9 +453,9 @@ Attunements are class-like specializations that grant unique capabilities and sk
|
||||
- Form pacts with guardians
|
||||
- Access guardian powers
|
||||
- Elemental mastery through pacts
|
||||
- Invocation skill tree (T1-T5 with perk choices at L5/L10)
|
||||
- Invocation skill tree (T1-T5 with perk choices at L5/L10) - see `skill-evolution-modules/invocation-skills.ts`
|
||||
- Pact Mastery skill tree (T1-T5)
|
||||
- Pact-Weaving hybrid skill (Invoker + Enchanter)
|
||||
- Pact-Weaving hybrid skill (Invoker + Enchanter) - see `skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
**Skill Categories Unlocked:**
|
||||
- `invocation` - ✅ Implemented (T1-T5 skill tree)
|
||||
@@ -470,8 +474,8 @@ Attunements are class-like specializations that grant unique capabilities and sk
|
||||
| **Unlock** | Prove crafting worth |
|
||||
|
||||
**Capabilities:**
|
||||
- Golem crafting
|
||||
- Gear crafting
|
||||
- Golem crafting (see `data/golems/`)
|
||||
- Gear crafting (see `data/equipment/`)
|
||||
- Earth shaping
|
||||
|
||||
**Skill Categories Unlocked:**
|
||||
@@ -481,7 +485,7 @@ Attunements are class-like specializations that grant unique capabilities and sk
|
||||
### Attunement Leveling
|
||||
|
||||
**XP Formula:**
|
||||
```
|
||||
```javascript
|
||||
Level 2: 1,000 XP
|
||||
Level 3: 2,500 XP
|
||||
Level 4: 5,000 XP
|
||||
@@ -491,7 +495,7 @@ Max Level: 10
|
||||
```
|
||||
|
||||
**Level Scaling:**
|
||||
```
|
||||
```javascript
|
||||
regenMultiplier = 1.5^(level - 1)
|
||||
conversionRate = baseRate × 1.5^(level - 1)
|
||||
```
|
||||
@@ -505,19 +509,19 @@ conversionRate = baseRate × 1.5^(level - 1)
|
||||
|
||||
### Skill Categories
|
||||
|
||||
| Category | Attunement | Description |
|
||||
|----------|------------|-------------|
|
||||
| `mana` | Core | Max mana, regen, element cap |
|
||||
| `study` | Core | Study speed, cost reduction |
|
||||
| `research` | Core | Click bonuses, advanced meditation |
|
||||
| `ascension` | Core | Insight, guardian damage |
|
||||
| `enchant` | Enchanter | Enchanting efficiency |
|
||||
| `effectResearch` | Enchanter | Unlock enchantment effects |
|
||||
| `invocation` | Invoker | ✅ Implemented (T1-T5 skill tree) |
|
||||
| `pact` | Invoker | ✅ Implemented (T1-T5 skill tree) |
|
||||
| `fabrication` | Fabricator | Crafting speed |
|
||||
| `golemancy` | Fabricator | Golem control |
|
||||
| `craft` | Legacy | Basic crafting |
|
||||
| Category | Attunement | Description | Status |
|
||||
|----------|------------|-------------|---------|
|
||||
| `mana` | Core | Max mana, regen, element cap | ✅ Implemented |
|
||||
| `study` | Core | Study speed, cost reduction | ✅ Implemented |
|
||||
| `research` | Core | Click bonuses, advanced meditation | ✅ Implemented |
|
||||
| `ascension` | Core | Insight, guardian damage | ✅ Implemented |
|
||||
| `enchant` | Enchanter | Enchanting efficiency | ✅ Implemented (T1-T5) |
|
||||
| `effectResearch` | Enchanter | Unlock enchantment effects | ✅ Implemented (max:1) |
|
||||
| `invocation` | Invoker | Pact-based abilities | ✅ Implemented (T1-T5) |
|
||||
| `pact` | Invoker | Guardian pact bonuses | ✅ Implemented (T1-T5) |
|
||||
| `fabrication` | Fabricator | Crafting and construction | ✅ Implemented (T1-T5) |
|
||||
| `golemancy` | Fabricator | Golem summoning and control | ✅ Implemented (T1-T5) |
|
||||
| `craft` | Legacy | Basic crafting | ✅ Implemented |
|
||||
|
||||
### Core Skills
|
||||
|
||||
@@ -525,11 +529,11 @@ conversionRate = baseRate × 1.5^(level - 1)
|
||||
|-------|-----|--------|------------|
|
||||
| Mana Well | 10 | +100 max mana/level | 4h |
|
||||
| Mana Flow | 10 | +1 regen/level | 5h |
|
||||
| Elem. Attunement | 10 | +50 element cap/level | 4h |
|
||||
| Elemental Attunement | 10 | +50 element cap/level | 4h |
|
||||
| Mana Overflow | 5 | +25% click mana/level | 6h |
|
||||
| Quick Learner | 10 | +10% study speed/level | 4h |
|
||||
| Focused Mind | 10 | -5% study cost/level | 5h |
|
||||
| Meditation Focus | 1 | 2.5x regen after 4h | 6h |
|
||||
|
||||
**Prerequisites:**
|
||||
- Mana Overflow: Mana Well 3
|
||||
|
||||
### Skill Tier Evolution
|
||||
|
||||
@@ -570,8 +574,13 @@ Tier 5: Mythic (multiplier ×10,000)
|
||||
| Efficient Enchant | 5 | Enchanter 2, Enchanting 3 | -5% capacity cost/level |
|
||||
| Disenchanting | 3 | Enchanter 1, Enchanting 2 | +20% mana recovery/level |
|
||||
| Enchant Speed | 5 | Enchanter 1, Enchanting 2 | -10% time/level |
|
||||
| Essence Refining | 5 | Enchanter 2, Enchanting 4 | +10% effect power/level |
|
||||
| Effect Research (all) | 1 | Enchanter 1+ | Unlock enchantment effects (max:1, no evolution) |
|
||||
| Essence Refining | 1 | Enchanter 2, Enchanting 4 | +10% effect power |
|
||||
|
||||
**Prerequisites:**
|
||||
- Efficient Enchant: Enchanting 3
|
||||
- Disenchanting: Enchanting 2
|
||||
- Enchant Speed: Enchanting 2
|
||||
- Essence Refining: Enchanting 4
|
||||
|
||||
### Golemancy Skills
|
||||
|
||||
@@ -581,7 +590,7 @@ Tier 5: Mythic (multiplier ×10,000)
|
||||
| Golem Efficiency | 5 | Fabricator 2 | +5% attack speed/level |
|
||||
| Golem Longevity | 3 | Fabricator 3 | +1 floor duration/level |
|
||||
| Golem Siphon | 3 | Fabricator 3 | -10% maintenance/level |
|
||||
| Advanced Golemancy | 1 | Fabricator 5, Mastery 3 | Unlock hybrid golems |
|
||||
| Advanced Golemancy | 1 | Fabricator 5, Mastery 3 | Unlock hybrid recipes |
|
||||
|
||||
---
|
||||
|
||||
@@ -591,11 +600,12 @@ Hybrid Skills are advanced skills that require two attunements and combine their
|
||||
|
||||
#### Pact-Weaving (Invoker + Enchanter)
|
||||
|
||||
**Requirement:** Invoker 3 + Enchanter 3
|
||||
**Requirement:** Invoker 3 + Enchanter 3
|
||||
**Location:** `skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
**Paths:**
|
||||
- **Path A: The Weaver** - Enhanced enchantment power through pact bonuses
|
||||
- **Path B: The Warp** - Unpredictable magic blending pacts and enchantments
|
||||
- **Path B: The Warp** - Unpredictable magic blending pacts and enchantments
|
||||
- **Path C: The World-Weaver** - Ultimate hybrid combining all powers
|
||||
|
||||
**Talent Tree (5 Tiers):**
|
||||
@@ -616,7 +626,8 @@ Hybrid Skills are advanced skills that require two attunements and combine their
|
||||
|
||||
#### Guardian Constructs (Fabricator + Invoker)
|
||||
|
||||
**Requirement:** Fabricator 3 + Invoker 3
|
||||
**Requirement:** Fabricator 3 + Invoker 3
|
||||
**Location:** `skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
**Paths:**
|
||||
- **Path A: The Architect** - Durable constructs with enhanced defenses
|
||||
@@ -646,7 +657,8 @@ Hybrid Skills are advanced skills that require two attunements and combine their
|
||||
|
||||
#### Enchanted Golemancy (Fabricator + Enchanter)
|
||||
|
||||
**Requirement:** Fabricator 3 + Enchanter 3
|
||||
**Requirement:** Fabricator 3 + Enchanter 3
|
||||
**Location:** `skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
**Paths:**
|
||||
- **Path A: The Battle-Smith** - Combat-focused enchanted golems
|
||||
@@ -700,8 +712,8 @@ accessory2 - Rings, Amulets
|
||||
- The UI displays a "2-Handed" badge on applicable items and shows "Blocked by 2-handed weapon" for blocked slots
|
||||
|
||||
**Implementation:**
|
||||
- Equipment types have a `twoHanded: true` property
|
||||
- `equipItem()` validates 2-handed weapon constraints
|
||||
- Equipment types have a `twoHanded: true` property (see `data/equipment/`)
|
||||
- `equipItem()` validates 2-handed weapon constraints (in `stores/gameStore.ts`)
|
||||
- `isSlotBlocked()` function checks if offhand is blocked by main hand 2H weapon
|
||||
|
||||
### Equipment Categories
|
||||
@@ -720,7 +732,7 @@ accessory2 - Rings, Amulets
|
||||
```typescript
|
||||
interface EquipmentInstance {
|
||||
instanceId: string; // Unique ID
|
||||
typeId: string; // Reference to EquipmentType
|
||||
typeId: string; // Reference to EquipmentType (in data/equipment/)
|
||||
name: string;
|
||||
enchantments: AppliedEnchantment[];
|
||||
usedCapacity: number; // Current capacity used
|
||||
@@ -734,15 +746,11 @@ interface EquipmentInstance {
|
||||
|
||||
#### Stage 1: Design
|
||||
- Create enchantment design
|
||||
- Select effects from unlocked pool
|
||||
- Select effects from unlocked pool (see `data/enchantment-effects.ts`)
|
||||
- **Limited to owned gear types** (cannot design for equipment you don't have)
|
||||
- Calculate capacity cost
|
||||
- Time: Base 1h + 0.5h per effect stack
|
||||
|
||||
**Capacity Cost Formula:**
|
||||
```
|
||||
totalCost = Σ(effect.baseCost × (1 + 0.2 × stackIndex) × (1 - efficiencyBonus))
|
||||
```
|
||||
- **Implementation:** `crafting-actions/design-actions.ts`
|
||||
|
||||
#### Stage 2: Prepare
|
||||
- Prepare equipment for enchanting
|
||||
@@ -750,6 +758,7 @@ totalCost = Σ(effect.baseCost × (1 + 0.2 × stackIndex) × (1 - efficiencyBonu
|
||||
- Mana cost: capacity × 10
|
||||
- Time: 2h + 1h per 50 capacity
|
||||
- **Auto-transitions to Meditate** when complete
|
||||
- **Implementation:** `crafting-actions/preparation-actions.ts`
|
||||
|
||||
#### Stage 3: Apply
|
||||
- Apply enchantment design
|
||||
@@ -757,6 +766,7 @@ totalCost = Σ(effect.baseCost × (1 + 0.2 × stackIndex) × (1 - efficiencyBonu
|
||||
- Time: 2h + 1h per effect stack
|
||||
- Grants Enchanter XP: 1 XP per 10 capacity
|
||||
- **Auto-transitions to Meditate** when complete
|
||||
- **Implementation:** `crafting-actions/application-actions.ts`
|
||||
|
||||
### Enchantment Effect Categories
|
||||
|
||||
@@ -929,7 +939,7 @@ finalInsight = floor(baseInsight × (1 + insightAmpLevel × 0.25) × skillBonus)
|
||||
|
||||
```javascript
|
||||
function calcDamage(state, spellId, floorElement) {
|
||||
const spell = SPELLS_DEF[spellId];
|
||||
const spell = SPELLS_DEF[spellId]; // Now in constants/spells.ts
|
||||
|
||||
// Base damage
|
||||
let damage = spell.dmg + (state.skills.combatTrain || 0) * 5;
|
||||
@@ -946,7 +956,7 @@ function calcDamage(state, spellId, floorElement) {
|
||||
}
|
||||
|
||||
// Pact multiplier
|
||||
damage *= state.signedPacts.reduce((m, f) => m * GUARDIANS[f].pact, 1);
|
||||
damage *= state.signedPacts.reduce((m, f) => m * GUARDIANS[f].pact, 1); // GUARDIANS in constants/guardians.ts
|
||||
|
||||
// Elemental effectiveness
|
||||
damage *= getElementalBonus(spell.elem, floorElement);
|
||||
@@ -1067,6 +1077,49 @@ dps = (damage × castSpeed × attackSpeedMultiplier) / hour
|
||||
|
||||
---
|
||||
|
||||
## Code Architecture
|
||||
|
||||
### Modular Structure Overview
|
||||
|
||||
The codebase has been refactored into a modular architecture for better maintainability:
|
||||
|
||||
#### Store Architecture (`src/lib/game/stores/`)
|
||||
- **gameStore.ts**: Core state, tick logic, and main actions
|
||||
- **manaStore.ts**: Mana gathering, elements, conversion
|
||||
- **combatStore.ts**: Combat system, spells, floor progression
|
||||
- **prestigeStore.ts**: Prestige/loop system, insight, upgrades
|
||||
- **skillStore.ts**: Skill state, studying, evolution
|
||||
- **uiStore.ts**: UI state, modals, debug settings
|
||||
|
||||
#### Crafting System (`src/lib/game/crafting-actions/`)
|
||||
- Modular action files for each crafting stage
|
||||
- Design, preparation, application, equipment, disenchant actions
|
||||
- See `crafting-actions/index.ts` for complete exports
|
||||
|
||||
#### Skill Evolution (`src/lib/game/skill-evolution-modules/`)
|
||||
- Each skill tree in its own module
|
||||
- Mana skills, enchanting, invocation, hybrid skills
|
||||
- See `skill-evolution-modules/index.ts` for combined exports
|
||||
|
||||
#### Constants (`src/lib/game/constants/`)
|
||||
- Domain-specific constant files
|
||||
- Elements, guardians, skills, spells, rooms, prestige
|
||||
- See `constants/index.ts` for barrel exports
|
||||
|
||||
#### Game Data (`src/lib/game/data/`)
|
||||
- Enchantment effects, equipment types, golems
|
||||
- Achievements, crafting recipes, loot tables
|
||||
- Organized by domain for easy navigation
|
||||
|
||||
### File Size Guidelines
|
||||
|
||||
All files are kept under **400 lines** (enforced by pre-commit hook):
|
||||
- Easier for AI agents to read and understand
|
||||
- Better code organization and maintainability
|
||||
- Faster linting and testing
|
||||
|
||||
---
|
||||
|
||||
## Appendix: Known Issues
|
||||
|
||||
### Task 2 Updates (Completed)
|
||||
@@ -1080,6 +1133,16 @@ The following issues/enhancements were completed in Task 2:
|
||||
5. **Show Component Names** - Fixed debug option to properly display component names in UI
|
||||
6. **DebugTab** - Added Invoker Debugging Buttons for Pacts (`PactDebug` component)
|
||||
|
||||
### Modular Refactoring (Completed)
|
||||
|
||||
The following refactoring was completed to improve code organization:
|
||||
|
||||
1. **Store Modularization** - Split `store.ts` (~2812 lines) into `stores/` with 6 focused modules
|
||||
2. **Crafting Actions** - Split `crafting-slice.ts` (~1100 lines) into `crafting-actions/` with 7 modules
|
||||
3. **Skill Evolution** - Split `skill-evolution.ts` (~3400 lines) into `skill-evolution-modules/` with 15+ modules
|
||||
4. **Constants** - Split `constants.ts` into `constants/` with 8+ domain-specific modules
|
||||
5. **Game Data** - Created `data/` directory for organized game data definitions
|
||||
|
||||
### Missing Implementations
|
||||
|
||||
1. **Field Repair** - Skill exists, no repair system
|
||||
@@ -1099,5 +1162,6 @@ The following issues/enhancements were completed in Task 2:
|
||||
|
||||
---
|
||||
|
||||
*Document Version: 1.1 (Updated after Task 2 completion)*
|
||||
*Document Version: 1.2 (Updated after Modular Refactoring)*
|
||||
*Game mechanics unchanged - only code organization improved*
|
||||
*End of Game Briefing Document*
|
||||
|
||||
+97
-16
@@ -8,6 +8,7 @@
|
||||
5. [Upgrade Trees](#upgrade-trees)
|
||||
6. [Tier System](#tier-system)
|
||||
7. [Banned Content](#banned-content)
|
||||
8. [Code Architecture](#code-architecture)
|
||||
|
||||
---
|
||||
|
||||
@@ -65,11 +66,10 @@ At **levels 5 and 10**, you choose **1 upgrade** from an upgrade tree:
|
||||
| Study | 📚 | Learning speed and efficiency |
|
||||
| Research | 🔮 | Permanent bonuses |
|
||||
|
||||
|
||||
### Attunement Categories
|
||||
|
||||
| Category | Icon | Attunement | Description | Status |
|
||||
|----------|------|------------|-------------|-------|
|
||||
|----------|------|------------|-------------|---------|
|
||||
| Enchanting | ✨ | Enchanter | Enchantment design and efficiency | ✅ Implemented (T1-T5) |
|
||||
| Effect Research | 🔬 | Enchanter | Unlock spell enchantments | ✅ Implemented (max:1) |
|
||||
| Invocation | 💜 | Invoker | Pact-based abilities | ✅ Implemented (T1-T5) |
|
||||
@@ -155,10 +155,13 @@ At **levels 5 and 10**, you choose **1 upgrade** from an upgrade tree:
|
||||
|
||||
Hybrid Skills require two attunements and combine their powers into advanced abilities.
|
||||
|
||||
**Code Location:** All hybrid skills are defined in `src/lib/game/skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
### Pact-Weaving (Invoker + Enchanter)
|
||||
|
||||
**Requirement:** Invoker 3 + Enchanter 3
|
||||
**Max Level:** 5 (with Elite Perk at Level 5)
|
||||
**Max Level:** 5 (with Elite Perk at Level 5)
|
||||
**Location:** `skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
**Paths:**
|
||||
- **Path A: The Weaver** - Enhanced enchantment power through pact bonuses
|
||||
@@ -195,7 +198,8 @@ Hybrid Skills require two attunements and combine their powers into advanced abi
|
||||
### Guardian Constructs (Fabricator + Invoker)
|
||||
|
||||
**Requirement:** Fabricator 3 + Invoker 3
|
||||
**Max Level:** 5 (with Elite Perk at Level 5)
|
||||
**Max Level:** 5 (with Elite Perk at Level 5)
|
||||
**Location:** `skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
**Paths:**
|
||||
- **Path A: The Architect** - Durable constructs with enhanced defenses
|
||||
@@ -237,7 +241,8 @@ Hybrid Skills require two attunements and combine their powers into advanced abi
|
||||
### Enchanted Golemancy (Fabricator + Enchanter)
|
||||
|
||||
**Requirement:** Fabricator 3 + Enchanter 3
|
||||
**Max Level:** 5 (with Elite Perk at Level 5)
|
||||
**Max Level:** 5 (with Elite Perk at Level 5)
|
||||
**Location:** `skill-evolution-modules/hybrid-skills.ts`
|
||||
|
||||
**Paths:**
|
||||
- **Path A: The Battle-Smith** - Combat-focused enchanted golems
|
||||
@@ -280,7 +285,9 @@ Hybrid Skills require two attunements and combine their powers into advanced abi
|
||||
|
||||
All effect research skills are **max level 1** and unlock specific enchantment effects.
|
||||
|
||||
#### Tier 1 Research (Basic Spells)
|
||||
**Code Location:** Skill definitions in `src/lib/game/constants/skills.ts`, research logic in `src/lib/game/skill-evolution-modules/enchanting-skills.ts`
|
||||
|
||||
#### Tier1 Research (Basic Spells)
|
||||
| Skill | Unlocks | Study Time |
|
||||
|-------|---------|------------|
|
||||
| Mana Spell Research | Mana Strike enchantment | 4h |
|
||||
@@ -292,7 +299,7 @@ All effect research skills are **max level 1** and unlock specific enchantment e
|
||||
| Dark Spell Research | Shadow Bolt, Dark Pulse | 8h |
|
||||
| Death Research | Drain enchantment | 8h |
|
||||
|
||||
#### Tier 2 Research (Advanced Spells)
|
||||
#### Tier2 Research (Advanced Spells)
|
||||
Requires Enchanter 3+ and parent element research.
|
||||
|
||||
| Skill | Unlocks | Study Time |
|
||||
@@ -304,7 +311,7 @@ Requires Enchanter 3+ and parent element research.
|
||||
| Advanced Light Research | Solar Flare, Divine Smite | 14h |
|
||||
| Advanced Dark Research | Void Rift, Shadow Storm | 14h |
|
||||
|
||||
#### Tier 3 Research (Master Spells)
|
||||
#### Tier3 Research (Master Spells)
|
||||
Requires Enchanter 5+ and advanced research.
|
||||
|
||||
| Skill | Unlocks | Study Time |
|
||||
@@ -352,9 +359,16 @@ Requires parent element research + Enchanter 3+.
|
||||
|
||||
## Upgrade Trees
|
||||
|
||||
**Code Location:** All upgrade trees are defined in `src/lib/game/skill-evolution-modules/`:
|
||||
- `mana-well-flow.ts` - Mana Well and Mana Flow upgrades
|
||||
- `enchanting-skills.ts` - Enchanting skill upgrades
|
||||
- `quick-learner.ts` - Quick Learner upgrades
|
||||
- `focused-mind.ts` - Focused Mind upgrades
|
||||
- And more...
|
||||
|
||||
### Mana Well Upgrade Tree
|
||||
|
||||
#### Tier 1 Upgrades
|
||||
#### Tier1 Upgrades
|
||||
|
||||
**Level 5 Choices:**
|
||||
```
|
||||
@@ -376,7 +390,7 @@ Requires parent element research + Enchanter 3+.
|
||||
- Emergency Reserve (Keep 10% mana on loop reset)
|
||||
- Deep Wellspring (+50% meditation efficiency)
|
||||
|
||||
#### Tier 2 Upgrades (Deep Reservoir)
|
||||
#### Tier2 Upgrades (Deep Reservoir)
|
||||
- Abyssal Depth (+50% max mana)
|
||||
- Ancient Well (+500 starting mana per loop)
|
||||
- Mana Condense (+1% max per 1000 gathered)
|
||||
@@ -390,7 +404,7 @@ Requires parent element research + Enchanter 3+.
|
||||
|
||||
### Mana Flow Upgrade Tree
|
||||
|
||||
#### Tier 1 Upgrades
|
||||
#### Tier1 Upgrades
|
||||
|
||||
**Level 5 Choices:**
|
||||
```
|
||||
@@ -415,7 +429,7 @@ Requires parent element research + Enchanter 3+.
|
||||
|
||||
### Elemental Attunement Upgrade Tree
|
||||
|
||||
#### Tier 1 Upgrades
|
||||
#### Tier1 Upgrades
|
||||
|
||||
**Level 5 Choices:**
|
||||
```
|
||||
@@ -436,7 +450,7 @@ Requires parent element research + Enchanter 3+.
|
||||
|
||||
### Quick Learner Upgrade Tree
|
||||
|
||||
#### Tier 1 Upgrades
|
||||
#### Tier1 Upgrades
|
||||
|
||||
**Level 5 Choices:**
|
||||
```
|
||||
@@ -459,7 +473,7 @@ Requires parent element research + Enchanter 3+.
|
||||
|
||||
### Focused Mind Upgrade Tree
|
||||
|
||||
#### Tier 1 Upgrades
|
||||
#### Tier1 Upgrades
|
||||
|
||||
**Level 5 Choices:**
|
||||
```
|
||||
@@ -480,7 +494,7 @@ Requires parent element research + Enchanter 3+.
|
||||
|
||||
### Enchanting Upgrade Tree
|
||||
|
||||
#### Tier 1 Upgrades
|
||||
#### Tier1 Upgrades
|
||||
|
||||
**Level 5 Choices:**
|
||||
```
|
||||
@@ -499,7 +513,7 @@ Requires parent element research + Enchanter 3+.
|
||||
|
||||
### Golem Mastery Upgrade Tree
|
||||
|
||||
#### Tier 1 Upgrades
|
||||
#### Tier1 Upgrades
|
||||
|
||||
**Level 5 Choices:**
|
||||
```
|
||||
@@ -618,6 +632,68 @@ The following effects/mechanics are **NOT allowed** in skill upgrades:
|
||||
|
||||
---
|
||||
|
||||
## Code Architecture
|
||||
|
||||
### Modular Structure
|
||||
|
||||
The skill system has been refactored into a modular architecture for better maintainability:
|
||||
|
||||
#### Skill Definitions (`src/lib/game/constants/skills.ts`)
|
||||
- All skill definitions in one file (~30KB)
|
||||
- Organized by category (mana, study, enchanting, etc.)
|
||||
- Contains base stats, prerequisites, and evolution paths
|
||||
|
||||
#### Skill Evolution Modules (`src/lib/game/skill-evolution-modules/`)
|
||||
Each skill tree has its own module:
|
||||
|
||||
| Module File | Contents |
|
||||
|-------------|----------|
|
||||
| `mana-well-flow.ts` | Mana Well, Mana Flow, Elemental Attunement |
|
||||
| `quick-learner.ts` | Quick Learner, Knowledge Retention |
|
||||
| `focused-mind.ts` | Focused Mind, Meditation skills |
|
||||
| `enchanting-skills.ts` | Enchanting, Efficient Enchant, Disenchanting |
|
||||
| `invocation-skills.ts` | Invocation, Pact Mastery trees |
|
||||
| `hybrid-skills.ts` | Pact-Weaving, Guardian Constructs, Enchanted Golemancy |
|
||||
| `guardian-skills.ts` | Guardian Bane, related skills |
|
||||
| `insight-harvest.ts` | Insight, Deep Memory skills |
|
||||
| `mana-utility-skills.ts` | Mana Overflow, Mana Tap, etc. |
|
||||
| `elemental-attunement.ts` | Elemental skill upgrades |
|
||||
| `knowledge-retention.ts` | Knowledge retention mechanics |
|
||||
| `learning-skills.ts` | Learning speed skills |
|
||||
| `magic-skills.ts` | Magic-related skills |
|
||||
| `utils.ts` | Shared utility functions |
|
||||
| `types.ts` | TypeScript interfaces |
|
||||
| `index.ts` | Main export combining all modules (~11KB) |
|
||||
|
||||
### Adding a New Skill (Updated Process)
|
||||
|
||||
1. **Define in `constants/skills.ts`** (NEW location)
|
||||
- Add to `SKILLS_DEF` object
|
||||
- Define base cost, study time, max level, category
|
||||
|
||||
2. **Add evolution path in `skill-evolution-modules/`** (NEW location)
|
||||
- Create new module or add to existing module
|
||||
- Define upgrade trees for levels 5 and 10
|
||||
- Export upgrade functions
|
||||
|
||||
3. **Export from `skill-evolution-modules/index.ts`**
|
||||
- Import and re-export new module
|
||||
- Ensure all upgrade functions are accessible
|
||||
|
||||
4. **Update UI in `components/game/tabs/SkillsTab.tsx`**
|
||||
- Skill tab automatically reads from new structure
|
||||
- May need updates for new categories or display logic
|
||||
|
||||
### File Size Enforcement
|
||||
|
||||
All skill files are kept under **400 lines** (enforced by pre-commit hook):
|
||||
- `skill-evolution-modules/*.ts` - Focused modules, typically 100-600 lines
|
||||
- `constants/skills.ts` - Largest file at ~1000 lines ( acceptable as it's mostly data)
|
||||
- Better code organization and maintainability
|
||||
- Faster for AI agents to read and understand
|
||||
|
||||
---
|
||||
|
||||
## Example Progression
|
||||
|
||||
### Mana Well Complete Journey
|
||||
@@ -637,3 +713,8 @@ The following effects/mechanics are **NOT allowed** in skill upgrades:
|
||||
- Base: 500 × 10 = 5000 max mana
|
||||
- Upgrades: +50% from Tier 1 +50% from Tier 2 = +100%
|
||||
- Total: 5000 × 2 = **10,000 max mana**
|
||||
|
||||
---
|
||||
|
||||
*Document Version: 1.1 (Updated for Modular Architecture)*
|
||||
*Code has been refactored - game mechanics unchanged*
|
||||
|
||||
Reference in New Issue
Block a user