Rev 17: the wave carries monsters as it carries wizards

Stone to Water's wave (and every waterwall collapse) washed wizards
back and crushed them against the maze — while a skeleton in the
same water stood dry. The wave only knew creatures well enough to
drown fire imps. From rev 17 it carries them all: washed back along
the surge, one point of crush per space the maze refuses, fire imps
still destroyed outright. Earlier ledgers keep their dry monsters
and replay so.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-17 15:07:34 -04:00
co-authored by Claude Fable 5
parent aef88d892a
commit e57307efbe
4 changed files with 68 additions and 4 deletions
+27 -2
View File
@@ -2347,8 +2347,11 @@ function waveFromEdge(state: GameState, events: GameEvent[], cell: Cell, side: S
if (p.alive && cellKey(p.position) === cellKey(probe)) washBackN(state, events, p, dir, range);
}
for (const c of [...state.creatures]) {
if (c.kind === "fire-imp" && cellKey(c.position) === cellKey(probe)) {
if (cellKey(c.position) !== cellKey(probe)) continue;
if (c.kind === "fire-imp") {
destroyCreature(state, events, c, reason);
} else if ((state.config.deckRev ?? 1) >= 17) {
washBackCreature(state, events, c, dir, range);
}
}
if (state.squareContents[cellKey(probe)]?.kind === "slime") {
@@ -2371,8 +2374,11 @@ function waveFromCell(state: GameState, events: GameEvent[], center: Cell, range
if (p.alive && cellKey(p.position) === cellKey(probe)) washBackN(state, events, p, dir, range);
}
for (const c of [...state.creatures]) {
if (c.kind === "fire-imp" && cellKey(c.position) === cellKey(probe)) {
if (cellKey(c.position) !== cellKey(probe)) continue;
if (c.kind === "fire-imp") {
destroyCreature(state, events, c, "rushing water");
} else if ((state.config.deckRev ?? 1) >= 17) {
washBackCreature(state, events, c, dir, range);
}
}
}
@@ -2473,6 +2479,25 @@ function washBackN(state: GameState, events: GameEvent[], p: PlayerState, dir: S
}
}
/** The wave carries monsters as it carries wizards (rules rev 17): washed
* back, and crushed a point per space the maze refuses them. Fire imps
* never reach this — water destroys them outright. */
function washBackCreature(state: GameState, events: GameEvent[], c: CreatureState, dir: Side, range: number): void {
const view = boardView(state);
let moved = 0;
for (let i = 0; i < range; i++) {
const step = stepTarget(view, c.position, dir);
if (step.kind === "blocked") break;
if (state.squareContents[cellKey(step.to)]?.kind === "stone") break;
c.position = step.to;
moved++;
}
const blockedSpaces = range - moved;
if (blockedSpaces > 0) {
damageCreature(state, events, c, blockedSpaces, "waterwall crush");
}
}
// ---------------------------------------------------------------------------
// Creatures