Connect Tleilaxu Nexus free leader and paid force revival

This commit is contained in:
Quintine committed 2026-10-14 23:27:30 +11:00
1 parent 4bf6cfc875
commit 72e37a8978
22 files changed
+1589 -80

No files matched your search

+22
View File
@@ -1,5 +1,19 @@
import type { Action, GameView } from './engine';
export function nexusTleilaxuRevivalAction(
game:GameView,event:string,leader:string,amount:number,elite:number,
):Action|null {
const offer=game.nexusTleilaxu?.secretAlly;
const owner=game.players.find(p=>p.id===game.me);
if(!offer||offer.blocked||!owner||game.status!=='playing'||game.phase!==4||
owner.ally||game.nexusCards?.card!=='tleilaxu'||offer.event!==event||
!offer.leaders.some(candidate=>candidate.id===leader)||
!Number.isSafeInteger(amount)||amount<0||amount>offer.maxForces||amount>(owner.spice??0)||
!Number.isSafeInteger(elite)||elite<0||elite>amount||elite>offer.maxElite||
amount-elite>owner.tanks-(owner.elites?.tanks??0))return null;
return {type:'nexusTleilaxuRevival',event,leader,amount,elite};
}
/** The server's private offer binds the complete revealed replacement group.
* Do not reconstruct eligibility from private Face Dancer hands. */
export function nexusFaceDancersAction(
@@ -31,6 +45,14 @@ export function nexusFaceDancersAction(
/** All profiles share the legal replacement policy. There is no post-draw
* choice and no access to another player's hand or the reserve order. */
export function nexusTleilaxuBotActions(game: GameView): Action[] {
const revival=game.nexusTleilaxu?.secretAlly;
if(revival&&!revival.blocked&&revival.leaders.length) {
const owner=game.players.find(p=>p.id===game.me)!;
const amount=Math.min(revival.maxForces,owner.spice??0);
const elite=Math.max(0,amount-(owner.tanks-(owner.elites?.tanks??0)));
const action=nexusTleilaxuRevivalAction(game,revival.event,revival.leaders[0].id,amount,elite);
if(action)return [action];
}
const offer = game.nexusTleilaxu?.cunning;
const action = offer ? nexusFaceDancersAction(game, offer.event) : null;
return action ? [action] : [];