Every turn wears the eye
The chronicle stops judging what is share-worthy: the 👁 now rides every turn's opening line — headers, skipped turns, extra turns — and the players decide which moments deserve reliving. The game-winning line keeps its own crown eye. The notable-event catalog and the one-eye bookkeeping retire with the judgment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF
This commit is contained in:
co-authored by
Claude Fable 5
parent
beb4947ad8
commit
324853ce51
@@ -215,19 +215,6 @@ export interface LogLine {
|
|||||||
* momentSteps, so a chronicle turn number addresses the same commands. */
|
* momentSteps, so a chronicle turn number addresses the same commands. */
|
||||||
const TURN_BOUNDARY = new Set(["turnStarted", "extraTurnStarted", "turnSkipped"]);
|
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 SEAT_KEY = "wizwar-seat";
|
||||||
const SEATS_KEY = "wizwar-seats";
|
const SEATS_KEY = "wizwar-seats";
|
||||||
@@ -322,7 +309,6 @@ class Net {
|
|||||||
* counts, so a chronicle line can name the turn it belongs to. */
|
* counts, so a chronicle line can name the turn it belongs to. */
|
||||||
private turnCounter = -1;
|
private turnCounter = -1;
|
||||||
/** The turn that already carries an instant-replay eye (one per turn). */
|
/** 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). */
|
/** The turn whose moment reel is open (share links point at it). */
|
||||||
private momentTurn: number | null = null;
|
private momentTurn: number | null = null;
|
||||||
private shareResolve: ((url: string) => void) | null = null;
|
private shareResolve: ((url: string) => void) | null = null;
|
||||||
@@ -445,12 +431,11 @@ class Net {
|
|||||||
if (TURN_BOUNDARY.has(e.type)) this.turnCounter++;
|
if (TURN_BOUNDARY.has(e.type)) this.turnCounter++;
|
||||||
const line = humanize(e);
|
const line = humanize(e);
|
||||||
if (line) {
|
if (line) {
|
||||||
// One eye per turn — except the crown: the game-winning
|
// Every turn wears its eye, on the header line that opens
|
||||||
// line always carries its own, whatever came before it.
|
// it — the players judge what is share-worthy. The game-
|
||||||
|
// winning line carries its own besides.
|
||||||
const notable = this.turnCounter >= 0 &&
|
const notable = this.turnCounter >= 0 &&
|
||||||
(e.type === "gameWon" ||
|
(e.type === "gameWon" || TURN_BOUNDARY.has(e.type));
|
||||||
(this.turnCounter !== this.eyeTurn && isNotableEvent(e)));
|
|
||||||
if (notable) this.eyeTurn = this.turnCounter;
|
|
||||||
this.log = [...this.log, { text: line, turn: this.turnCounter >= 0 ? this.turnCounter : null, notable }];
|
this.log = [...this.log, { text: line, turn: this.turnCounter >= 0 ? this.turnCounter : null, notable }];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -699,7 +684,6 @@ class Net {
|
|||||||
private resetChronicle(): void {
|
private resetChronicle(): void {
|
||||||
this.log = [];
|
this.log = [];
|
||||||
this.turnCounter = -1;
|
this.turnCounter = -1;
|
||||||
this.eyeTurn = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Summon one turn's reel by its chronicle turn number. */
|
/** Summon one turn's reel by its chronicle turn number. */
|
||||||
|
|||||||
Reference in New Issue
Block a user