diff --git a/src/lib/components/Board.svelte b/src/lib/components/Board.svelte index 36b71c8..a9c6478 100644 --- a/src/lib/components/Board.svelte +++ b/src/lib/components/Board.svelte @@ -116,6 +116,16 @@ } const shownStory = $derived(shownPly > 0 ? storyOf(shownPly) : ''); + /** What the other side just did, in a few words, for the status line when it is your move. */ + const lastLine = $derived.by(() => { + const m = g.moves.at(-1); + if (!m) return ''; + const who = nameOfSide(m.by); + if (m.afar) return `${who}’s Dragon struck ${squareName(m.to)} from the air.`; + const did = m.captured ? `took the ${NAMES[m.captured]} on` : 'went to'; + return `${who}’s ${NAMES[m.kind]} ${did} ${squareName(m.to)}${m.promoted ? ' and is a Hero now' : ''}.`; + }); + // --- Choosing and moving --- let selected = $state(null); const targets = $derived(selected === null ? [] : legalMovesFrom(g.cells, selected, g.setup)); @@ -200,7 +210,7 @@ {:else if room.spectating} {nameOfSide(g.toMove)} to move · {SIDE_NAMES[g.toMove]}{#if inCheckNow} · in check{/if} · move {g.moves.length + 1} {:else if yourMove} - Your move · {SIDE_NAMES[mySide!]}{#if inCheckNow} · your King is in check{/if} · Checkmate {nameOfSide(g.toMove === 'gold' ? 'scarlet' : 'gold')}’s King. + Your move · {SIDE_NAMES[mySide!]}{#if inCheckNow} · your King is in check{/if} · {lastLine || 'The first move is yours.'} {:else if room.view.playingOn} The drakes play on · a move every few seconds  {:else} @@ -302,7 +312,7 @@ color: var(--ember); } - .goal { + .last { color: var(--bone); }