Allow late Mentat bribes and retain turn-end promises

This commit is contained in:
Quintine committed 2026-10-26 15:41:10 +11:00
1 parent f5ae61f382
commit c81e00e6dd
19 files changed
+590 -51

No files matched your search

+9 -2
View File
@@ -7,10 +7,10 @@ export interface BribeOptions {
targets: { id: string; maximum: number; limitation: string | null }[];
}
/** Mirror only the existing bribe timing gates; bribes are allowed out of turn. */
/** Ordinary bribes remain out of turn, including after Mentat's opening
* collection. Late receipts wait for the next opening, not another collection. */
export function bribeTimingBlock(g: Game): string | null {
if (g.status !== 'playing') return 'Bribes require a game in progress.';
if (g.phase === 8) return 'Bribes cannot be made during Mentat Pause.';
if (g.inflation?.side === 'double') return 'Bribes are prohibited while Inflation shows Double.';
if (g.pendingTreacheryDiscard || g.pendingNullentropy || g.bureaucratPayments?.pending ||
['name', 'reveal'].includes(g.battle?.mentatQuestion?.stage ?? '') ||
@@ -21,6 +21,13 @@ export function bribeTimingBlock(g: Game): string | null {
return null;
}
/** The existing automatic token lifecycle will turn an unflipped Cancel into
* Double at this opening. An owed payment must precede that known closure. */
export function bribesCloseBeforeNextMentat(g: Pick<Game, 'turn' | 'inflation'>): boolean {
const token = g.inflation;
return !!token && token.updatedTurn < g.turn && !token.flipped && token.side === 'cancel';
}
/** Payment only removes spendable spice, so a preserved completion is monotonic. */
export function maximumBribe(available: number, preservesCommitments: (amount: number) => boolean): number {
let low = 0, high = Math.max(0, Math.floor(available));