Connect CHOAM Nexus Betrayal random discard

This commit is contained in:
Quintine committed 2026-09-27 21:54:55 +10:00
1 parent 90c5c7af25
commit 0bf61c8067
12 files changed
+709

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import type { Action, GameView } from './engine';
/** Bind the action to the private projected offer, never to a client-picked hand card. */
export function nexusChoamBetrayalAction(game: GameView): Action | null {
const offer = game.nexusChoamBetrayal;
const owner = game.players.find((player) => player.id === game.me);
if (
game.status !== 'playing' ||
game.automaticContinuationPending ||
!owner ||
owner.ally ||
game.nexusCards?.card !== 'choam' ||
!offer ||
!offer.event ||
offer.blocked ||
!game.players.some((player) => player.id === offer.target.id && player.faction === 'choam')
) return null;
return { type: 'nexusChoamBetrayal', event: offer.event };
}
/** Bots use only Bidding's public hand count, avoiding blind invalid attempts. */
export function nexusChoamBetrayalBotActions(game: GameView): Action[] {
if (game.phase !== 3) return [];
const action = nexusChoamBetrayalAction(game);
return action ? [action] : [];
}