Connect Basic Revival gift and arrival continuations
Verify and publish checkpoint container / container (push) Successful in 11m37s
Verify and publish checkpoint container / container (push) Successful in 11m37s
This commit is contained in:
1 parent
6acf2c200c
commit
2cea251afd
10 files changed
+520
-6
No files matched your search
@@ -2,6 +2,7 @@ import type { Game } from './engine';
|
||||
import { validateFremenRevivalGrant } from './fremen-revival-grant';
|
||||
import { richeseRevealForeignMovementPending } from './richese-reveal-foreign-movement';
|
||||
import { eliteRevivalRemaining, paidForceRevivalCost, revivalPrevented } from './revival';
|
||||
import { quoteRevivalResume, RevivalResumeError } from './revival-resume';
|
||||
|
||||
const factions = new Set([
|
||||
'atreides', 'beneGesserit', 'emperor', 'fremen', 'guild', 'harkonnen',
|
||||
@@ -55,8 +56,21 @@ export function richeseRevealInterruptSupported(g: Game): boolean {
|
||||
// Each other pending field is an active child/continuation, not a completed
|
||||
// receipt. Empty pending arrays do not represent a live child.
|
||||
const foreignMovement = richeseRevealForeignMovementPending(g);
|
||||
const revival = g.pendingRevival, decision = g.decision;
|
||||
let choamRevival = false;
|
||||
if (g.phase === 4 && decision?.kind === 'choamFreeRevival' &&
|
||||
Object.keys(decision).sort().join(',') === 'kind,player,recipient' &&
|
||||
g.players.some(player => player.id === decision.player && player.faction === 'choam') &&
|
||||
revival?.kind === 'forces' && revival.player === decision.recipient &&
|
||||
decision.player !== revival.player && revival.free > 0 && !revival.emperorExtra &&
|
||||
!revival.nexusEmperorEvent && !g.response && !g.phaseOpening && !g.choamMarket) {
|
||||
try { quoteRevivalResume(g, 'stop'); choamRevival = true; }
|
||||
catch (error) {
|
||||
if (!(error instanceof RevivalResumeError)) throw error;
|
||||
}
|
||||
}
|
||||
if (Object.entries(g).some(([key, value]) => key.startsWith('pending') &&
|
||||
!(key === 'pendingShipment' && guildRate) && key !== foreignMovement &&
|
||||
!(key === 'pendingShipment' && guildRate) && !(key === 'pendingRevival' && choamRevival) && key !== foreignMovement &&
|
||||
(Array.isArray(value) ? value.length > 0 : value !== null && value !== undefined && value !== false))) return false;
|
||||
|
||||
const live = (rows: readonly {turn: number; fulfilled?: boolean; released?: boolean}[] | undefined) =>
|
||||
@@ -154,8 +168,8 @@ export function richeseRevealInterruptSupported(g: Game): boolean {
|
||||
}
|
||||
if (g.phaseOpening)
|
||||
return g.expansions.includes('ix') && !!g.amalWindowOpen && !g.decision && !g.choamMarket;
|
||||
const decision = g.decision;
|
||||
if (!decision) return false;
|
||||
if (decision.kind === 'choamFreeRevival') return choamRevival;
|
||||
if (decision.kind === 'auctionPayment')
|
||||
return g.phase === 3 && !!g.auction && g.auction.bidder === decision.player && !g.richeseAuction && !g.choamMarket;
|
||||
if (decision.kind === 'richeseDeclaration' || decision.kind === 'richeseCacheTerms' ||
|
||||
|
||||
Reference in new issue
Block a user