'use client';
import { useState } from 'react';
import type { Action, GameView } from '@/game/engine';
import {
homeworldRevivalDeploymentCanAct,
homeworldRevivalDeploymentChoice,
homeworldRevivalDeploymentQuantities,
} from '@/game/homeworld-revival-deployment-options';
import { Button } from './ui/button';
type Props = {
game: GameView;
act: (action: Action) => void;
busy: boolean;
};
export function HomeworldRevivalDeployment({ game, act, busy }: Props) {
if (
!game.homeworldRevivalDeployment ||
game.homeworldRevivalDeployment.player !== game.me ||
game.decision?.kind !== 'homeworldRevivalDeployment' ||
game.decision.player !== game.me
)
return null;
return (
Choose how many remaining starred forces to place now. After this placement's native arrival effects finish,
you may place another portion at a different legal destination, or leave all remaining stars in reserves.
The eligible batch is fixed by this one original revival. Provisional per-star interpretation: Southern's face says “forces”;
the individual allocation has no publisher clarification.
{allocation.remaining} starred remaining of {allocation.total} · {allocation.placed} placed · {allocation.kept} kept in reserves
Place the entire eligible revived group in one destination, or leave it
in reserves.
{offer.normal} ordinary · {offer.elite} starred · {offer.normal + offer.elite} total
{offer.kind === 'fedaykin'
? 'Southern placement uses a sector outside the storm.'
: 'Tleilax placement keeps the storm restriction.'}
{game.players.some(player => player.faction === 'ixians') && (offer.kind === 'fedaykin'
? ' It does not grant the Force Movement route needed to enter the Hidden Mobile Stronghold.'
: ' It does not grant the Ixian route directly into the Hidden Mobile Stronghold.')}
{offer.kind === 'tleilax'
? 'Arrakis placement is followed by the normal Bene Gesserit free-force choice.'
: 'In Advanced play, entry into Bene Gesserit fighters permits Intrusion.'}
{' '}The revived group is already placed before those responses. Preventing
a Bene Gesserit power does not undo your revival or use your ordinary shipment.
Entry into an eligible Terror territory gives Moritani its normal choice
after the group is placed. Your original revival waits for that effect
and any Ambassador reaction; no ordinary shipment is used.
{choice.blocked}
{offer.kind === 'fedaykin'
? 'Place revived Fedaykin'
: 'Place revived forces'}
{allocation !== undefined ? <>