Extend bounded Basic ground-movement reachability to held native CHOAM Kulon and owned paid Box recovery. Before payment, use only known current-discard identities. Preserve actual paid event, full inspection, one two-spice fee, original physical card replay and existing provisional full-hand exchange. Reject a Yes-breaking selection before the server shuffle without losing the paid search. Keep No-only searches on their normal decision before movement can end. Record movement-relevant current-discard certainty at actual disposal, paid search, mixed claim and deck rebuild boundaries without projecting raw metadata or erasing historical memory. Use deterministic preparation on private copies, include preparation state in search memoization, protect fee-funded routes from voluntary spending and keep native Kulon counter semantics. Persistent busy-safe guidance and existing legal profiles use the actual next paid action; no strategy tuning. Verify 17 files231/231, types/lint/build, three original-action control/table-rendering programmes and four existing profiles with40 accepted actions including neutral passes. Original public sources44/25 retain actual purchases1+1, shipment costs6/1, exhausted Hajr and native Kulon route4. Separate full-hand, legacy certainty, fee-loss and acquired-counter edges disclose conserved staging. Two prior-engine Auditor fixture failures are repaired by actual battle-result acknowledgements; test-only const lint is corrected. Other timing, preparations/counter mitigation, unknown private possibilities, optional/Advanced, full modes, comprehensive assurance and deployed acceptance remain open. No saved-room/reset/restart/deployment operation.
30 lines
2.5 KiB
TypeScript
30 lines
2.5 KiB
TypeScript
'use client';
|
|
import type { Action, GameView } from '@/game/engine';
|
|
import { liveMovementPromises, movementClaimText } from '@/game/movement-promises';
|
|
import { Button } from './ui/button';
|
|
|
|
export function MovementPromises({ game, act, busy }: { game: GameView; act: (action: Action) => void; busy: boolean }) {
|
|
const own = liveMovementPromises(game.movementPromises ?? [], game.me, game.turn);
|
|
if (!own.length) return null;
|
|
const next = game.movementPromisePolicy?.[0];
|
|
const amount = next?.forces && typeof next.forces === 'object'
|
|
? Object.values(next.forces as Record<string, number>).reduce((sum, count) => sum + count, 0) : typeof next?.amount === 'number' ? next.amount : 0;
|
|
const destination = next && game.combatLocations.find(location => location.id === next.territory)?.name;
|
|
const destinationLabel = destination ?? (typeof next?.territory === 'string' ? next.territory : 'the chosen destination');
|
|
const sector = typeof next?.sector === 'number' ? next.sector : 0;
|
|
const card = game.players.find(player => player.id === game.me)?.hand?.find(card => card.id === next?.card);
|
|
const recovered = game.nullentropy?.search?.cards.find(card => card.id === next?.card);
|
|
const label = next?.type === 'decision' ? `Choose ${recovered?.name ?? 'the required card'} in your paid Box search`
|
|
: next?.type === 'card' && card?.effect === 'nullentropyBox' ? 'Pay 2 spice and search with Nullentropy Box'
|
|
: next?.type === 'card' && next.mode === 'choam' ? 'Play Kulon to extend the required movement'
|
|
: next?.type === 'card' ? 'Play Hajr to prepare the required movement'
|
|
: next?.type === 'endMovement' ? 'Finish movement while honoring No'
|
|
: `${next?.movementCard ? 'Use Ornithopter and move' : 'Move'} ${amount} forces to ${destinationLabel}, sector ${sector}`;
|
|
return <section className="notice space-y-3" aria-label="Your ground-movement promises">
|
|
<h4>Your ground-movement promises</h4>
|
|
{own.map((promise, index) => <p key={index}>{promise.answer ? 'Yes: you must' : 'No: you must not'} {movementClaimText(promise)} before this Movement turn ends.</p>)}
|
|
<p className="fine">One qualifying move fulfills Yes. No remains binding through every later Hajr or Ornithopter move. A paid Box search must finish before moving; its fee is paid only once. Opposing effects release an answer only if it becomes impossible.</p>
|
|
{next && <Button className="game-action min-h-11 whitespace-normal" disabled={busy} onClick={() => { if (!busy) act(next); }}>{label}</Button>}
|
|
</section>;
|
|
}
|