Implement bounded Richese Nexus Betrayal auctions
This commit is contained in:
1 parent
a921c0da9b
commit
9c0000e469
25 files changed
+2208
-39
No files matched your search
@@ -78,6 +78,7 @@ import { SukGraduatePanel } from './suk-graduate';
|
||||
import { NullentropyBox, NullentropySearch } from './nullentropy-box';
|
||||
import { SemutaReaction } from './semuta-reaction';
|
||||
import { ChoamKull } from './choam-kull';
|
||||
import { NexusRicheseBetrayal } from './nexus-richese-betrayal';
|
||||
import { OrnithopterMovement } from './ornithopter-movement';
|
||||
import { DiscoveryOrnithopterMovement } from './discovery-flight-movement';
|
||||
import { PlanetologistMovement } from './planetologist-movement';
|
||||
@@ -301,8 +302,8 @@ export function GameTable({
|
||||
);
|
||||
const reactionBusy =
|
||||
transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot;
|
||||
const busy = reactionBusy || g.automaticContinuationPending || !!g.semutaReaction || !!g.kullReaction;
|
||||
const kullOwnsControls = !!g.kullReaction || !!g.kullCounterEvent;
|
||||
const busy = reactionBusy || g.automaticContinuationPending || !!g.semutaReaction || !!g.kullReaction || !!g.richeseBetrayalReaction;
|
||||
const reactionOwnsControls = !!g.kullReaction || !!g.kullCounterEvent || !!g.richeseBetrayalReaction;
|
||||
const canActivateKarama = (card: Card) =>
|
||||
!g.karamaBlocked && canUseAsKaramaRole(g, me, card);
|
||||
const traitorBattle = g.battle;
|
||||
@@ -1008,6 +1009,8 @@ export function GameTable({
|
||||
faction(g.players.find((p) => p.id === id)!.faction).name,
|
||||
)
|
||||
.join(' + ') || 'No winner'
|
||||
: g.richeseBetrayalReaction
|
||||
? 'Richese auction acknowledgement'
|
||||
: g.kullReaction
|
||||
? 'CHOAM Karama response'
|
||||
: g.semutaReaction
|
||||
@@ -1035,6 +1038,14 @@ export function GameTable({
|
||||
<a href="/rules?topic=choam-kull#choam-kull">Preview rules and limits</a>
|
||||
</p>
|
||||
)}
|
||||
{g.richeseBetrayalPreview && (
|
||||
<p className="notice" role="status">
|
||||
Richese Nexus Betrayal development preview · public cache self-purchase
|
||||
veto and ordinary other-buyer sale diversion only; not complete Richese
|
||||
or certified Nexus rules.{' '}
|
||||
<a href="/rules?topic=nexus-richese-betrayal#nexus-richese-betrayal">Preview rules and limits</a>
|
||||
</p>
|
||||
)}
|
||||
{g.status !== 'lobby' && (
|
||||
<nav className="phase-track" aria-label="Turn phases">
|
||||
{PHASES.map((p, i) => (
|
||||
@@ -1630,9 +1641,9 @@ export function GameTable({
|
||||
</div>
|
||||
{g.battle?.revealed && <a className="battle-display-link" href="#revealed-battle-plans">Compare revealed battle plans</a>}
|
||||
<PrivateBattlePlan game={g} />
|
||||
{!kullOwnsControls && g.semutaReaction && <SemutaReaction game={g} act={act} busy={reactionBusy} />}
|
||||
{!reactionOwnsControls && g.semutaReaction && <SemutaReaction game={g} act={act} busy={reactionBusy} />}
|
||||
{g.karamaBlocked && <p className="notice" role="status">{g.karamaBlocked}</p>}
|
||||
{!kullOwnsControls && <>
|
||||
{!reactionOwnsControls && <>
|
||||
<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} />
|
||||
@@ -1673,7 +1684,9 @@ export function GameTable({
|
||||
onSectorChange={setSector}
|
||||
/>
|
||||
</>}
|
||||
{g.kullReaction ? (
|
||||
{g.richeseBetrayalReaction ? (
|
||||
<NexusRicheseBetrayal game={g} act={act} busy={reactionBusy} />
|
||||
) : g.kullReaction ? (
|
||||
<ChoamKull game={g} act={act} busy={reactionBusy} />
|
||||
) : g.nexusCards?.waiting.length ? (
|
||||
<p className="muted">The next phase begins when the remaining Nexus card choices are finished.</p>
|
||||
@@ -5083,7 +5096,7 @@ export function GameTable({
|
||||
: ' · Flips at the next Mentat Pause'}
|
||||
</p>
|
||||
)}
|
||||
{!kullOwnsControls && <Bribes game={g} act={act} busy={busy} />}
|
||||
{!reactionOwnsControls && <Bribes game={g} act={act} busy={busy} />}
|
||||
<TruthHistory game={g} />
|
||||
<HarkonnenExchangeInspection game={g} />
|
||||
<section className="player-console">
|
||||
@@ -5105,7 +5118,7 @@ export function GameTable({
|
||||
</button>
|
||||
))}
|
||||
</nav>
|
||||
{panel === 'hand' && kullOwnsControls ? (
|
||||
{panel === 'hand' && reactionOwnsControls ? (
|
||||
<HandBrowser key={`${g.code}:${me.id}`} cards={me.hand ?? []} empty={<p className="muted">Your Treachery hand is empty.</p>}>
|
||||
{(card) => (
|
||||
<article className="treachery-card" key={card.id}>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
'use client';
|
||||
|
||||
import type { Action, GameView } from '@/game/engine';
|
||||
import { CardInspector, CardRules } from './card-inspector';
|
||||
import { NexusCardFace } from './nexus-cards';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
export function NexusRicheseBetrayal({ game, act, busy }: {
|
||||
game: GameView;
|
||||
act: (action: Action) => void;
|
||||
busy: boolean;
|
||||
}) {
|
||||
const reaction = game.richeseBetrayalReaction;
|
||||
if (!reaction) return null;
|
||||
const target = game.players.find((player) => player.id === reaction.target);
|
||||
const buyer = game.players.find((player) => player.id === reaction.buyer);
|
||||
const canRespond = reaction.canPass && !reaction.hasPassed;
|
||||
const canUse = canRespond && reaction.canUse && !reaction.blocked;
|
||||
const disabled = busy || game.status !== 'playing';
|
||||
// The receipt grants no card-face entitlement. Only the already-public cache
|
||||
// face is shown; a Black Market face is never inferred from a seller's hand.
|
||||
const card = reaction.source === 'cache' && game.richeseAuction?.source === 'cache'
|
||||
? game.richeseAuction.card
|
||||
: null;
|
||||
|
||||
return (
|
||||
<section aria-label="Richese Nexus Betrayal response" className="notice min-w-0 space-y-3">
|
||||
<h3>Richese Nexus Betrayal · before payment</h3>
|
||||
<p>
|
||||
{buyer?.name ?? 'The buyer'} won {reaction.source === 'cache' ? 'the public cache lot' : 'the concealed Black Market lot'} for {reaction.price} spice.
|
||||
{reaction.kind === 'purchase'
|
||||
? ` ${target?.name ?? 'Richese'} is buying its own cache card. Betrayal discards that card without payment or delivery.`
|
||||
: ` Payment would go to ${target?.name ?? 'Richese'}. Betrayal sends the same payment to the Spice Bank instead; the buyer still receives the card.`}
|
||||
</p>
|
||||
{card && <div className="space-y-2"><CardRules card={card} /><CardInspector card={card} /></div>}
|
||||
{reaction.source === 'blackMarket' && <p>The card remains face down; this response does not grant inspection.</p>}
|
||||
<p className="fine">
|
||||
Every publicly possible unallied responder acknowledges this boundary, regardless of their secret Nexus identity.
|
||||
Passing continues the original auction after all required acknowledgements; no payment or acquisition has happened yet.{' '}
|
||||
<a href="/rules?topic=nexus-richese-betrayal#nexus-richese-betrayal">Betrayal timing and preview limits</a>
|
||||
</p>
|
||||
{!canRespond ? (
|
||||
<p aria-live="polite">{reaction.hasPassed ? 'You have passed. Waiting for the remaining acknowledgements.' : 'Waiting for the required acknowledgements.'}</p>
|
||||
) : (
|
||||
<>
|
||||
{reaction.blocked && <p className="fine">{reaction.blocked}</p>}
|
||||
<Button
|
||||
className="game-action min-h-11 whitespace-normal"
|
||||
disabled={disabled}
|
||||
onClick={() => { if (!disabled) act({ type: 'richeseBetrayalPass', event: reaction.event }); }}
|
||||
>
|
||||
Pass · allow the original purchase
|
||||
</Button>
|
||||
{canUse && (
|
||||
<div className="space-y-3">
|
||||
{game.nexusCards?.card === 'richese' && <NexusCardFace card="richese" mode="betrayal" />}
|
||||
<Button
|
||||
className="game-action min-h-11 whitespace-normal"
|
||||
disabled={disabled}
|
||||
onClick={() => { if (!disabled) act({ type: 'richeseBetrayalUse', event: reaction.event }); }}
|
||||
>
|
||||
{reaction.kind === 'purchase' ? 'Use Richese Nexus · discard purchase without payment' : 'Use Richese Nexus · divert payment to Spice Bank'}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user