Connect owned Sandmaster destination pile choices

This commit is contained in:
Quintine committed 2026-10-09 04:51:12 +11:00
1 parent 24863480cb
commit 0040ed1921
17 files changed
+458 -89

No files matched your search

+17 -3
View File
@@ -1,17 +1,31 @@
import { splitLocation } from '@/game/board';
import type { SandmasterDestinationCollection } from '@/game/sandmaster-movement';
export function SandmasterWormChoice({ quote, collect, onChange }: {
export function SandmasterWormChoice({ quote, collect, onChange, onPileChange }: {
quote: SandmasterDestinationCollection | null;
collect: boolean;
onChange: (collect: boolean) => void;
onPileChange: (key: string) => void;
}) {
if (!quote) return null;
return <div className="notice" aria-label="Sandmaster worm collection">
return <div className="notice space-y-3" aria-label="Sandmaster worm collection">
{quote.blocked ? <p>{quote.blocked} You may still ride without collecting.</p> : <>
<label><input type="checkbox" checked={collect}
<label className="flex min-h-11 items-start gap-2"><input className="mt-1 shrink-0" type="checkbox" checked={collect}
onChange={event => onChange(event.target.checked)} />
Collect 1 spice with Sandmaster at the destination
</label>
{quote.piles.length > 1 && <>
<label className="flex flex-col gap-2">Destination spice pile
<select className="min-h-11 w-full" disabled={!collect} value={quote.key ?? ''} onChange={event => onPileChange(event.target.value)}>
{quote.piles.map(pile => <option key={pile.key} value={pile.key}>
Sector {splitLocation(pile.key).sector}: {pile.before} → {pile.before - 1} spice
</option>)}
</select>
</label>
<p className="fine">Provisional multi-pile policy: you choose which sector supplies
the one spice; this is not a publisher allocation ruling.</p>
</>}
<p className="fine">Sector {splitLocation(quote.key!).sector}: {quote.before} → {quote.before - 1} spice if collected.</p>
<p className="fine">Collect once for this ride, even when several forces or source
sectors participate. The source and intervening territories earn nothing.
This does not use your normal movement.</p>