Integrate full funded Guild Nexus Betrayal
This commit is contained in:
1 parent
d3bf12fcd8
commit
8a56299155
28 files changed
+3005
-58
No files matched your search
@@ -79,6 +79,7 @@ import { NullentropyBox, NullentropySearch } from './nullentropy-box';
|
||||
import { SemutaReaction } from './semuta-reaction';
|
||||
import { ChoamKull } from './choam-kull';
|
||||
import { NexusRicheseBetrayal } from './nexus-richese-betrayal';
|
||||
import { NexusGuildBetrayal } from './nexus-guild-betrayal';
|
||||
import { OrnithopterMovement } from './ornithopter-movement';
|
||||
import { DiscoveryOrnithopterMovement } from './discovery-flight-movement';
|
||||
import { PlanetologistMovement } from './planetologist-movement';
|
||||
@@ -302,8 +303,8 @@ export function GameTable({
|
||||
);
|
||||
const reactionBusy =
|
||||
transportBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot;
|
||||
const busy = reactionBusy || g.automaticContinuationPending || !!g.semutaReaction || !!g.kullReaction || !!g.richeseBetrayalReaction;
|
||||
const reactionOwnsControls = !!g.kullReaction || !!g.kullCounterEvent || !!g.richeseBetrayalReaction;
|
||||
const busy = reactionBusy || g.automaticContinuationPending || !!g.semutaReaction || !!g.kullReaction || !!g.richeseBetrayalReaction || !!g.guildBetrayalReaction;
|
||||
const reactionOwnsControls = !!g.kullReaction || !!g.kullCounterEvent || !!g.richeseBetrayalReaction || !!g.guildBetrayalReaction;
|
||||
const canActivateKarama = (card: Card) =>
|
||||
!g.karamaBlocked && canUseAsKaramaRole(g, me, card);
|
||||
const traitorBattle = g.battle;
|
||||
@@ -779,7 +780,16 @@ export function GameTable({
|
||||
count > 0 &&
|
||||
!botGroundMoveAllowed(g, me, key, boardLocation(selected, sector), 0),
|
||||
);
|
||||
const act = (a: Action) => void send(a);
|
||||
const act = (a: Action) => {
|
||||
const guildReaction = g.guildBetrayalReaction;
|
||||
if (guildReaction) {
|
||||
if (reactionBusy || g.status !== 'playing' || !guildReaction.canPass || guildReaction.hasPassed ||
|
||||
(a.type !== 'guildBetrayalPass' && a.type !== 'guildBetrayalUse') ||
|
||||
a.event !== guildReaction.event ||
|
||||
(a.type === 'guildBetrayalUse' && (!guildReaction.canUse || guildReaction.blocked))) return;
|
||||
}
|
||||
void send(a);
|
||||
};
|
||||
const choose = (id: string) => {
|
||||
const location = gameTerritories(g).find((candidate) => candidate.id === id);
|
||||
if (!location) return;
|
||||
@@ -1009,6 +1019,8 @@ export function GameTable({
|
||||
faction(g.players.find((p) => p.id === id)!.faction).name,
|
||||
)
|
||||
.join(' + ') || 'No winner'
|
||||
: g.guildBetrayalReaction
|
||||
? 'Shipment payment acknowledgement'
|
||||
: g.richeseBetrayalReaction
|
||||
? 'Richese auction acknowledgement'
|
||||
: g.kullReaction
|
||||
@@ -1054,6 +1066,15 @@ export function GameTable({
|
||||
<a href="/rules?topic=nexus-richese-betrayal#nexus-richese-betrayal">Preview rules and limits</a>
|
||||
</p>
|
||||
)}
|
||||
{g.guildBetrayalPreview && (
|
||||
<p className="notice" role="status">
|
||||
Guild Nexus Betrayal development preview · whole funded shipment
|
||||
payment replacement, including your own payment and occupied Junction.
|
||||
Classic factions with native Guild and Nexus; optional genuinely
|
||||
seeded Homeworlds only. Not complete Guild or certified Nexus rules.{' '}
|
||||
<a href="/rules?topic=nexus-guild-betrayal#nexus-guild-betrayal">Preview rules and limits</a>
|
||||
</p>
|
||||
)}
|
||||
{g.status !== 'lobby' && (
|
||||
<nav className="phase-track" aria-label="Turn phases">
|
||||
{PHASES.map((p, i) => (
|
||||
@@ -1086,7 +1107,7 @@ export function GameTable({
|
||||
<SpiceCardInspector card={g.spicePeek} context="Private foresight" />
|
||||
</section>
|
||||
)}
|
||||
<SeatAutopilot game={g} act={act} busy={transportBusy} />
|
||||
<SeatAutopilot game={g} act={act} busy={transportBusy || !!g.guildBetrayalReaction} />
|
||||
<DukeVidal game={g} />
|
||||
<EcazLoyaltyCard loyalty={g.ecazLoyalty} />
|
||||
<MoritaniTerrorSupply game={g} />
|
||||
@@ -1692,7 +1713,9 @@ export function GameTable({
|
||||
onSectorChange={setSector}
|
||||
/>
|
||||
</>}
|
||||
{g.richeseBetrayalReaction ? (
|
||||
{g.guildBetrayalReaction ? (
|
||||
<NexusGuildBetrayal game={g} act={act} busy={reactionBusy} />
|
||||
) : g.richeseBetrayalReaction ? (
|
||||
<NexusRicheseBetrayal game={g} act={act} busy={reactionBusy} />
|
||||
) : g.kullReaction ? (
|
||||
<ChoamKull game={g} act={act} busy={reactionBusy} />
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
'use client';
|
||||
|
||||
import type { Action, GameView } from '@/game/engine';
|
||||
import { nexusCardMode } from '@/game/nexus-cards';
|
||||
import { NexusCardFace } from './nexus-cards';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
export function NexusGuildBetrayal({ game, act, busy }: {
|
||||
game: GameView;
|
||||
act: (action: Action) => void;
|
||||
busy: boolean;
|
||||
}) {
|
||||
const reaction = game.guildBetrayalReaction;
|
||||
if (!reaction) return null;
|
||||
const shipper = game.players.find((player) => player.id === reaction.shipper);
|
||||
const canRespond = !!reaction.event && reaction.canPass && !reaction.hasPassed;
|
||||
const canUse = canRespond && reaction.canUse && !reaction.blocked;
|
||||
const disabled = busy || game.status !== 'playing';
|
||||
const own = game.players.find((player) => player.id === game.me);
|
||||
const ownGuildMode = game.nexusCards?.card === 'guild' && own
|
||||
? nexusCardMode('guild', own.faction, game.players.map((player) => player.faction))
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<section aria-label="Guild Nexus Betrayal response" className="notice min-w-0 space-y-3">
|
||||
<h3>Guild Nexus Betrayal · before shipment payment</h3>
|
||||
<p>{shipper?.name ?? 'The shipper'} has a pending shipment payment. No payment or force delivery has happened yet.</p>
|
||||
<p className="fine">
|
||||
Every publicly possible unallied responder acknowledges this boundary, regardless of their secret Nexus identity.
|
||||
Passing allows the original shipment after all required acknowledgements. Betrayal takes the whole original funded payment,
|
||||
including your own payment, instead of the Guild, Spice Bank or Junction occupier receiving it. It does not create another shipment.
|
||||
Your own refund cannot fund the upfront cost. This response reveals no private price, route or source.{' '}
|
||||
<a href="/rules?topic=nexus-guild-betrayal#nexus-guild-betrayal">Betrayal timing and preview limits</a>
|
||||
</p>
|
||||
{game.nexusCards?.card === 'guild' && <NexusCardFace card="guild" mode={ownGuildMode} />}
|
||||
{!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: 'guildBetrayalPass', event: reaction.event }); }}
|
||||
>
|
||||
Pass · allow the original shipment payment
|
||||
</Button>
|
||||
{canUse && (
|
||||
<Button
|
||||
className="game-action min-h-11 whitespace-normal"
|
||||
disabled={disabled}
|
||||
onClick={() => { if (!disabled) act({ type: 'guildBetrayalUse', event: reaction.event }); }}
|
||||
>
|
||||
Use Guild Nexus · take the whole shipment payment
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user