Threats are keyed by seat as well as hand and spell, so two opponents building the same spell no longer crash the board (regression test). Past three wizards the rail lists the others on a line each with health, condition and whether they have moved; a row of names turns the ledger toward any wizard, as do pressing a warning or choosing a target; each seat keeps one colour across the ledger, the warnings and the rail. The result strip folds untouched wizards into one line. A full table no longer begins by itself: the host begins at every size and may send a bot away. Target lists carry health and condition, and an intent sentence says what the reveal will do. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0141G6xqLeNRYEtviLWSB5Up
13 lines
507 B
TypeScript
13 lines
507 B
TypeScript
// One colour per seat, the same in the roster, the ledger and the threats,
|
|
// so a name met in one place is known in the next. Twelve hues spaced round
|
|
// the wheel at the palette's own saturation, so none shouts.
|
|
|
|
import type { GameState, WizardId } from './state';
|
|
|
|
const HUES = [28, 200, 96, 330, 52, 260, 160, 8, 220, 120, 300, 70];
|
|
|
|
export function seatColor(state: GameState, id: WizardId): string {
|
|
const i = Math.max(0, state.seats.indexOf(id));
|
|
return `hsl(${HUES[i % HUES.length]} 55% 62%)`;
|
|
}
|