NPC shop implimented

This commit is contained in:
2025-11-29 01:16:46 -06:00
parent 32af625d14
commit 8bd494a52f
17 changed files with 4265 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
## Phase 4C: NPC Shop (Days 15-18)
### Task 5.1: Define Shop Inventory (4 hours)
### Task 5.1: Define Shop Inventory ✅ COMPLETE
**Objective:** Create YAML for shop items
@@ -58,7 +58,7 @@ inventory:
---
### Task 5.2: Shop API Endpoints (4 hours)
### Task 5.2: Shop API Endpoints ✅ COMPLETE
**Objective:** Create shop endpoints
@@ -278,7 +278,7 @@ class ShopService:
---
### Task 5.3: Shop UI (1 day / 8 hours)
### Task 5.3: Shop UI ✅ COMPLETE
**Objective:** Shop browse and purchase interface
@@ -415,7 +415,7 @@ def purchase():
---
### Task 5.4: Transaction Logging (2 hours)
### Task 5.4: Transaction Logging ✅ COMPLETE
**Objective:** Log all shop purchases
@@ -511,3 +511,40 @@ def purchase_item(...):
- Can query transaction history
---
### Task 5.5: Shop UI Integration ✅ COMPLETE
**Objective:** Create shop modal accessible from play session character panel
**Files to Create/Modify:**
- `/public_web/templates/game/partials/shop_modal.html` (CREATE)
- `/public_web/app/views/game_views.py` (ADD routes)
- `/public_web/templates/game/partials/character_panel.html` (ADD button)
- `/public_web/static/css/shop.css` (CREATE)
**Implementation:**
1. **Shop Modal Template** - Follow existing modal patterns (inventory, equipment)
- Header with shop name and gold display
- Tab filters for item categories
- Item grid with purchase buttons
- HTMX-powered purchase flow
2. **View Routes** - Add to game_views.py:
- `GET /play/session/<id>/shop-modal` - Display shop
- `POST /play/session/<id>/shop/purchase` - Buy item (HTMX)
- `POST /play/session/<id>/shop/sell` - Sell item (HTMX)
3. **Character Panel Button** - Add Shop button in quick-actions
**Acceptance Criteria:**
- Shop button visible in character panel
- Modal displays general_store inventory
- Items show name, stats, price with rarity styling
- Tab filters work (All, Weapons, Armor, Consumables)
- Purchase disabled when insufficient gold
- Gold updates after purchase
- Success/error messages displayed
- Modal closes via button, overlay click, or Escape
---