3.2 KiB
3.2 KiB
| id | title | priority | status | scope | updated_at | assigned_by | evidence | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| p2-45 | Player elimination reconciliation — emit `player_eliminated` on every transition | p2 | done | game1 | 2026-04-30 | shipwright |
|
Summary
EventBus.player_eliminated(player_index) fires from exactly one place:
src/game/engine/src/modules/combat/combat_utils.gd:140 — when combat
strips a player's last city. Today every elimination path goes through
combat (the only way to lose your last city in Game 1 is a captor
takes it), so the signal does fire in practice.
But the contract is fragile:
victory_manager._check_elimination_winner()recomputesalive_playerseach turn fromcities.size() > 0 || _has_living_founder(player)— it knows who's eliminated but only emitsvictory_achievedfor the sole survivor; it never re-emits per-eliminated-player signals- Future paths (score-floor, surrender, starvation-to-zero-units, cultural-encroachment-displacement) won't go through combat_utils — they'd silently eliminate without firing the signal
- AudioManager's
_on_player_eliminatedis the only consumer that currently exists, but more listeners will land (chronicles, achievements, replays); they all depend on the signal being authoritative
Acceptance
- Add
Player.is_eliminated: boolfield (default false), set true on first transition victory_manager._check_elimination_winnerbecomes the reconciliation pass: for every player whose computed-eliminated state ≠is_eliminated, flip the flag AND emitEventBus.player_eliminated.emit(player.index)exactly once- Idempotent: re-running the pass on the same turn does not re-emit
- Combat_utils continues to emit on its own path; the
reconciliation pass tolerates "already announced" via the
is_eliminatedflag (no double-fire) - GUT test: kill a player by starvation (or any non-combat path
we have today), assert
player_eliminatedfires exactly once
Out of scope
- Adding new elimination mechanics (score-floor, surrender) — those are separate features
- Audio asset changes — already shipped
- Per-victory-condition defeat music — already shipped (
p2-12-defeat-pool)