import { territory } from '@/game/board'; import type { GameView } from '@/game/engine'; /** Public map markers never inspect the face of a placed Terror token. */ export function TerrorBoardMarkers({ tokens, atomics }: { tokens: readonly { status: string; location: string | null }[]; atomics?: GameView['moritaniAtomics']; }) { const groups = new Map(); for (const token of tokens) if (token.status === 'placed' && token.location) groups.set(token.location, (groups.get(token.location) ?? 0) + 1); const aftermath = atomics && territory(atomics.territory); const handLimitLabel = atomics?.allyAtActivation ? 'Moritani and the ally at activation have hand limits reduced by one' : 'Moritani has a hand limit reduced by one'; return ( <> {[...groups].map(([id, count]) => { const place = territory(id); const label = `${count} hidden Terror token${count === 1 ? '' : 's'} in ${place.name}`; return ( {label} {count > 1 && } {count === 1 ? 'T' : `T${count}`} ); })} {aftermath && ( {`Atomics Aftermath in ${aftermath.name}: no shipments, including Fremen reinforcements; ordinary movement and Sneak Attack remain legal. ${handLimitLabel}.`} A )} ); }