Files
Dune/components/nexus-sardaukar.tsx
T
Quintine 97c2b67650 Compose classic independent cards with World Nexus rules
Retain independent36, original Homeworlds and Nexus12 through classic fresh setup with optional Skills and phase modules. Resolve own-World Reinforcements fees before computing temporary Sardaukar roles, preserving original Cunning declarations, printed traits and physical counters. Record the provisional ordinary-nonrole-first policy and align human/AI quotes and captions.

Validation: types/lint/build, 128 affected tests across 15 files, bounded rule-source review and finite original-action smoke for Recruits, Harass, local-fee Cunning, all four legal policies and rendered source controls. Verified runtime c219ec587a54b44079539168d93835a5af904c8afb4de58bcec0a3d60c809f0c; documentation-only proof update 8ee21598e7be0c89a08fbad50786c346ebc8ae705492d8b31ea00fae0ffefa3c. Full modes, combinations, assurance and deployed acceptance remain open. No saved-room/provider changes.
2026-10-18 10:20:08 +11:00

66 lines
2.2 KiB
TypeScript

'use client';
import type { Action, GameView } from '@/game/engine';
import { nexusSardaukarAction } from '@/game/nexus-sardaukar-options';
import { Button } from './ui/button';
type Props = { game: GameView; act: (action: Action) => void; busy: boolean };
export function NexusSardaukar({ game, act, busy }: Props) {
const state = game.nexusSardaukar;
if (!state) return null;
if (state.pending)
return (
<section aria-label="Emperor Nexus response" className="notice">
<p>
{game.players.find((p) => p.id === state.pending!.owner)?.name ??
'Emperor'}{' '}
declared Cunning. Karama may cancel the entire enhancement before the
five counters count as Sardaukar.
</p>
</section>
);
if (state.active)
return (
<section aria-label="Emperor Nexus active" className="notice">
<p>
Cunning declared five ordinary Emperor counters as Sardaukar for this
battle. An own-Homeworld reserve fee can reduce that group;
the selected plan shows the remaining combat pool. These counters
retain their ordinary physical identity and go to the ordinary Tanks
when lost.
</p>
</section>
);
const offer = state.offer;
if (!offer) return null;
const action = nexusSardaukarAction(game, offer.event);
return (
<section
aria-label="Emperor Nexus Cunning"
className="space-y-3 rounded-lg border border-[#a88b60]/50 p-3"
>
<h3>Emperor Nexus · Cunning</h3>
<p>
Count five of your ordinary forces as Sardaukar for this battle. Use
this before submitting your plan, with no actual Sardaukar in the
battle.
</p>
<p className="fine">
This spends your Nexus card once. Karama may cancel the enhancement. The
five counters keep their ordinary physical identity, including when
lost.
</p>
{offer.blocked && <p className="notice">{offer.blocked}</p>}
<Button
className="game-action min-h-11 whitespace-normal"
disabled={busy || !action}
onClick={() => {
if (!busy && action) act(action);
}}
>
Use five forces as Sardaukar
</Button>
</section>
);
}