'use client'; import type { Action, GameView } from '@/game/engine'; import { nexusCardMode } from '@/game/nexus-cards'; import { faction } from '@/game/catalog'; import { leaderStrengthLabel } from '@/game/cards'; import { LeaderInspector } from './leader-inspector'; import { NexusCardFace } from './nexus-cards'; import { Button } from './ui/button'; export function NexusHarkonnenBetrayal({ game, act, busy }: { game: GameView; act: (action: Action) => void; busy: boolean; }) { const reaction = game.nexusHarkonnenBetrayalReaction; if (!reaction) return null; const own = game.players.find((player) => player.id === game.me); const name = (id: string) => game.players.find((player) => player.id === id)?.name ?? id; const declaredTraitor = game.allLeaders.find((leader) => leader.id === reaction.identity); const traitor = declaredTraitor?.name ?? reaction.identity; const declaredLeader = game.allLeaders.find((leader) => leader.id === reaction.leader)?.name ?? reaction.leader; const canRespond = !!reaction.event && reaction.canPass && !reaction.hasPassed; const canUse = canRespond && reaction.canUse && !reaction.blocked; const priorityBlocked = game.automaticContinuationPending || !!game.truthtrance || !!game.response || !!game.decision || !!game.phaseOpening || !!game.nexusCards?.waiting.length || !!game.nexusTraitors?.pending; const disabled = busy || game.status !== 'playing' || game.phase !== 6 || priorityBlocked || !!game.roomControl?.paused || !!game.roomControl?.closed || !!own?.autopilot; const card = game.nexusCards?.card; const ownMode = card && own ? nexusCardMode(card, own.faction, game.players.map((player) => player.faction)) : undefined; return (

Declared Harkonnen traitor acknowledgement

{name(reaction.provider)} has declared the {traitor} Traitor Card for {name(reaction.beneficiary)} {' '}against {name(reaction.target)}’s {declaredLeader}. The traitor battle outcome has not happened.

{declaredTraitor && ( )}

Every publicly possible unallied responder acknowledges this declaration, regardless of their secret Nexus identity. After all passes, the original traitor call continues once. Any native Karama counter finishes first; this acknowledgement is not another Karama counter window.

{card && } {canUse &&

Spend your own Harkonnen Nexus to cancel this declared traitor call. The declared Traitor Card is shuffled into the Traitor Deck immediately; Harkonnen draws one private replacement automatically during this turn’s Mentat Pause. No replacement selection or confirmation is needed. {' '}Betrayal timing and preview limits

} {!canRespond ? (

{reaction.hasPassed ? 'You have passed. Waiting for the remaining acknowledgements.' : 'Waiting for the required acknowledgements.'}

) : <> {reaction.blocked && {reaction.blocked}} {canUse && } }
); }