Swapping homes stops announcing a body swap

SWAP HOME BASES traded homes correctly but borrowed the
positionsSwapped event, so the chronicle claimed the wizards
themselves changed places. It now speaks its own event — "swap home
bases — the maze's loyalties shift!" — and both hearths shimmer as
their allegiance changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-17 15:01:07 -04:00
co-authored by Claude Fable 5
parent e7c8ddc0b3
commit 794b809a1b
3 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -498,6 +498,7 @@ export type GameEvent =
| { type: "spellSustained"; effectId: string; cardId: string; caster: PlayerId; target: PlayerId; turns: number }
| { type: "spellExpired"; effectId: string; cardId: string; target: PlayerId }
| { type: "teleported"; player: PlayerId; from: Cell; to: Cell; by: PlayerId; cardId: string }
| { type: "homeBasesSwapped"; a: PlayerId; b: PlayerId; aHome: Cell; bHome: Cell }
| { type: "positionsSwapped"; a: PlayerId; b: PlayerId; aTo: Cell; bTo: Cell }
| { type: "cardErased"; player: PlayerId; cardId: string | null; found: boolean }
| { type: "cardsStolen"; from: PlayerId; to: PlayerId; count: number }
@@ -2290,7 +2291,7 @@ const CARD_EFFECTS: Record<string, AttackEffect | NeutralEffect | CounterEffect>
const mine = caster.home;
caster.home = other.home;
other.home = mine;
events.push({ type: "positionsSwapped", a: caster.id, b: other.id, aTo: caster.home, bTo: other.home });
events.push({ type: "homeBasesSwapped", a: caster.id, b: other.id, aHome: caster.home, bHome: other.home });
checkVictory(state, events);
return null;
},
+5
View File
@@ -177,6 +177,11 @@ export function fxForEvents(
}
break;
}
case "homeBasesSwapped":
push({ kind: "shimmer", at: e.aHome });
push({ kind: "shimmer", at: e.bHome }, 200);
beat++;
break;
case "teleported":
push({ kind: "shimmer", at: e.from });
push({ kind: "shimmer", at: e.to }, 200);
+1
View File
@@ -68,6 +68,7 @@ export function humanize(e: GameEvent): string | null {
? `${e.player} teleports across the maze!`
: `${e.player} is teleported away by ${e.by}!`;
case "positionsSwapped": return `${e.a} and ${e.b} swap places!`;
case "homeBasesSwapped": return `${e.a} and ${e.b} swap home bases — the maze's loyalties shift!`;
case "cardErased": return e.found
? `${e.player}'s ${e.cardId ? cardDef(e.cardId).name : "card"} is erased from their mind!`
: `${e.player} wasn't holding that card — the erasure fizzles.`;