Task #25: arrivals wait for a free character

A planned ground arrival whose type has no free character used to be
skipped (spawn_skipped) and lost. Now it waits and comes in as soon as
one frees, without holding back other types; any still waiting at
sunrise are dropped and counted.

- EnemySystem.can_spawn(type): room and, on foot, a free character
  (EnemyCharacters.has_free; a corpse counts), no side effects.
- WaveDirector.step: due arrivals that can't spawn go to a per-type
  FIFO; waiting ones are admitted first each tick. waited / dropped
  counters next to spawned, reset at nightfall; waiting() for tests.
- GameConfig.character_pool {"thief": 48, "breaker": 20} replaces
  EnemyCharacters.POOL; the pools are built from it at setup.
- RULES.md, Night plans: the real limits and the waiting rule.
- test_roster: full thief pool -> the thief waits, crows stay on time,
  a freed character (corpse) lets it in, sunrise drops and counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 16:17:31 -04:00
parent 3bb835f7c3
commit af48cff80d
6 changed files with 201 additions and 13 deletions

View file

@ -323,7 +323,13 @@ extends Resource
@export var radar_refresh: float = 0.25
@export_group("Enemies")
## Enemies on the farm at once, every type together.
@export_range(1, 1024) var enemy_capacity: int = 800
## Enemies on foot are drawn by KayKit characters (EnemyCharacters), a fixed number per type
## (EnemySystem.TYPE_NAMES; ground types only), all created at load: at most this many of each are
## on the farm at once. One that's due while every character of its type is in use waits for one
## to come free; any still waiting at sunrise never arrive (WaveDirector).
@export var character_pool: Dictionary = {"thief": 48, "breaker": 20}
## The enemy roster (EnemySystem.TYPE_NAMES), one row per type:
## speed, acceleration m/s, m/s^2
## hp hits it takes