feat: Implement Phase 5 Quest System (100% complete)

Add YAML-driven quest system with context-aware offering:

Core Implementation:
- Quest data models (Quest, QuestObjective, QuestReward, QuestTriggers)
- QuestService for YAML loading and caching
- QuestEligibilityService with level, location, and probability filtering
- LoreService stub (MockLoreService) ready for Phase 6 Weaviate integration

Quest Content:
- 5 example quests across difficulty tiers (2 easy, 2 medium, 1 hard)
- Quest-centric design: quests define their NPC givers
- Location-based probability weights for natural quest offering

AI Integration:
- Quest offering section in npc_dialogue.j2 template
- Response parser extracts [QUEST_OFFER:quest_id] markers
- AI naturally weaves quest offers into NPC conversations

API Endpoints:
- POST /api/v1/quests/accept - Accept quest offer
- POST /api/v1/quests/decline - Decline quest offer
- POST /api/v1/quests/progress - Update objective progress
- POST /api/v1/quests/complete - Complete quest, claim rewards
- POST /api/v1/quests/abandon - Abandon active quest
- GET /api/v1/characters/{id}/quests - List character quests
- GET /api/v1/quests/{quest_id} - Get quest details

Frontend:
- Quest tracker sidebar with HTMX integration
- Quest offer modal for accept/decline flow
- Quest detail modal for viewing progress
- Combat service integration for kill objective tracking

Testing:
- Unit tests for Quest models and serialization
- Integration tests for full quest lifecycle
- Comprehensive test coverage for eligibility service

Documentation:
- Reorganized docs into /docs/phases/ structure
- Added Phase 5-12 planning documents
- Updated ROADMAP.md with new structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 15:42:55 -06:00
parent e7e329e6ed
commit df26abd207
42 changed files with 8421 additions and 2227 deletions

View File

@@ -81,9 +81,8 @@ dialogue_hooks:
busy: "*keeps hammering* Talk while I work. Time is iron."
quest_complete: "*nods approvingly* Fine work. You've got the heart of a warrior."
quest_giver_for:
- quest_ore_delivery
- quest_equipment_repair
# Note: Quest offerings are now defined in quest YAML files (quest-centric design)
# See /api/app/data/quests/ for quest definitions that reference this NPC
reveals_locations: []

View File

@@ -83,8 +83,8 @@ dialogue_hooks:
busy: "Got thirsty folk to serve. Make it quick."
quest_complete: "*actually smiles* Well done, lad. Drink's on the house."
quest_giver_for:
- quest_cellar_rats
# Note: Quest offerings are now defined in quest YAML files (quest-centric design)
# See /api/app/data/quests/ for quest definitions that reference this NPC
reveals_locations:
- crossville_dungeon

View File

@@ -71,9 +71,8 @@ dialogue_hooks:
busy: "*distracted* I have urgent matters to attend. Perhaps later?"
quest_complete: "*genuine relief* You have done Crossville a great service."
quest_giver_for:
- quest_mayors_request
- quest_bandit_threat
# Note: Quest offerings are now defined in quest YAML files (quest-centric design)
# See /api/app/data/quests/ for quest definitions that reference this NPC
reveals_locations:
- crossville_dungeon

View File

@@ -76,8 +76,8 @@ dialogue_hooks:
busy: "*glances at the door* Not now. Later."
quest_complete: "*grins* You've got potential. Stick around."
quest_giver_for:
- quest_bandit_camp
# Note: Quest offerings are now defined in quest YAML files (quest-centric design)
# See /api/app/data/quests/ for quest definitions that reference this NPC
reveals_locations:
- crossville_forest