Script API notes are generated from docs/MODDING_API.md and related public modding documentation.
Hook Surface
- `OnRunStart`
- `OnWaveStart(wave)`
- `OnEnemySpawn(enemyId, posX, posY)`
- `OnEnemyKilled(enemyId, killerId)`
- `OnPlayerDamaged(amount, source)`
- `OnBossSpawn(id)`
- `OnPickupCollected(pickupId)`
Runtime Guarantees
- Script hook dispatch is isolated from game stability.
- Script host is data-driven and restricted (no unrestricted file/network API exposed).
- Hook dispatch remains deterministic relative to runtime events.
Notes
- Declare script files in `mod.json` under `entrypoints`.
- Missing entrypoint files are reported by `WardenModKit validate`.
- Entrypoints are JSON hook files with a `hooks` object. Example:
Supported Script Actions (current build)
- `add_copper` (`amount` int)
- `set_wave_clear_bonus_multiplier` (`multiplier` float, clamped `0.0..10.0`)
- `multiply_wave_clear_bonus_multiplier` (`factor` float, clamped `0.0..10.0`)
- `spawn_enemy` (`enemyId` optional, `count` int, `boss` bool, `elite`/`markAsElite` bool)