Credibility pass: the collapse loses its scaffolding
Blind reviews over the rev-37..40 features and the gate collapse. The scripted surgery's scars come out: bare brace blocks unwrapped (with one hiding an unreachable scrambleHands), the amputated comment healed, the dead events parameter unthreaded from the illusion-sight chain, the laziness probe in perceivedBoard collapsed to the rule it always produced, GameView.deckRev retired with its last reader, the ward's arming stub told honestly, and every comment or test title still citing the retired revision numbering reworded to the rule it guards. Rim mechanics unify on rimWarpMouth and breachRim; the test suite gains plainRimWall and pushSustained and loses its loop-shaped scars and rev-named helpers. No behavior changes; 255 tests pass unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
8a50ff7f36
commit
4a91d56d24
@@ -11,8 +11,9 @@ import {
|
||||
type GameState,
|
||||
type PlayerId,
|
||||
} from "../src/game";
|
||||
import { cellKey, SIDES, stepTarget, type Cell, type Side } from "../src/board";
|
||||
import { cellKey, edgeKey, neighbor, SIDES, stepTarget, type Cell, type Side } from "../src/board";
|
||||
import type { CardInstance } from "../src/cards";
|
||||
import type { SustainedEffect } from "../src/game";
|
||||
|
||||
export function newGame(seed = 42, players: PlayerId[] = ["alice", "bob"]) {
|
||||
return createGame({ playerIds: players, seed, sets: ["basic"] });
|
||||
@@ -76,3 +77,26 @@ export function emptyNeighborCell(state: GameState, of: Cell): { cell: Cell; sid
|
||||
}
|
||||
throw new Error("no empty neighbor");
|
||||
}
|
||||
|
||||
/** Some off-board edge that is a bare stone wall — no warp behind it. */
|
||||
export function plainRimWall(state: GameState): { cell: Cell; side: Side } {
|
||||
const board = boardView(state);
|
||||
for (const k of Object.keys(board.cells)) {
|
||||
const [x, y] = k.split(",").map(Number) as [number, number];
|
||||
for (const side of SIDES) {
|
||||
if (board.cells[cellKey(neighbor({ x, y }, side))]) continue;
|
||||
if (board.edges[edgeKey({ x, y }, side)] !== "wall") continue;
|
||||
if (board.warps.some((w) => cellKey(w.from.cell) === k && w.from.side === side)) continue;
|
||||
return { cell: { x, y }, side };
|
||||
}
|
||||
}
|
||||
throw new Error("setup: no plain rim wall on this board");
|
||||
}
|
||||
|
||||
/** Rig a duration spell directly, sparing the cast ceremony. */
|
||||
export function pushSustained(
|
||||
state: GameState,
|
||||
fx: Omit<SustainedEffect, "data"> & { data?: SustainedEffect["data"] },
|
||||
): void {
|
||||
state.sustained.push({ data: {}, ...fx });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user