Skip to main content
Euca has a slotted inventory, equipment slots that aggregate stat modifiers, a Gold economy, and an item shop with buy/sell and recipe combining. Items are defined in an ItemRegistry; the shop and recipe logic live in the MOBA layer (euca-moba).
Fully headless. Items, inventory, equipment, and shop all run on the :3917 server.

Items & inventory

# Define an item, then give 2 to entity 1
curl -s -X POST http://localhost:3917/item/define \
  -H 'Content-Type: application/json' \
  -d '{"id":1,"name":"Health Potion","properties":{"cost":50.0,"heal":150.0}}'
# {"ok":true,"message":"Defined item 1: Health Potion"}

curl -s -X POST http://localhost:3917/item/give \
  -H 'Content-Type: application/json' -d '{"entity_id":1,"item_id":1,"count":2}'
# {"ok":true,"message":"Added 2 of item 1"}

curl -s http://localhost:3917/item/list/1
# {"entity_id":1,"inventory":[{"slot":0,"item_id":1,"name":"Health Potion","count":2}],
#  "equipment":[],"stat_modifiers":{}}
  • Inventory — fixed slots holding stackable ItemStacks.
  • EquipmentPOST /item/equip moves an item into a named equipment slot; equipment_stat_system recomputes the entity’s StatModifiers from equipped items’ properties each tick.
  • Economy — a Gold component; the shop checks gold + space on buy and refunds 50% on sell.

Shop

curl -s http://localhost:3917/shop/list      # items with cost + properties
curl -s -X POST http://localhost:3917/shop/buy  -d '{"entity_id":1,"item_id":1}' -H 'Content-Type: application/json'
curl -s -X POST http://localhost:3917/shop/sell -d '{"entity_id":1,"item_id":1}' -H 'Content-Type: application/json'

Endpoints

MethodPathDescription
POST/item/defineRegister an item definition
POST/item/giveAdd items to an inventory
POST/item/equipEquip an item into a slot
GET/item/list/{id}Inventory, equipment, aggregated stat modifiers
POST/shop/buy · /shop/sellBuy / sell (50% refund)
GET/shop/listList shop items with cost

Status

  • ✅ Item definitions, slotted inventory, equipment + stat aggregation, gold economy, buy/sell with gold checks, recipe combining — shipped and headless.

Inventory & shop endpoints

Item, inventory, equipment, and shop endpoints with schemas.