Rev 9: REDIRECTION connects the exits you choose

Playtesting read the card right and the engine had it wrong. "Placing
the A tokens on one set of exits & the B tokens on the other" means
the two exits you mark BECOME a pair — and their former partners pair
with each other — not that the two exits trade destinations. Under
rev 9, click the exit and then the exit you want it to connect TO
(the hint now says so); already-connected exits are refused. Earlier
games keep the swap their logs were validated against. Test pins the
full four-way rewiring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-16 16:40:22 -04:00
co-authored by Claude Fable 5
parent 1aafb9e837
commit ca16faac73
5 changed files with 56 additions and 13 deletions
+26 -10
View File
@@ -2105,23 +2105,39 @@ const CARD_EFFECTS: Record<string, AttackEffect | NeutralEffect | CounterEffect>
},
redirection: {
kind: "neutral",
// "Swap two external sector exits" — their wraparound destinations trade.
// "Signify their new directions by placing the A tokens on one set of
// exits & the B tokens on the other" — the two exits you choose become a
// pair (rules rev 9), and their former partners pair with each other.
// Earlier revisions swapped the two exits' destinations instead.
resolve: (state, events, caster, cmd) => {
const a = cmd.params?.cell;
const bT = cmd.target;
if (!a || !bT || bT.kind !== "cell") return "pick the two exits to swap";
if (!a || !bT || bT.kind !== "cell") return "pick the two exits to connect";
const b = bT.cell;
const wa = state.board.warps.find((w) => cellKey(w.from.cell) === cellKey(a));
const wb = state.board.warps.find((w) => cellKey(w.from.cell) === cellKey(b));
if (!wa || !wb || wa === wb) return "pick two different outer exits";
// Swap destinations and fix the reciprocal warps to match.
const destA = { ...wa.to };
const destB = { ...wb.to };
wa.to = destB;
wb.to = destA;
for (const w of state.board.warps) {
if (cellKey(w.from.cell) === cellKey(destA.cell)) w.to = { cell: { ...wb.from.cell }, side: wb.from.side };
if (cellKey(w.from.cell) === cellKey(destB.cell)) w.to = { cell: { ...wa.from.cell }, side: wa.from.side };
if ((state.config.deckRev ?? 1) >= 9) {
if (cellKey(wa.to.cell) === cellKey(wb.from.cell)) return "those exits already connect";
const pa = state.board.warps.find((w) => cellKey(w.from.cell) === cellKey(wa.to.cell));
const pb = state.board.warps.find((w) => cellKey(w.from.cell) === cellKey(wb.to.cell));
// The chosen exits join (A tokens); their old partners join (B tokens).
wa.to = { cell: { ...wb.from.cell }, side: wb.from.side };
wb.to = { cell: { ...wa.from.cell }, side: wa.from.side };
if (pa && pb) {
pa.to = { cell: { ...pb.from.cell }, side: pb.from.side };
pb.to = { cell: { ...pa.from.cell }, side: pa.from.side };
}
} else {
// Legacy: swap destinations and fix the reciprocal warps to match.
const destA = { ...wa.to };
const destB = { ...wb.to };
wa.to = destB;
wb.to = destA;
for (const w of state.board.warps) {
if (cellKey(w.from.cell) === cellKey(destA.cell)) w.to = { cell: { ...wb.from.cell }, side: wb.from.side };
if (cellKey(w.from.cell) === cellKey(destB.cell)) w.to = { cell: { ...wa.from.cell }, side: wa.from.side };
}
}
events.push({ type: "exitsRedirected", caster: caster.id });
return null;