Wiz-War sixth edition {#if local.active} hotseat {:else if net.roomId} room {net.roomId} {/if} {net.status === "connected" ? "" : "reconnecting…"}
{#if peekCard} {/if} {#if showHelp} (showHelp = false)} /> {/if} {#if view?.phase === "finished" && view.winner && !victorySeen}
🏆
{view.winner}
{#if view.winReason === "treasures"} carried two stolen treasures home — the maze is theirs {:else if view.winReason === "lastStanding"} the last wizard standing {:else} wins the game {/if}
{/if} {#if view?.stack && attackNoticeKey && attackNoticeSeen !== attackNoticeKey}
{#if view.stack.defenderId === view.you} {view.stack.attackerId} attacks you! {:else} {view.stack.counters[view.stack.counters.length - 1]?.player} counters your spell! {/if}
{#if view.stack.defenderId === view.you && view.stack.attackCard}
{#if view.stack.numberValue != null}
powered by a {view.stack.numberValue}
{/if} {:else if view.stack.defenderId === view.you}
👊 a bare-knuckled punch
{:else if view.stack.counters.length > 0}
{/if}
{/if} {#if net.catchUp && net.catchUp.length > 0} net.closeCatchUp()} /> {/if} {#if net.error} {/if} {#if net.transferCode}
Speak this phrase into your other device (good for 10 minutes, one use): {net.transferCode.code}
{/if} {#if local.setup}
wizard {local.setup.names.length + 1} of {local.setup.count}
What is your name?
{#each [0, 1, 2, 3, 4, 5] as c (c)} {@const taken = local.setup.colors.includes(c)} {/each}
{ e.preventDefault(); const err = local.submitName(setupName, setupColor); if (err) net.error = err; else setupName = ""; }}>
{#if local.setup.names.length > 0}
so far: {local.setup.names.join(", ")}
{/if}
{:else if local.handoffTo}
local.takeSeat()} onkeydown={(e) => e.key === "Enter" && local.takeSeat()}>
pass the device to
{local.handoffTo}
tap when only they can see the screen
{/if} {#if !net.roomId && !local.active}
Wiz-War
A game of magical combat in a stone labyrinth
or join one
or play here, passing the device:
{#each [2, 3, 4, 5, 6] as n (n)} {/each}
{#if local.hasSave()} {/if}
{#if net.seats.length > 0}
your games {#if !net.notificationsEnabled} {/if}
{#each net.seats as seat (seat.roomId + seat.name)} {@const g = net.games.find((x) => x.roomId === seat.roomId && x.name === seat.name)}
{/each}
{/if}
{:else if !local.active && !net.started}
Room {net.roomId}
Share the code. Two to six wizards enter the maze.
    {#each net.players as p (p)} {@const chosen = net.roomColors[p]}
  • {#if chosen !== undefined} {:else} {/if} {p}{p === net.hostId ? " — host" : ""}{chosen === undefined ? " — choosing…" : ""}
  • {/each}
{#each [0, 1, 2, 3, 4, 5] as c (c)} {@const takenBy = Object.entries(net.roomColors).find(([, v]) => v === c)?.[0]} {/each}
{#if net.you === net.hostId} {:else}

Waiting for {net.hostId} to flip the boards…

{/if}
{:else if view}
peekAt(c)} {litCells} />
{#if ambushVia}
{cardDef(ambushVia.cardId).name} — set an ambush {#if !ambushTrigger} springs when an opponent… {:else if !ambushSpell} — now tap the attack card to commit {:else} {cardDef(ambushSpell.cardId).name}{attachedNumber ? ` with a ${numberTotal}` : " (tap a number to power it)"} {/if}
{/if} {#if youMustRespond || selectedDef || selectedCreature || youMustDiscard || discardMode || discardSelection.size > 0}
{#if selectedCreature && !selectedDef} {@const sc = view.creatures.find((c) => c.id === selectedCreature)} {#if sc} Commanding {cardDef(sc.kind).name} — {creatureStats(sc)}. Tap a square beside it to march, a target in its square to attack. {/if} {/if} {#if youMustRespond && view.stack} {#if view.stack.defenderId === view.you} {view.stack.attackerId} attacks with {view.stack.attackCard ? cardDef(view.stack.attackCard.cardId).name : "a punch"} — tap a counteraction card, or {:else} {view.stack.waitingOn === view.you ? "They counter your spell — counter back, or" : ""} {/if} {/if} {#if youMustDiscard} Hand over the limit — mark cards and discard. {:else if discardMode && discardSelection.size === 0} Mark the cards to throw away, then confirm. {/if} {#if discardSelection.size > 0} {/if} {#if discardMode || (discardSelection.size > 0 && !youMustDiscard)} {/if} {#if selectedDef} {selectedDef.name} {#if edgeSelectMode}— click a wall line{/if} {#if selectedDef.cardType === "attack" && !edgeSelectMode && !cellSelectMode} — click a target{attachedNumber ? ` (powered by a ${numberTotal})` : " (tap a number card to power it)"} {/if} {#if attachedMods.length > 0} [+ {attachedMods.map((m) => cardDef(m.cardId).name).join(", ")}] {/if} {#if selectedCard?.cardId === "boobytrap"} — place 4 tokens ({trapCells.length}/4; the first is real) {/if} {#if selectedCard && TWO_CELL_CARDS.has(selectedCard.cardId)} {tradeFrom ? "— now the second square" : "— click the first square"} {/if} {#if selectedCard?.cardId === "rotate-sector"} — click the sector {/if} {#if selectedCard?.cardId === "relocate-sector"} {pendingSectorFrom ? "— now the destination area" : "— click the sector to move"} {/if} {#if selectedCard && NAMED_CARDS.has(selectedCard.cardId)} {#each nameSuggestions as n (n)}{/each} {#if selectedCard.cardId === "deja-vu"} {:else} — then click the target {/if} {/if} {#if selectedCard?.cardId === "waterbolt"} (knockback {numberTotal - wbDamage}) {/if} {#if selectedCard?.cardId === "power-run"} {/if} {#if selectedCard && CONFIRM_CAST.has(selectedCard.cardId)} {/if} {#if selectedCard && isMovableObject(selectedCard.cardId) && isYourTurn} {/if} {#if selectedCard && isNumberCard(selectedCard.cardId)} {/if} {/if}
{/if}
{#if isYourTurn && onWarpToken} {/if} {#if isYourTurn} {#each objectsHere as obj (obj.instanceId)} {/each} {/if}
{#if selectedCard && !inspectorHidden} {/if} {#if view.phase === "finished" && view.revealedHands}
The hands, face-up
{#each view.players as p (p.id)}
{p.id === view.winner ? "🏆 " : ""}{p.id} {#if !p.alive}as they fell{/if}
{#each view.revealedHands[p.id] ?? [] as card (card.instanceId)} (peekCard = card)} /> {/each} {#if (view.revealedHands[p.id] ?? []).length === 0} empty-handed {/if}
{/each}
{/if}
{#each view.phase === "finished" ? [] : view.yourHand as card (card.instanceId)} m.instanceId === card.instanceId)} marked={discardSelection.has(card.instanceId)} displayed={view.players.find((p) => p.id === view.you)?.displayed.some((c) => c.instanceId === card.instanceId) ?? false} charges={view.wandCharges[card.instanceId] ?? null} onclick={() => selectCard(card)} /> {/each}
{/if}