Fresh Richese-roster battles support clean aggressor changes after plans and revelation. Both combatants explicitly finish a public final opportunity regardless of held cards or result; an actual Sapho use clears both marks with a fresh event. Close priority before physical Stone allocation and other outcome settlement. Preserve plans, votes, participants, Habbanya priority and reserved physical cards. Keep old unstamped timing and discard signature bytes. Route all final vote exits through native Homeworld defense first. Add persistent controls and finite minimal bot readiness. Validation:16-file177/177, types/lint/build and eight original-action/rendered-table programmes. Actual cache1 and paid forces use40 Basic/47 Advanced source actions; genuine Stone1 turn1/Sapho1 turn2 uses86. Ordinary and mixed count2 ties change through sealed-plan/final-window Sapho, explicit revised acknowledgements and native losses. Sixteen minimal proposals are legal; controlled reservation and pure window/control cases are separate. Bounded review fixed the Harkonnen Nexus final-vote route; frozen feedback corrected four historical fixture assumptions. All checks then passed together. Final-window protocol is provisional. Direct late Semuta claim/capture, combined World/Nexus/Sapho, wider combinations, full modes, final assurance and browser/deployed acceptance remain open. No saved-room/database/reset/restart/deployment operation.
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
'use client';
|
|
|
|
import type { BattleOutcomeWindow } from '@/game/battle-outcome-window';
|
|
import { Button } from './ui/button';
|
|
|
|
export function BattleOutcomeWindowControls({
|
|
window,
|
|
me,
|
|
players,
|
|
busy,
|
|
onReady,
|
|
}: {
|
|
window: BattleOutcomeWindow;
|
|
me: string;
|
|
players: readonly { id: string; name: string }[];
|
|
busy: boolean;
|
|
onReady: (event: string) => void;
|
|
}) {
|
|
const combatants = [window.attacker, window.defender];
|
|
const participant = combatants.includes(me);
|
|
const ownReady = window.ready.includes(me);
|
|
return (
|
|
<section className="my-4 flex min-w-0 flex-col gap-3" aria-label="Final battle actions" data-event={window.event}>
|
|
<h3>Final battle actions</h3>
|
|
<p>
|
|
Play any optional final battle card you want to use, then finish.
|
|
Battle resolution waits for both players.
|
|
</p>
|
|
<p className="notice">
|
|
If Juice of Sapho changes the aggressor, both finished marks are
|
|
cleared and both players get a fresh final opportunity.
|
|
</p>
|
|
<ul aria-label="Final battle action status">
|
|
{combatants.map(player => (
|
|
<li key={player}>
|
|
{players.find(seat => seat.id === player)?.name ?? player}:{' '}
|
|
{window.ready.includes(player) ? 'Finished' : 'Choosing final actions'}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
{participant && (
|
|
<Button
|
|
className="min-h-11 whitespace-normal motion-reduce:transition-none"
|
|
disabled={busy || window.closed || ownReady}
|
|
onClick={() => {
|
|
if (!participant || busy || window.closed || ownReady) return;
|
|
onReady(window.event);
|
|
}}
|
|
>
|
|
Finish final battle actions
|
|
</Button>
|
|
)}
|
|
</section>
|
|
);
|
|
}
|