🧟♂️ Enemy Schema
Defines enemy types, behaviors, and interactions with the player or world.
✅ Field Rules & Accepted Values
Field | Type | Required | Notes |
---|---|---|---|
id | string | ✅ Yes | Unique ID (e.g., 'slime_01') |
name | string | ✅ Yes | UI display name |
health | number | ✅ Yes | Total HP |
damage | number | ✅ Yes | Damage dealt to player |
speed | number | ❌ No | Default is 1.0 |
sprite | string | ✅ Yes | Path to sprite asset |
aiType | string | ✅ Yes | Built-in or custom AI logic |
abilities | string[] | ❌ No | Ability IDs used by enemy |
levelId | number | ❌ No | Optional level restriction |
boss | boolean | ❌ No | Enables boss logic and UI |
phases | number | ❌ No | Number of phases (boss only) |
phaseTriggers | string[] | ❌ No | E.g., health_below_50, time_elapsed_30 |
spawnIf | object | ❌ No | Conditional spawn logic |
statusImmunities | string[] | ❌ No | E.g., ['freeze', 'poison'] |
onDeath | string | ❌ No | Trigger/event ID on death |
onHit | string | ❌ No | Trigger/event on hit |
onAttack | string | ❌ No | Trigger/event on attack |
sound | object | ❌ No | Sound effects for actions |
drops | string[] | ❌ No | Token/item IDs dropped on death |