> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eucaengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gameplay & combat

> Health, damage and healing, projectiles, trigger zones, teams, and match scoring — the genre-neutral combat layer. Fully headless.

Euca's combat layer (`euca-gameplay`) is genre-neutral: entities carry `Health`, `Team`, and optional
combat stats; damage and healing flow through events applied each tick; projectiles and trigger zones add
spatial interactions. It's the substrate the [MOBA layer](/systems/moba) and your own rules build on.

<Note>**Fully headless.** All combat runs on the [`:3917` server](/quickstart) — no GPU.</Note>

## What it does

* **Health & death** — `Health { current, max }`; `apply_damage_system` drains health from queued
  `DamageEvent`s each tick; `death_check_system` marks entities `Dead` and emits `DeathEvent`.
* **Damage & healing** — `POST /entity/damage` and `POST /entity/heal` take an `entity_id` and an
  `amount`; the change is queued as an event and applied on the next tick. The internal `DamageEvent`
  model also carries a damage type (`Physical` / `Magical` / `Pure` / `HpRemoval`) used by the ability
  and combat layer, but this HTTP endpoint applies untyped damage.
* **Stats & mitigation** — incoming damage is resolved through `stat_resolution_system` / `combat_math`:
  `Armor` mitigates `Physical` and `MagicResistances` mitigates `Magical` damage before it reaches
  `Health`. `DamageEvent` also carries a free-form `category: String`, so games can classify damage as
  data alongside the fixed `DamageType` enum.
* **More genre-neutral systems** — the same layer ships `stamina_system` (`Stamina`), `weapon_system`
  (`Weapon` — cooldown / ammo / reload / hitscan resolution), and `perception_system` (line-of-sight
  awareness) as opt-in components a game attaches where it needs them.
* **Projectiles** — `POST /projectile/spawn` (direction, speed, damage, lifetime, radius); the projectile
  system moves and collides them.
* **Trigger zones** — `POST /trigger/create` AABB volumes that damage, heal, or teleport on overlap,
  once or repeatedly.
* **Teams & roles** — `Team` and `EntityRole` (`Minion` / `Hero` / `Tower` / `Structure`) drive
  targeting and scoring.

## Example — damage an entity

```bash theme={null}
# Spawn a target with 100 health on team 1
curl -s -X POST http://localhost:3917/spawn \
  -H 'Content-Type: application/json' -d '{"position":[5,0,0],"health":100,"team":1}'
# {"id":1, ...}

curl -s -X POST http://localhost:3917/entity/damage \
  -H 'Content-Type: application/json' -d '{"entity_id":1,"amount":25}'
# {"ok":true,"message":"Applied 25 damage to entity 1"}

curl -s -X POST http://localhost:3917/step -H 'Content-Type: application/json' -d '{"ticks":1}'
curl -s http://localhost:3917/entities/1
# {"id":1,"health":[75.0,100.0], ...}
```

Damage flows through an event applied during the tick — step after injecting it. Drive damage from data
instead of by hand with [rules](/concepts/rules-as-data) (`when health-below:30 do …`).

## Endpoints

| Method | Path                                | Description                                             |
| ------ | ----------------------------------- | ------------------------------------------------------- |
| `POST` | `/entity/damage`                    | Deal damage to an entity                                |
| `POST` | `/entity/heal`                      | Heal an entity                                          |
| `POST` | `/projectile/spawn`                 | Spawn a moving, damaging projectile                     |
| `POST` | `/trigger/create`                   | Create an AABB trigger zone (damage/heal/teleport)      |
| `POST` | `/game/create`, `GET` `/game/state` | Match lifecycle (see [Simulation](/systems/simulation)) |

## Status

* **Shipped** — health/death, damage and healing events, projectiles, trigger zones, teams, roles, and
  scoring. All headless.
* The richer ability and crowd-control layer is on [Abilities & status effects](/systems/abilities-and-status-effects).

<Card title="Gameplay endpoints" icon="burst" href="/api-reference/introduction" horizontal>
  Damage, heal, projectile, and trigger endpoints with schemas.
</Card>
