Implement Tleilaxu and Ixian Nexus Cunning with durable private recovery

This commit is contained in:
Quintine committed 2026-09-10 10:49:18 +10:00
1 parent d5830d260c
commit 40912498b1
32 files changed
+2761 -24

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
import type { Action, GameView } from './engine';
/** Use only the private current battle offer; the server checks existing
* commitments before offering changed Suboid strength/support. */
export function nexusSuboidsAction(
game: GameView,
event: string,
): Action | null {
const offer = game.nexusSuboids?.offer;
const owner = game.players.find((player) => player.id === game.me);
const battle = game.battle;
if (
game.status !== 'playing' ||
game.phase !== 6 ||
!owner ||
owner.faction !== 'ixians' ||
owner.ally ||
game.nexusCards?.card !== 'ixians' ||
game.truthtrance ||
game.nexusCards.waiting.length ||
game.nexusTraitors?.pending ||
!battle ||
![battle.attacker, battle.defender].includes(owner.id) ||
battle.submitted.includes(owner.id) ||
game.nexusSuboids?.active ||
!offer ||
!event ||
offer.event !== event ||
offer.blocked
)
return null;
return { type: 'nexusSuboids', event };
}
export function nexusSuboidBotActions(game: GameView): Action[] {
const offer = game.nexusSuboids?.offer;
const action = offer ? nexusSuboidsAction(game, offer.event) : null;
return action ? [action] : [];
}