Skip to main content
A hero is a named template of stats, attributes, abilities, and a role. You register a HeroDef in the HeroRegistry, then apply it to an entity, which inserts the right components (Health, Mana, Gold, Level, BaseStats, StatGrowth, AbilitySet, EntityRole::Hero). Heroes live in the MOBA layer (euca-moba) but build on the genre-neutral gameplay primitives.
Fully headless. Hero definition and selection run on the :3917 server.

Define and apply a hero

# Register a hero with stats and growth-per-level
curl -s -X POST http://localhost:3917/hero/define \
  -H 'Content-Type: application/json' \
  -d '{"name":"Juggernaut","health":600,"mana":300,"gold":625,"damage":55,"range":1.5,
       "base_stats":{"max_health":600,"attack_damage":55},
       "stat_growth":{"max_health":80,"attack_damage":3}}'
# {"ok":true,"message":"Hero 'Juggernaut' registered"}

curl -s http://localhost:3917/hero/list
# {"heroes":[{"name":"Juggernaut","health":600.0,"mana":300.0,"gold":625,"damage":55.0}]}

# Apply the template to entity 1 (note: field is "hero_name")
curl -s -X POST http://localhost:3917/hero/select \
  -H 'Content-Type: application/json' -d '{"entity_id":1,"hero_name":"Juggernaut"}'
# {"ok":true,"message":"Applied hero template 'Juggernaut' to entity 1"}

curl -s http://localhost:3917/ability/list/1
# {"entity_id":1,"gold":625,"level":{"level":1,"xp":0,"xp_to_next":180},
#  "mana":{"current":300.0,"max":300.0,"regen":5.0},"abilities":[...]}
A HeroDef may also declare abilities (an AbilityDef per slot), primary_attribute, and attribute growth — Dota-style STR/AGI/INT with derived stats. Those surface through the abilities endpoints once applied.

Endpoints

MethodPathDescription
POST/hero/defineRegister a hero definition
POST/hero/selectApply a hero template to an entity (hero_name)
GET/hero/listList registered heroes

Status

  • ✅ Hero definition + registry, template application (stats, mana, gold, level, abilities, role), base/growth stats, the leveling framework — shipped and headless.

Hero endpoints

Define, select, and list endpoints with schemas.