Skip to content

[conducted] Implement Rail Mart shop system for buying items #69

@githumps

Description

@githumps

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highCore gameplay features needed for MVPfeatureNew feature implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions