Files
Mana-Loop/docs/task2_crafting_context.md
T
Refactoring Agent fc9e4c8327
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m46s
Add context files for Task 2 sub-agents
2026-04-26 10:46:21 +02:00

45 lines
2.0 KiB
Markdown

# Task 10: Crafting - Prepare/Design Limits - Context
## Task Description
**From task2.md:** Disable "Prepare" for non-enchanted items; limit "Design" to gear types currently owned.
## Current Implementation:
- Crafting system involves:
- `src/components/game/tabs/CraftingTab.tsx` - main crafting UI
- `src/components/game/crafting/EnchantmentPreparer.tsx` - Prepare stage
- `src/lib/game/crafting-slice.ts` - crafting logic
- `currentAction` can be 'design', 'prepare', 'enchant'
- "Prepare" stage is for preparing equipment for enchanting
## What Needs To Be Done:
### Part 1: Disable "Prepare" for non-enchanted items
1. Read `EnchantmentPreparer.tsx` to understand current logic
2. Currently shows "Prepare" option for non-enchanted items
3. **Clarify**: Does this mean:
- Disable the "Prepare" button if the item is NOT enchanted?
- Or disable if there are no enchanted items to disenchant?
4. Make the appropriate changes to disable "Prepare" based on the requirement
### Part 2: Limit "Design" to gear types currently owned
1. Read `CraftingTab.tsx` to understand the "Design" stage
2. Find where gear types are listed for design
3. Filter to only show gear types that the player currently owns (has blueprints for)
4. This might involve checking `store.lootInventory.blueprints` or similar
### Final Steps:
5. Test the changes
6. Commit with message: "Task 2: Crafting - disable Prepare for non-enchanted items, limit Design to owned gear types"
## Key Files:
- `src/components/game/tabs/CraftingTab.tsx` - Design and Prepare stages
- `src/components/game/crafting/EnchantmentPreparer.tsx` - Prepare logic
- `src/lib/game/crafting-slice.ts` - crafting state management
- `src/lib/game/data/equipment.ts` - equipment types definition
## Implementation Notes:
- "Prepare" is the action of preparing equipment for enchanting
- Non-enchanted items might refer to items that don't have enchantments yet
- "Design" stage lets players design enchantments for gear types
- Limit to "owned" gear types = types that the player has blueprints for (in `lootInventory.blueprints`)