fix(replay): round markers align with turn-line round labels

Round-complete marker logged roundN (just completed) while turn lines
logged enc.round (post-increment, new round). Result: 'turn 8 (round 2)'
appeared BEFORE 'round 1 complete' — confusing off-by-one.

Replaced bottom 'round N complete' marker with top 'round N starting'
marker. Turn lines for round N now appear after its start marker.

Logic unchanged. 4-round smoke verified.
This commit is contained in:
david raistrick
2026-07-01 17:21:55 -04:00
parent 3b07fc27b0
commit d73405753a
+1 -2
View File
@@ -157,6 +157,7 @@ async function main() {
let lastReorder = 0;
for (let roundN = 1; roundN <= ROUNDS; roundN++) {
console.log(`--- round ${roundN} starting ---`);
// advance initiative until round counter ticks (full cycle done).
const cap = (enc.participants.length + 2) * 2;
let guard = 0;
@@ -338,8 +339,6 @@ async function main() {
}
if (!enc.isStarted) { console.log('combat auto-ended'); break; }
const alive = enc.participants.filter(p => p.currentHp > 0).length;
console.log(`--- round ${roundN} complete (turns=${totalTurns}, alive=${alive}) ---`);
// revive dead: heal to full + reactivate. Sustains combat for 100 rounds
// and exercises toggleActive reactivate + heal-from-zero path.
const dead = enc.participants.filter(p => p.currentHp <= 0 || p.isActive === false);