Allow Richese reveal during allied auction gifts
Verify and publish checkpoint container / container (push) Failing after 5m53s
Verify and publish checkpoint container / container (push) Failing after 5m53s
This commit is contained in:
1 parent
fac4915cb7
commit
e1209083e6
7 files changed
+215
-3
No files matched your search
@@ -61,6 +61,23 @@ export function richeseRevealInterruptSupported(g: Game): boolean {
|
||||
// receipt. Empty pending arrays do not represent a live child.
|
||||
const foreignMovement = richeseRevealForeignMovementPending(g);
|
||||
const revival = g.pendingRevival, decision = g.decision;
|
||||
const gift = g.pendingEmperorAuctionGift;
|
||||
const giftOwner = g.players.find(player => player.id === gift?.owner);
|
||||
const giftBuyer = g.players.find(player => player.id === gift?.recipient);
|
||||
const auctionGift = !!gift && g.phase === 3 && gift.turn === g.turn &&
|
||||
typeof gift.event === 'string' && !!gift.event && giftOwner?.faction === 'emperor' &&
|
||||
!!giftBuyer && giftOwner.ally === giftBuyer.id && giftBuyer.ally === giftOwner.id &&
|
||||
(gift.source === 'richese'
|
||||
? !decision && !g.auction && g.richeseAuction?.source === 'cache' &&
|
||||
gift.quote?.winner === giftBuyer.id
|
||||
: gift.source === undefined && decision?.kind === 'auctionPayment' &&
|
||||
decision.player === giftBuyer.id && g.auction?.bidder === giftBuyer.id && !g.richeseAuction) &&
|
||||
(!g.response ? gift.giftAmount === undefined :
|
||||
g.response.kind === 'emperorGift' && g.response.owner === giftOwner.id &&
|
||||
g.response.recipient === giftBuyer.id && g.response.emperorAuctionGiftEvent === gift.event &&
|
||||
g.response.amount === gift.giftAmount && Number.isSafeInteger(gift.giftAmount) && gift.giftAmount! > 0 &&
|
||||
Array.isArray(g.response.passed) && new Set(g.response.passed).size === g.response.passed.length &&
|
||||
g.response.passed.every(id => g.players.some(player => player.id === id)));
|
||||
let choamRevival = false;
|
||||
if (g.phase === 4 && decision?.kind === 'choamFreeRevival' &&
|
||||
Object.keys(decision).sort().join(',') === 'kind,player,recipient' &&
|
||||
@@ -74,7 +91,8 @@ export function richeseRevealInterruptSupported(g: Game): boolean {
|
||||
}
|
||||
}
|
||||
if (Object.entries(g).some(([key, value]) => key.startsWith('pending') &&
|
||||
!(key === 'pendingShipment' && guildRate) && !(key === 'pendingRevival' && choamRevival) && key !== foreignMovement &&
|
||||
!(key === 'pendingShipment' && guildRate) && !(key === 'pendingRevival' && choamRevival) &&
|
||||
!(key === 'pendingEmperorAuctionGift' && auctionGift) && 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) =>
|
||||
@@ -98,6 +116,7 @@ export function richeseRevealInterruptSupported(g: Game): boolean {
|
||||
g.mixedAllianceQuestions, g.mixedMovementQuestions, g.mixedTraitorQuestions, g.mixedBattleQuestions];
|
||||
if (mixed.some(rows => rows?.some(row => row.turn === g.turn && row.binding))) return false;
|
||||
|
||||
if (auctionGift) return !g.phaseOpening && !g.choamMarket;
|
||||
if (foreignMovement) return true;
|
||||
if (g.response) {
|
||||
// Only independent, un-nested native responses with a stable original
|
||||
|
||||
Reference in new issue
Block a user