Stone to Water melts doors too (rules rev 38)

"Small entryways in a stone wall" are stone: a door melts exactly as a
wall does — edge opens, lock state washes away, the two-point wave
crashes. Older ledgers had the refusal and replay so.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-21 11:43:27 -04:00
co-authored by Claude Fable 5
parent 118bfd236b
commit 2afc4e3973
4 changed files with 44 additions and 4 deletions
+35 -1
View File
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { applyCommand, activePlayer, boardView, createGame, gameLos } from "../src/game";
import { cellKey, edgeKey, SIDES, stepTarget, type Cell } from "../src/board";
import { cellKey, edgeKey, SIDES, stepTarget, type Cell, type Side } from "../src/board";
import type { CardInstance } from "../src/cards";
import { eligibleCellsFor, sightedCellsFor, viewFor } from "../src/view";
import { newExpansionGame as newGame, must, giveCard, emptyNeighborCell } from "./helpers";
@@ -161,6 +161,40 @@ describe("expansion terrain", () => {
expect(state.squareContents[cellKey(spot.cell)]).toBeUndefined();
// Wave side effects vary by geometry; the melt itself is the pinned behavior.
});
it("stone to water melts a door from rev 38 — a small entryway in a stone wall", () => {
for (const deckRev of [37, 38]) {
const { state } = createGame({
playerIds: ["alice", "bob"], seed: 42, sets: ["basic", "expansion1"], deckRev,
});
const me = activePlayer(state);
const board = boardView(state);
// Stand the caster at some door and melt it point-blank.
let doorAt: { cell: Cell; side: Side } | null = null;
outer: 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.edges[edgeKey({ x, y }, side)] === "door") {
doorAt = { cell: { x, y }, side };
break outer;
}
}
}
if (!doorAt) throw new Error("setup: no door on this board");
me.position = { ...doorAt.cell };
const stw = giveCard(state, me.id, "stone-to-water", "SW", 0);
const r = applyCommand(state, me.id, {
type: "cast", instanceId: stw.instanceId,
target: { kind: "edge", cell: doorAt.cell, side: doorAt.side },
});
expect(r.ok).toBe(deckRev >= 38);
if (r.ok) {
const key = edgeKey(doorAt.cell, doorAt.side);
expect(boardView(r.state).edges[key] ?? "open").toBe("open");
expect(r.state.doorStates[key]).toBeUndefined();
}
}
});
});
describe("eligibility dimming mirrors the engine", () => {