Support Sapho ordering for Great Maker votes
Verify and publish checkpoint container / container (push) Successful in 11m14s
Verify and publish checkpoint container / container (push) Successful in 11m14s
This commit is contained in:
1 parent
e81725e4b2
commit
77d02b3231
18 files changed
+798
-21
No files matched your search
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
import { SaphoArrivalOrder } from './sapho-arrival-order';
|
||||
import { SaphoStationPriority } from './sapho-station-priority';
|
||||
import { SaphoGreatMakerPriority } from './sapho-great-maker-priority';
|
||||
import { EmperorExtortionPriority } from './emperor-extortion-priority';
|
||||
import { EmperorPhaseOpeningPriority } from './emperor-phase-opening-priority';
|
||||
import { RicheseBidPromisePanel } from './richese-bid-promise-panel';
|
||||
@@ -397,7 +398,7 @@ export function GameTable({
|
||||
const harkonnenBetrayalOwnsControls = !!g.nexusHarkonnenBetrayalReaction &&
|
||||
!g.response && !g.decision && !g.truthtrance && !g.phaseOpening &&
|
||||
!g.automaticContinuationPending && !g.nexusCards?.waiting.length && !g.nexusTraitors?.pending;
|
||||
const busy = reactionBusy || !!g.saphoStationPriority || !!g.saphoArrivalOrder || !!g.victoryContinuation || !!g.nexusFremenRideBetrayal || g.automaticContinuationPending || !!g.semutaReaction || !!g.kullReaction || !!g.richeseBetrayalReaction || !!g.guildBetrayalReaction || !!g.nexusIxianReplacement || ixianBetrayalOwnsControls || harkonnenBetrayalOwnsControls;
|
||||
const busy = reactionBusy || !!g.saphoStationPriority || !!g.saphoGreatMakerPriority || !!g.saphoArrivalOrder || !!g.victoryContinuation || !!g.nexusFremenRideBetrayal || g.automaticContinuationPending || !!g.semutaReaction || !!g.kullReaction || !!g.richeseBetrayalReaction || !!g.guildBetrayalReaction || !!g.nexusIxianReplacement || ixianBetrayalOwnsControls || harkonnenBetrayalOwnsControls;
|
||||
const reactionOwnsControls = !!g.saphoArrivalOrder || !!g.nexusFremenRideBetrayal || !!g.kullReaction || !!g.kullCounterEvent || !!g.richeseBetrayalReaction || !!g.guildBetrayalReaction || !!g.nexusIxianReplacement || ixianBetrayalOwnsControls || harkonnenBetrayalOwnsControls;
|
||||
const canSpendKarama = (card: Card, purpose: KullPurpose) =>
|
||||
!kullPurposeBlock(g, purpose) && canUseAsKaramaRole(g, me, card);
|
||||
@@ -1545,6 +1546,8 @@ export function GameTable({
|
||||
{g.emperorExtortionPriority && <EmperorExtortionPriority game={g} act={act} busy={reactionBusy} />}
|
||||
{g.saphoStationPriority && <SaphoStationPriority game={g} act={act}
|
||||
busy={transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot} />}
|
||||
{g.saphoGreatMakerPriority && <SaphoGreatMakerPriority game={g} act={act}
|
||||
busy={transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot} />}
|
||||
{g.saphoArrivalOrder && <SaphoArrivalOrder view={g.saphoArrivalOrder} me={g.me}
|
||||
busy={transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot}
|
||||
name={id => g.players.find(player => player.id === id)?.name ?? id} act={act} />}
|
||||
@@ -4069,7 +4072,7 @@ export function GameTable({
|
||||
) : g.decision.kind === 'discoveryDiscard' ? (
|
||||
<DiscoveryDiscardDecision game={g} act={act} busy={transportBusy || (!!g.roomControl?.paused || !!g.roomControl?.closed) || !!me.autopilot} />
|
||||
) : g.decision.kind === 'greatMakerVote' || g.decision.kind === 'greatMakerRide' ? (
|
||||
<GreatMakerDecision game={g} act={act} busy={transportBusy || (!!g.roomControl?.paused || !!g.roomControl?.closed) || !!me.autopilot} />
|
||||
<GreatMakerDecision game={g} act={act} busy={transportBusy || !!g.saphoGreatMakerPriority || (!!g.roomControl?.paused || !!g.roomControl?.closed) || !!me.autopilot} />
|
||||
) : g.decision.kind === 'nexusFremenProtection' ? (
|
||||
<section aria-label="Fremen Nexus worm protection" className="space-y-3">
|
||||
<p className="muted">
|
||||
@@ -6132,8 +6135,8 @@ export function GameTable({
|
||||
<EcazSpecialKarama quote={g.ecazSpecialKarama ?? null} act={act} busy={busy} />
|
||||
<RicheseGift game={g} act={act} busy={busy} />
|
||||
<Distrans game={g} act={act} busy={busy} />
|
||||
<JuiceOfSapho game={g} act={act} busy={g.saphoStationPriority
|
||||
? transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot || !g.saphoStationPriority.canPass
|
||||
<JuiceOfSapho game={g} act={act} busy={g.saphoStationPriority || g.saphoGreatMakerPriority
|
||||
? transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot || !(g.saphoStationPriority?.canPass || g.saphoGreatMakerPriority?.canPass)
|
||||
: busy} />
|
||||
<NullentropyBox game={g} act={act} busy={busy} />
|
||||
<ResidualPoison game={g} act={act} busy={busy} />
|
||||
|
||||
@@ -17,8 +17,9 @@ export function GreatMakerDecision({ game, act, busy }: Props) {
|
||||
<section aria-label="Great Maker vote" className="space-y-3">
|
||||
<h3>Great Maker · Nexus vote</h3>
|
||||
<p>
|
||||
Vote in storm order. A majority must vote yes for this encounter to
|
||||
create a Nexus; a tie means no Nexus.
|
||||
Voting starts in storm order, subject to available order changes. A
|
||||
majority must vote yes for this encounter to create a Nexus; a tie
|
||||
means no Nexus.
|
||||
</p>
|
||||
{frame.votes.map((vote) => (
|
||||
<p key={vote.player}>
|
||||
|
||||
@@ -12,6 +12,8 @@ function unavailableReason(game: GameView) {
|
||||
return 'Order changes are available during play.';
|
||||
if (game.phase === 5)
|
||||
return 'Movement order supports clean combined-turn boundaries and queuing behind a started active turn. Your own started turn may be paused at a clean boundary and resumed last, with spent actions retained. Finish pending interactions and preparations first. The Advanced Guild retains its next timing choice; another player cannot displace an already granted Guild turn, and last remains after the Guild. A Karama-locked privilege stays locked. Completed turns and actual shipment and movement counters stay unchanged. Already-held positions and committed cards remain unavailable.';
|
||||
if (game.decision?.kind === 'greatMakerVote')
|
||||
return 'Change your position among the remaining Great Maker votes. Votes already cast remain; you cannot vote twice. This online priority is provisional.';
|
||||
if (game.truthtrance || game.response || game.phaseOpening ||
|
||||
(game.decision && !(game.phase === 8 && game.decision.kind === 'moritaniExtortion')))
|
||||
return 'Finish the current interaction before changing turn order.';
|
||||
@@ -68,7 +70,7 @@ export function SaphoOrderButton({
|
||||
>
|
||||
{option.scope === 'battleAggressor' ? 'Become aggressor and discard Juice of Sapho' :
|
||||
(option.scope === 'movement' || option.scope === 'revival' || option.scope === 'charity') && option.resumeOwn ? `Resume your ${option.scope} last and discard Juice of Sapho` :
|
||||
`${bidding ? 'Bid' : option.scope === 'battleOrder' ? 'Choose battles' : option.scope === 'extortion' ? 'Take your Extortion choice' : option.scope === 'testingStation' ? 'Take your Testing Station choice' : option.scope === 'revival' ? 'Take your Revival turn' : option.scope === 'charity' ? 'Take your Charity turn' : 'Take your movement turn'} ${option.mode} and discard Juice of Sapho`}
|
||||
`${bidding ? 'Bid' : option.scope === 'battleOrder' ? 'Choose battles' : option.scope === 'extortion' ? 'Take your Extortion choice' : option.scope === 'testingStation' ? 'Take your Testing Station choice' : option.scope === 'greatMakerVote' ? 'Cast your Great Maker vote' : option.scope === 'revival' ? 'Take your Revival turn' : option.scope === 'charity' ? 'Take your Charity turn' : 'Take your movement turn'} ${option.mode} and discard Juice of Sapho`}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -113,6 +115,7 @@ export function JuiceOfSapho({
|
||||
const aggressor = option.scope === 'battleAggressor';
|
||||
const extortion = option.scope === 'extortion';
|
||||
const testingStation = option.scope === 'testingStation';
|
||||
const greatMakerVote = option.scope === 'greatMakerVote';
|
||||
const revival = option.scope === 'revival';
|
||||
const charity = option.scope === 'charity';
|
||||
const resumeOwn = (option.scope === 'movement' || revival || charity) && option.resumeOwn;
|
||||
@@ -166,6 +169,8 @@ export function JuiceOfSapho({
|
||||
? `Take your Extortion choice ${option.mode} among unanswered players. Earlier declines and Moritani’s five-spice bank collection remain. You may decline instead of paying; the first actual three-spice payment ends all offers.`
|
||||
: testingStation
|
||||
? `Take your Testing Station choice ${option.mode}. Each occupant still chooses once; their adjustments apply in the selected order to the original storm movement. This priority is provisional.`
|
||||
: greatMakerVote
|
||||
? `Cast your Great Maker vote ${option.mode} among the remaining voters. Votes already cast stay finished; each player still votes once. This priority is provisional.`
|
||||
: cyclic
|
||||
? `Bid ${option.mode} in the current cyclic lot. Provisional duration: this lot only. Existing bids, funding and passes stay committed. Later circuits use the changed cycle; the next lot returns to its normal opener.`
|
||||
: once
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
'use client';
|
||||
|
||||
import type { Action } from '@/game/engine';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
/** The opportunity is public; card custody is projected separately to its owner. */
|
||||
export type SaphoGreatMakerPriorityView = {
|
||||
event: string;
|
||||
canPass: boolean;
|
||||
waiting: boolean;
|
||||
};
|
||||
|
||||
export type SaphoGreatMakerPriorityProps = {
|
||||
game: { saphoGreatMakerPriority?: SaphoGreatMakerPriorityView | null };
|
||||
act: (action: Action) => void;
|
||||
busy: boolean;
|
||||
};
|
||||
|
||||
export function SaphoGreatMakerPriority({ game, act, busy }: SaphoGreatMakerPriorityProps) {
|
||||
const view = game.saphoGreatMakerPriority;
|
||||
if (!view) return null;
|
||||
const event = view.event;
|
||||
const canAct = () => !busy && game.saphoGreatMakerPriority === view &&
|
||||
view.event === event && typeof event === 'string' && event.length > 0 && view.canPass;
|
||||
|
||||
return <section className="notice space-y-3" aria-label="Great Maker vote order" aria-live="polite">
|
||||
<h3>Great Maker vote order</h3>
|
||||
<p>Before the next vote, players may use an available order change from their own hand. Votes already cast stay finished.</p>
|
||||
{view.canPass ? <Button className="game-action min-h-11 whitespace-normal"
|
||||
data-testid="sapho-great-maker-priority-pass" disabled={!canAct()}
|
||||
onClick={() => { if (canAct()) act({ type: 'saphoGreatMakerPass', event }); }}>
|
||||
Continue without changing vote order
|
||||
</Button> : <p>{view.waiting ? 'Waiting for the other players to continue.' : 'Your response has been recorded.'}</p>}
|
||||
</section>;
|
||||
}
|
||||
Reference in new issue
Block a user