Prototype Emperor Nexus bank-auction purchase

This commit is contained in:
Quintine committed 2026-09-28 13:38:49 +10:00
1 parent 23ce406872
commit 1bda2ec31e
18 files changed
+916 -49

No files matched your search

+35
View File
@@ -29,3 +29,38 @@ export function nexusEmperorRevivalAction(
return null;
return { type: 'nexusEmperorRevive', event: offer.event, elite };
}
/** Spend the physical card only at the owner's completed, personally funded auction payment. */
export function nexusEmperorPurchaseAction(game: GameView): Action | null {
const offer = game.nexusEmperorSecretAlly;
const purchase = offer?.purchase;
const owner = game.players.find((player) => player.id === game.me);
if (
!offer ||
!purchase ||
purchase.blocked ||
!owner ||
owner.ally ||
game.nexusCards?.card !== 'emperor' ||
game.players.some((player) => player.faction === 'emperor') ||
game.status !== 'playing' ||
game.phase !== 3 ||
game.decision?.kind !== 'auctionPayment' ||
game.decision.player !== game.me ||
game.response ||
game.truthtrance ||
game.phaseOpening ||
game.automaticContinuationPending ||
game.nexusCards.waiting.length ||
game.nexusTraitors?.pending ||
!Number.isSafeInteger(purchase.price) ||
purchase.price < 1 ||
!game.auction ||
game.auction.bidder !== game.me ||
game.auction.bid !== purchase.price ||
(game.auction.allyPayment ?? 0) !== 0 ||
(owner.spice ?? 0) < purchase.price
)
return null;
return { type: 'nexusEmperorPurchase', event: offer.event };
}