Summary
Implement shop NPC where players can spend money to buy Potions, Super Potions, and Boxcars.
Requirements
- Shop NPC in Rail Mart building (Piston Town)
- Menu UI showing items for sale with prices
- Purchase flow: Select item → Confirm → Deduct money → Add to inventory
- Validation: Cannot buy if insufficient funds
- Validation: Cannot buy if inventory would exceed max (optional cap)
Proposed Prices
- Potion: $300 (heals 20 HP)
- Super Potion: $700 (heals 50 HP)
- Boxcar: $200 (catches wild trains)
Implementation
js/game.js: Add SHOP state
js/ui.js: Add drawShop() method
js/world-maps.js: Add Rail Mart interior with NPC
- NPC interaction triggers SHOP state
Scope
~120 lines total (game.js + ui.js)
Depends On
Testing
- Enter shop
- Navigate items with arrow keys
- Attempt purchase with sufficient funds → success
- Attempt purchase with insufficient funds → blocked
- Verify inventory updated
- Verify money deducted
Summary
Implement shop NPC where players can spend money to buy Potions, Super Potions, and Boxcars.
Requirements
Proposed Prices
Implementation
js/game.js: Add SHOP statejs/ui.js: Add drawShop() methodjs/world-maps.js: Add Rail Mart interior with NPCScope
~120 lines total (game.js + ui.js)
Depends On
Testing