Admit genuine Basic Ixian setup with the full fourteen-skill deck, real starting-card choice, optional Tleilaxu/base opponents and first-Storm HMS. Keep public starts, Advanced and other module combinations gated. Share per-origin cyborg movement range across engine, controls and legal bots. Preserve independent Planetologist range after native Karama cancellation. Connect Sandmaster force routes through room-local HMS pointer adjacency. Retain canceled movement's no-op contract while validating actual execution. Resolve Suk rescue before substitution with explicit ambiguous cyborg rescue origins and exact remaining Tank losses. Finish Rihani before native substitution, bind saved physical losses and declared exchange, and resume mandatory/optional winner disposal on allow, decline or cancellation. Admit exact green Ix Thumper, Harvester and Amal as Planetologist substitutes. Validation: types, lint, 5,082 offline tests and production build passed. Five genuine 2-6 player games completed with zero rejected actions and 54 JSON restores. Authenticated in-memory concurrent starting-card recovery, private setup, physical card/force custody and independent review passed. Browser FLGHBSA4 completed real setup, first Storm/HMS placement and a conserved staged Suk battle. Mobile rescue, refresh and one-for-one substitution passed. Screenshot capture timed out; full visual acceptance remains open. All 1,582 prior rooms, 3,350 human seats and auxiliary records were preserved; one new QA room/seat remains. No restart, reset or automation. AI work remains limited to legal participation until every non-AI feature is complete, then targets roughly 75% higher-tier wins for each adjacent pair.
45 lines
2.4 KiB
TypeScript
45 lines
2.4 KiB
TypeScript
'use client';
|
|
|
|
import { useState } from 'react';
|
|
import type { Action, Decision } from '@/game/engine';
|
|
import type { SukRescueOption } from '@/game/suk-graduate';
|
|
import { splitLocation } from '@/game/board';
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
export function sukRescueLabel(option: SukRescueOption): string {
|
|
const total = option.normal + option.elite;
|
|
if (!total) return 'Do not rescue any forces';
|
|
const kept = option.kept
|
|
? `keep 1 ${option.kept.kind === 'normal' ? 'ordinary' : 'elite'} in sector ${splitLocation(option.kept.key).sector}; `
|
|
: '';
|
|
const origins = option.eliteReserves ? ` (cyborgs: ${Object.entries(option.eliteReserves)
|
|
.map(([key, count]) => `${count} from sector ${splitLocation(key).sector}`).join(', ')})` : '';
|
|
return `Save ${option.normal} ordinary + ${option.elite} elite: ${kept}return ${total - (option.kept ? 1 : 0)} to reserves${origins}`;
|
|
}
|
|
|
|
export function SukGraduatePanel({ decision, act, busy }: {
|
|
decision: Extract<Decision, { kind: 'sukRescue' }>;
|
|
act: (action: Action) => void;
|
|
busy: boolean;
|
|
}) {
|
|
const [choice, setChoice] = useState<number | null>(null);
|
|
return <section aria-label="Suk Graduate rescue" className="space-y-3">
|
|
<h3>Suk Graduate rescue</h3>
|
|
<p>{decision.mode === 'normal'
|
|
? 'Your skilled leader remained face up. Return one of your selected casualties to reserves instead of the Tanks.'
|
|
: 'Your skilled leader survived. You may save up to three selected casualties. One stays in its original sector; the rest return to reserves.'}</p>
|
|
<p className="muted">Ordinary and elite counters keep their identity. Your paid battle support is unchanged.</p>
|
|
<label className="block">Forces to save
|
|
<select aria-label="Forces to save with Suk Graduate" className="w-full" disabled={busy}
|
|
value={choice ?? ''} onChange={(event) => setChoice(event.target.value === '' ? null : Number(event.target.value))}>
|
|
<option value="">Choose your rescue</option>
|
|
{decision.options.map((option, index) => <option key={index} value={index}>{sukRescueLabel(option)}</option>)}
|
|
</select>
|
|
</label>
|
|
{choice !== null && <p>{sukRescueLabel(decision.options[choice])}</p>}
|
|
<Button disabled={busy || choice === null} onClick={() => {
|
|
if (choice !== null && !busy) act({ type: 'decision', event: decision.event, choice });
|
|
}}>Resolve rescue</Button>
|
|
</section>;
|
|
}
|