diff --git a/packages/web/src/net.svelte.ts b/packages/web/src/net.svelte.ts index 04f4d07..a8d3861 100644 --- a/packages/web/src/net.svelte.ts +++ b/packages/web/src/net.svelte.ts @@ -215,19 +215,6 @@ export interface LogLine { * momentSteps, so a chronicle turn number addresses the same commands. */ const TURN_BOUNDARY = new Set(["turnStarted", "extraTurnStarted", "turnSkipped"]); -/** Does this event make a turn worth reliving? Combat and spectacle. */ -export function isNotableEvent(e: GameEvent): boolean { - if (e.type === "spellCast") return e.target !== null || e.targetCell !== null; - return NOTABLE_EVENTS.has(e.type); -} -const NOTABLE_EVENTS = new Set([ - "punched", "attackResolved", "damaged", "died", "knockedBack", "shoved", - "washedBack", "retreatedInHorror", "creatureAttacked", "boobytrapSprung", - "firewallBurned", "objectThrown", "gameWon", "positionsSwapped", - "teleported", "stonesDestroyed", "thumbOfGod", "stoneTurnedToWater", - "waterwallCrashes", "sectorRotated", "sectorRelocated", "homeBasesSwapped", - "handsScrambled", -]); const SEAT_KEY = "wizwar-seat"; const SEATS_KEY = "wizwar-seats"; @@ -322,7 +309,6 @@ class Net { * counts, so a chronicle line can name the turn it belongs to. */ private turnCounter = -1; /** The turn that already carries an instant-replay eye (one per turn). */ - private eyeTurn = -1; /** The turn whose moment reel is open (share links point at it). */ private momentTurn: number | null = null; private shareResolve: ((url: string) => void) | null = null; @@ -445,12 +431,11 @@ class Net { if (TURN_BOUNDARY.has(e.type)) this.turnCounter++; const line = humanize(e); if (line) { - // One eye per turn — except the crown: the game-winning - // line always carries its own, whatever came before it. + // Every turn wears its eye, on the header line that opens + // it — the players judge what is share-worthy. The game- + // winning line carries its own besides. const notable = this.turnCounter >= 0 && - (e.type === "gameWon" || - (this.turnCounter !== this.eyeTurn && isNotableEvent(e))); - if (notable) this.eyeTurn = this.turnCounter; + (e.type === "gameWon" || TURN_BOUNDARY.has(e.type)); this.log = [...this.log, { text: line, turn: this.turnCounter >= 0 ? this.turnCounter : null, notable }]; } } @@ -699,7 +684,6 @@ class Net { private resetChronicle(): void { this.log = []; this.turnCounter = -1; - this.eyeTurn = -1; } /** Summon one turn's reel by its chronicle turn number. */