'use client'; import { useState } from 'react'; import type { Action, GameView } from '@/game/engine'; import { greatMakerRideAction } from '@/game/great-maker-options'; import { Button } from './ui/button'; type Props = { game: GameView; act: (action: Action) => void; busy: boolean }; export function GreatMakerDecision({ game, act, busy }: Props) { const [destination, setDestination] = useState(''), [amount, setAmount] = useState(1), [elite, setElite] = useState(0); const d = game.decision, frame = game.greatMaker; if (!frame || !d || d.player !== game.me) return null; if (d.kind === 'greatMakerVote') return (

Great Maker · Nexus vote

Vote in storm order. A majority must vote yes for this encounter to create a Nexus; a tie means no Nexus.

{frame.votes.map((vote) => (

{game.players.find((p) => p.id === vote.player)?.name}:{' '} {vote.yes ? 'Yes' : 'No'}

))}
{[true, false].map((yes) => ( ))}
); const offer = frame.ride; if (d.kind !== 'greatMakerRide' || !offer) return null; const to = offer.destinations.find( (to) => `${to.territory}:${to.sector}` === destination, ) ?? offer.destinations[0]; const n = Math.max(1, Math.min(amount, offer.max)), minimumElite = Math.max(0, n - (offer.max - offer.eliteMax)); const e = Math.max(minimumElite, Math.min(elite, n, offer.eliteMax)); const action = to ? greatMakerRideAction(game, to.territory, to.sector, n, e) : null; return (

Ride the Great Maker

Move any number of reserve forces to one legal destination. This uses no spice, shipment or movement. Forces already on the board stay where they are.

{offer.eliteMax > 0 && ( )}
); }