'use client'; import type { Action, GameView } from '@/game/engine'; import { gholaLeaderClaimText, liveGholaLeaderPromises } from '@/game/ghola-leader-promises'; import { Button } from './ui/button'; type Props = { game: GameView; busy: boolean; send: (action: Action) => void }; const leaderName = (game: GameView, id: string) => id === 'kwisatz' ? 'Kwisatz Haderach' : game.allLeaders.find(leader => leader.id === id)?.name ?? 'the named leader'; /** Forward only the exact current native card action from the private guide. */ export function GholaLeaderPromiseGuideButton(props: Props) { const game = props.game, guide = game.gholaLeaderPromiseGuide; if (!guide) return null; const actor = game.me, turn = game.turn, phase = game.phase, action = guide.action; const signature = JSON.stringify(action), quote = game.ghola, quoteSignature = JSON.stringify(quote); const card = game.players.find(player => player.id === actor)?.hand?.find(c => c.id === action.card); const canAct = () => { const current = props.game, me = current.players.find(player => player.id === actor); const named = typeof action.leader === 'string' && liveGholaLeaderPromises(current.gholaLeaderPromises, actor, turn) .some(promise => promise.answer && promise.leader === action.leader); return !props.busy && current === game && current.status === 'playing' && current.me === actor && current.turn === turn && current.phase === phase && current.gholaLeaderPromiseGuide === guide && guide.action === action && JSON.stringify(action) === signature && action.type === 'card' && action.mode === undefined && typeof action.card === 'string' && !!named && !!me && !me.autopilot && !!card && card.kind === 'special' && card.effect === 'ghola' && me.hand?.includes(card) && current.ghola === quote && JSON.stringify(quote) === quoteSignature && quote.available && quote.cards.includes(action.card) && (action.leader === 'kwisatz' ? quote.kwisatz : quote.leaders.some(leader => leader.id === action.leader)) && !current.truthtrance && !current.response && !current.decision && !current.phaseOpening && !current.automaticContinuationPending && !current.roomControl?.paused && !current.roomControl?.closed; }; return ; } export function GholaLeaderPromises(props: Props) { const own = props.game.gholaLeaderPromises.filter(promise => promise.player === props.game.me); if (!own.length) return null; return

Your Ghola leader promises

Yes requires an actual future return of the named leader with Ghola while it remains possible. No forbids that particular Ghola leader return this turn. An ordinary return, a force return, or an earlier Ghola play does not fulfill it.

The original card timing and leader eligibility still apply. This question is a provisional interpretation of Truthtrance.

; }