Preserve Emperor gift opportunity before bot phase pass
Verify and publish checkpoint container / container (push) Successful in 10m48s
Verify and publish checkpoint container / container (push) Successful in 10m48s
This commit is contained in:
1 parent
021a8c3e7f
commit
0c64d320ea
10 files changed
+238
-5
No files matched your search
@@ -0,0 +1,25 @@
|
||||
'use client';
|
||||
|
||||
import type {Action, GameView} from '@/game/engine';
|
||||
|
||||
/** This notice remains visible even when the Emperor has no spice to share. */
|
||||
export function EmperorPhaseOpeningPriority({game, act, busy}: {
|
||||
game: Pick<GameView, 'emperorPhaseOpeningPriority' | 'players'>;
|
||||
act: (action:Action) => void;
|
||||
busy: boolean;
|
||||
}) {
|
||||
const priority = game.emperorPhaseOpeningPriority;
|
||||
if (!priority) return null;
|
||||
const event = priority.event;
|
||||
const recipient = game.players.find(player => player.id === priority.recipient)?.name ?? 'their ally';
|
||||
const canContinue = !busy && priority.canContinue && !!event;
|
||||
return <section className="notice space-y-3" aria-label="Emperor phase opening opportunity" aria-live="polite">
|
||||
<h3>Emperor alliance opportunity</h3>
|
||||
<p>Before the phase begins, the Emperor may share spice with {recipient}.</p>
|
||||
{priority.canContinue
|
||||
? <button type="button" className="game-action" disabled={!canContinue}
|
||||
onClick={() => {if (canContinue && game.emperorPhaseOpeningPriority === priority && priority.canContinue && priority.event === event)
|
||||
act({type:'emperorPhaseOpeningContinue', event});}}>Continue to phase</button>
|
||||
: <p>Waiting for the Emperor to continue.</p>}
|
||||
</section>;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
import { SaphoArrivalOrder } from './sapho-arrival-order';
|
||||
import { SaphoStationPriority } from './sapho-station-priority';
|
||||
import { EmperorExtortionPriority } from './emperor-extortion-priority';
|
||||
import { EmperorPhaseOpeningPriority } from './emperor-phase-opening-priority';
|
||||
import { RicheseBidPromisePanel } from './richese-bid-promise-panel';
|
||||
import { EarlyRicheseBidPromises } from './early-richese-bid-promises';
|
||||
import { TravelPromises } from './travel-promises';
|
||||
@@ -2572,6 +2573,7 @@ export function GameTable({
|
||||
<span className="eyebrow">Phase opening</span>
|
||||
<h2>Before {PHASES[g.phase]}</h2>
|
||||
<EmperorTimingGift game={g} act={act} busy={busy} />
|
||||
<EmperorPhaseOpeningPriority game={g} act={act} busy={busy} />
|
||||
<p>
|
||||
Play Amal now, or pass to begin this phase. Phase effects wait
|
||||
until everyone has passed.
|
||||
|
||||
Reference in new issue
Block a user