Prototype neutral Semuta reactions on clean ordinary discards
This commit is contained in:
1 parent
55b47ce039
commit
9ea50a792e
18 files changed
+908
-20
No files matched your search
@@ -76,6 +76,7 @@ import { BureaucratPayment } from './bureaucrat-payment';
|
||||
import { Bribes } from './bribes';
|
||||
import { SukGraduatePanel } from './suk-graduate';
|
||||
import { NullentropyBox, NullentropySearch } from './nullentropy-box';
|
||||
import { SemutaReaction } from './semuta-reaction';
|
||||
import { OrnithopterMovement } from './ornithopter-movement';
|
||||
import { DiscoveryOrnithopterMovement } from './discovery-flight-movement';
|
||||
import { PlanetologistMovement } from './planetologist-movement';
|
||||
@@ -297,8 +298,9 @@ export function GameTable({
|
||||
]
|
||||
: [],
|
||||
);
|
||||
const busy =
|
||||
transportBusy || (!!g.roomControl?.paused || !!g.roomControl?.closed) || !!me.autopilot || g.automaticContinuationPending;
|
||||
const reactionBusy =
|
||||
transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot;
|
||||
const busy = reactionBusy || g.automaticContinuationPending || !!g.semutaReaction;
|
||||
const traitorBattle = g.battle;
|
||||
const traitorBeneficiary =
|
||||
traitorBattle &&
|
||||
@@ -1002,6 +1004,8 @@ export function GameTable({
|
||||
faction(g.players.find((p) => p.id === id)!.faction).name,
|
||||
)
|
||||
.join(' + ') || 'No winner'
|
||||
: g.semutaReaction
|
||||
? 'Fresh discard response'
|
||||
: g.automaticContinuationPending
|
||||
? 'Completing the card action'
|
||||
: g.truthtrance
|
||||
@@ -1613,6 +1617,7 @@ export function GameTable({
|
||||
</div>
|
||||
{g.battle?.revealed && <a className="battle-display-link" href="#revealed-battle-plans">Compare revealed battle plans</a>}
|
||||
<PrivateBattlePlan game={g} />
|
||||
{g.semutaReaction && <SemutaReaction game={g} act={act} busy={reactionBusy} />}
|
||||
<NexusCards game={g} act={act} busy={busy} />
|
||||
<Recruits game={g} act={act} busy={busy} />
|
||||
<NexusTraitors game={g} act={act} busy={transportBusy || (!!g.roomControl?.paused || !!g.roomControl?.closed) || !!me.autopilot} />
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
'use client';
|
||||
|
||||
import type { Action, GameView } from '@/game/engine';
|
||||
import { CardInspector, CardRules } from './card-inspector';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
export function SemutaReaction({
|
||||
game,
|
||||
act,
|
||||
busy,
|
||||
}: {
|
||||
game: GameView;
|
||||
act: (action: Action) => void;
|
||||
busy: boolean;
|
||||
}) {
|
||||
const reaction = game.semutaReaction;
|
||||
if (!reaction) return null;
|
||||
|
||||
return (
|
||||
<section aria-label="Semuta Drug response" className="notice min-w-0 space-y-3">
|
||||
<h4>Fresh Treachery discard</h4>
|
||||
<p className="fine">
|
||||
Response event <code>{reaction.event}</code>
|
||||
</p>
|
||||
{reaction.stage === 'offer' ? (
|
||||
<>
|
||||
<p>A Treachery card was just discarded. Continue when you are ready.</p>
|
||||
{reaction.blocked && <p className="fine">{reaction.blocked}</p>}
|
||||
{reaction.passed ? (
|
||||
<p aria-live="polite">You continued. Waiting for other seats.</p>
|
||||
) : (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button
|
||||
className="game-action min-h-11 whitespace-normal"
|
||||
disabled={busy}
|
||||
onClick={() => {
|
||||
if (!busy) act({ type: 'semutaPass', event: reaction.event });
|
||||
}}
|
||||
>
|
||||
Continue
|
||||
</Button>
|
||||
{reaction.canCommit && (
|
||||
<Button
|
||||
className="game-action min-h-11 whitespace-normal"
|
||||
disabled={busy}
|
||||
onClick={() => {
|
||||
if (!busy) act({ type: 'semutaCommit', event: reaction.event });
|
||||
}}
|
||||
>
|
||||
Commit Semuta Drug
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : reaction.candidates.length ? (
|
||||
<>
|
||||
<p>
|
||||
You committed Semuta Drug. Choose one eligible freshly discarded
|
||||
Treachery card to claim. This choice cannot be declined or canceled.
|
||||
</p>
|
||||
<div
|
||||
className="grid min-w-0 gap-4"
|
||||
style={{ gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 16rem), 1fr))' }}
|
||||
>
|
||||
{reaction.candidates.map((card) => (
|
||||
<article
|
||||
key={card.id}
|
||||
className="flex min-w-0 flex-col gap-3 rounded-lg border border-[#65644b] p-4"
|
||||
>
|
||||
<h5 className="m-0 break-words font-serif text-lg">{card.name}</h5>
|
||||
<p className="fine">Card ID: {card.id}</p>
|
||||
<CardRules card={card} />
|
||||
<CardInspector card={card} />
|
||||
<Button
|
||||
className="game-action min-h-11 whitespace-normal"
|
||||
disabled={busy}
|
||||
onClick={() => {
|
||||
if (!busy)
|
||||
act({ type: 'semutaSelect', event: reaction.event, card: card.id });
|
||||
}}
|
||||
>
|
||||
Claim {card.name} ({card.id})
|
||||
</Button>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<p aria-live="polite">Waiting for the Semuta Drug claim to finish.</p>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user