6630fd9158
scripts/replay-combat.js: drives full combat via live backend REST, computes
turns through shared/turn.js. Player display (subscribed via WS) live-updates.
Usage: node scripts/replay-combat.js [rounds] [delayMs]
TODO.md: tracks M4 work.
- Dead participants must NOT be skipped (still occupy initiative slot,
death saves resolve on their turn). Saw in game Saturday.
- JUMP_TURN_TO manual turn override.
1.6 KiB
1.6 KiB
TODO
M4 — Initiative skip bug + dead-participant handling
Dead participants must NOT be skipped in turn order
- Current: dead (HP=0) →
isActive=false→ removed from turn order → skipped - WRONG. Dead participants still occupy initiative slot.
- PCs (unconscious): death saves still resolve on their turn
- Monsters/NPCs: may still have reaction/reaction-like considerations
- Saw this problem in game Saturday.
- Fix: keep dead participants in turnOrderIds; their turn still comes up. Damage/death-save UI already gated on HP=0 so row buttons stay usable.
- Affects:
shared/turn.jsnextTurn(filtersisActive),applyHpChange(sets isActive=false on death),computeTurnOrderAfterRemoval. - Characterization tests (
Combat.characterization.test.js) lock CURRENT (buggy) behavior — those tests must be UPDATED to desired behavior, not preserved. Red desired-test first, then fix.
JUMP_TURN_TO(participantId) manual turn override
- DM clicks participant → cursor jumps → that participant's turn now.
- Future NEXT_TURN continues from jumped position.
- UI button: "Make This Turn"
- Backend action: new endpoint or via generic doc patch.
Pipeline
- Red test: dead participant still in turnOrderIds, turn still advances to them
- Fix
shared/turn.js: don't drop dead from turn order - Update characterization tests to desired (not preserved) behavior
- JUMP_TURN_TO red test
- JUMP_TURN_TO impl (shared + UI button)
- M5 docker-compose
- M6 undo rework (transactional events table)
- M7 Playwright E2E