Support Advanced early cache bid promises
Verify and publish checkpoint container / container (push) Successful in 11m48s
Verify and publish checkpoint container / container (push) Successful in 11m48s
This commit is contained in:
1 parent
1a65e69932
commit
225b2174ad
14 files changed
+1071
-22
No files matched your search
@@ -1,4 +1,12 @@
|
||||
import type { RicheseBidPromise } from './richese-bid-promises';
|
||||
import { bidPromiseModeSupported } from './bid-promises';
|
||||
|
||||
/** Early cache questions support the existing Basic profile and the bare
|
||||
* Advanced CHOAM deck. Other Advanced module/semuta profiles stay separate. */
|
||||
export function earlyRicheseBidModeSupported(game: Parameters<typeof bidPromiseModeSupported>[0]): boolean {
|
||||
return !game.kullPreview && bidPromiseModeSupported({...game,semutaPreview:undefined}) &&
|
||||
(!game.advanced || !game.semutaPreview && game.expansions.length === 1 && game.expansions[0] === 'choam');
|
||||
}
|
||||
|
||||
/** A single bid in the first actual cache auction of this turn, before its
|
||||
* card, method, direction and public event have been chosen. */
|
||||
|
||||
+118
-12
@@ -35,7 +35,7 @@ import { RicheseBidPromiseError, richeseBidCompletionRange, richeseBidRequired,
|
||||
liveRicheseBidPromises, reconcileRicheseBidPromises, finishRicheseBidLot, validateRicheseBidPromises,
|
||||
type RicheseBidClaim, type RicheseBidPromise, type RicheseBidOpportunity } from './richese-bid-promises';
|
||||
import { jointRicheseBidCompletionRange } from './joint-richese-bids';
|
||||
import { EarlyRicheseBidError, earlyRicheseBidAnswerOptions, bindEarlyRicheseBid,
|
||||
import { EarlyRicheseBidError, earlyRicheseBidModeSupported, earlyRicheseBidAnswerOptions, bindEarlyRicheseBid,
|
||||
attachEarlyRicheseBids, liveEarlyRicheseBidPromises, reconcileEarlyRicheseBids,
|
||||
validateEarlyRicheseBidPromises, type EarlyRicheseBidClaim, type EarlyRicheseBidPromise } from './early-richese-bid';
|
||||
import { quoteJointEarlyRicheseBids } from './joint-early-richese-bids';
|
||||
@@ -2012,6 +2012,8 @@ export type Game = {
|
||||
jointOrdinaryPhaseBid?: true;
|
||||
/** Fresh waiting cache/all-auction answer; absent on older receipts. */
|
||||
jointEarlyPhaseBid?: true;
|
||||
/** Fresh Advanced pre-Bidding cache/phase answer and its ledgers. */
|
||||
advancedEarlyCacheTruth?: true;
|
||||
resume: NonNullable<Game['pendingNullentropy']>['resume'];
|
||||
promise:
|
||||
| { kind: 'shipment'; index: number; value: ShipmentPromise }
|
||||
@@ -8070,6 +8072,8 @@ function truthtranceDiscardSignature(g: Game, next: TruthDiscardContinuation) {
|
||||
bidPromises:g.bidPromises,mixedBidQuestions:g.mixedBidQuestions} : {}),
|
||||
...(next.jointEarlyPhaseBid ? {jointEarlyPhaseBid:true,phaseAnyBidPromises:g.phaseAnyBidPromises,
|
||||
earlyRicheseBidPromises:g.earlyRicheseBidPromises} : {}),
|
||||
...(next.advancedEarlyCacheTruth ? {advancedEarlyCacheTruth:true,phaseAnyBidPromises:g.phaseAnyBidPromises,
|
||||
earlyRicheseBidPromises:g.earlyRicheseBidPromises} : {}),
|
||||
...(next.record.question.kind === 'mixedRevival' ? {
|
||||
mixedRevivalQuestions: g.mixedRevivalQuestions, revivalExpressionPromises: g.revivalExpressionPromises,
|
||||
} : {}),
|
||||
@@ -8153,6 +8157,7 @@ function finishTruthtranceAnswer(g: Game) {
|
||||
record,
|
||||
remaining,
|
||||
...(advancedTruthAuctionSupported(g,record.question.kind) ? {advancedAuctionTruth:true as const} : {}),
|
||||
...(advancedEarlyCacheTruthSupported(g,record.question.kind) ? {advancedEarlyCacheTruth:true as const} : {}),
|
||||
...(supportedRicheseTruthLot(g) || advancedTruthAuctionSupported(g,record.question.kind) &&
|
||||
supportedSaphoRicheseTruthLot(g) ? {richeseLotEvent:g.richeseAuction!.event} : {}),
|
||||
...(g.richeseAuction && ['phaseAnyBid','richeseBid','mixedRicheseBid'].includes(record.question.kind) &&
|
||||
@@ -9194,6 +9199,9 @@ function treacheryDiscardIntegrity(g: Game) {
|
||||
'The consumed Truthtrance does not match its completed answer history.',
|
||||
);
|
||||
const remaining = c.remaining;
|
||||
requireRule(!c.advancedEarlyCacheTruth || c.advancedEarlyCacheTruth === true &&
|
||||
advancedEarlyCacheTruthSupported(g,record.question.kind),
|
||||
'The completed Truthtrance no longer matches its original Advanced cache question.');
|
||||
if (c.jointEarlyPhaseBid) {
|
||||
const target = record.question.target;
|
||||
requireRule(c.jointEarlyPhaseBid === true &&
|
||||
@@ -10013,6 +10021,13 @@ function advancedTruthAuctionSupported(g: Game, kind: TruthQuestion['kind']): bo
|
||||
return advancedSaphoAuctionSemuta(g) &&
|
||||
['fact','freeform','bid','mixedBid','phaseBid','phaseAnyBid','richeseBid','mixedRicheseBid'].includes(kind);
|
||||
}
|
||||
/** Fresh pre-Bidding Advanced cache questions have their own signed ledgers;
|
||||
* older saved Truth discards keep their original continuation and signature. */
|
||||
function advancedEarlyCacheTruthSupported(g: Game, kind: TruthQuestion['kind']): boolean {
|
||||
return g.semutaAdvancedOrdinaryPreview === true && bareAdvancedClassicSemutaProfile(g) &&
|
||||
g.status === 'playing' && g.phase >= 0 && g.phase <= 2 && (g.richeseCache?.length ?? 0) > 0 &&
|
||||
['earlyRicheseBid','phaseAnyBid'].includes(kind);
|
||||
}
|
||||
/** Bind a parked native ride to its original remaining Spice Blow sequence. */
|
||||
function wormDiscardCursor(g: Game): string {
|
||||
return JSON.stringify([g.turn, g.phase, g.wormRides, g.spiceSequence,
|
||||
@@ -10091,6 +10106,9 @@ function semutaOfferSupported(
|
||||
advancedTruthAuctionSupported(g,continuation.record.question.kind) &&
|
||||
(!g.richeseAuction || supportedSaphoRicheseTruthLot(g) &&
|
||||
continuation.richeseLotEvent === g.richeseAuction.event);
|
||||
const advancedEarlyCacheDiscard = continuation.kind === 'truthtranceDiscard' &&
|
||||
continuation.advancedEarlyCacheTruth === true && continuation.promise === null &&
|
||||
advancedEarlyCacheTruthSupported(g,continuation.record.question.kind);
|
||||
const richeseBoxDiscard = supportedRicheseTruthLot(g) && continuation.kind === 'nullentropyDiscard' &&
|
||||
continuation.auctionBinding?.kind === 'richese';
|
||||
const richeseDistransDiscard = continuation.kind === 'distransDiscard' &&
|
||||
@@ -10361,7 +10379,7 @@ function semutaOfferSupported(
|
||||
continuation.kind === 'nullentropyDiscard' || continuation.kind === 'distransDiscard' ||
|
||||
continuation.kind === 'residualPoisonDiscard' || continuation.kind === 'choamSaleDiscard' ||
|
||||
continuation.kind === 'saphoTruthOrderDiscard' && advancedSaphoAuctionSemuta(g) ||
|
||||
advancedTruthAuctionDiscard ||
|
||||
advancedTruthAuctionDiscard || advancedEarlyCacheDiscard ||
|
||||
continuation.kind === 'karamaEmperorShareDiscard' &&
|
||||
emperorAuctionGiftResumeMatches(g, continuation.use.response, continuation.resume.decision) ||
|
||||
((continuation.kind === 'choamKulonDiscard' || continuation.kind === 'choamLaLaLaDiscard' ||
|
||||
@@ -18579,19 +18597,27 @@ function earlyRicheseBidRule<T>(run: () => T): T {
|
||||
try { return run(); } catch (error) { if (error instanceof EarlyRicheseBidError) throw new RuleError(error.message); throw error; }
|
||||
}
|
||||
function earlyRicheseBidWindow(g: Game): boolean {
|
||||
return bidPromiseModeSupported({ ...g, semutaPreview: undefined }) && !g.kullPreview && !g.advanced &&
|
||||
return earlyRicheseBidModeSupported(g) &&
|
||||
g.status === 'playing' && g.phase >= 0 && g.phase <= 2 && !!byFaction(g, 'richese') &&
|
||||
(g.richeseCache?.length ?? 0) > 0 && !g.response && !g.decision && !g.phaseOpening &&
|
||||
!g.pendingKarama && !g.pendingTreacheryDiscard;
|
||||
}
|
||||
/** A conservative witness uses the respondent's current uncommitted spice;
|
||||
* it does not assume an ally's future aid or an opponent's future bid. */
|
||||
function pendingBlackMarketCards(g: Game,p: Player): number {
|
||||
const lot = g.richeseAuction;
|
||||
const marketWin = lot?.source === 'blackMarket' && lot.owner !== p.id &&
|
||||
!p.hand.some(card => card.id === lot.cardId) &&
|
||||
(lot.outcome?.kind === 'sold' ? lot.outcome.winner === p.id : !lot.outcome &&
|
||||
(lot.method === 'silent' ? (lot.sealed[p.id] ?? 0) > 0 : lot.bidder === p.id));
|
||||
return marketWin ? 1 + Number(p.faction === 'harkonnen') : 0;
|
||||
}
|
||||
function earlyRicheseBidMaximum(g: Game, p: Player): number {
|
||||
// A leading ordinary bid may become a real purchase when the other players
|
||||
// pass. Reserve its physical hand slot, including Harkonnen's bonus draw.
|
||||
// A leading bid may become a real purchase when the other players pass.
|
||||
const pendingPurchase = g.auction?.bidder === p.id && !g.currentAuctionSale
|
||||
? 1 + Number(p.faction === 'harkonnen') : 0;
|
||||
if (p.hand.length + pendingPurchase >= handLimit(p)) return 0;
|
||||
const pendingMarket = pendingBlackMarketCards(g,p);
|
||||
if (p.hand.length + pendingPurchase + pendingMarket >= handLimit(p)) return 0;
|
||||
const amount = uncommittedSpice(g,p);
|
||||
return Number.isSafeInteger(amount) ? Math.max(0,amount) : 0;
|
||||
}
|
||||
@@ -18696,6 +18722,11 @@ function richeseBidTruthAnswers(g: Game, p: Player, claim: RicheseBidClaim): Tru
|
||||
if (!richeseBidWindow(g) || !lot || claim.turn !== g.turn || claim.event !== lot.event ||
|
||||
!lot.eligible.includes(p.id) || lot.acted.includes(p.id) ||
|
||||
!richeseBidFitsHand(lot.source,lot.owner,p.id,p.hand.length,handLimit(p))) return [];
|
||||
// A separately asked Black Market bid needs a three-ledger planner before
|
||||
// it can coexist with an unbound first-cache promise. Do not admit a Yes
|
||||
// that could reserve the same spice or hand space twice.
|
||||
if (lot.source === 'blackMarket' &&
|
||||
liveEarlyRicheseBidPromises(g.earlyRicheseBidPromises ?? [],p.id,g.turn).length) return [];
|
||||
const base = g.richeseBidPromises ?? [], opportunity = richeseBidOpportunity(g,p);
|
||||
const context = {turn:g.turn,event:lot.event,player:p.id};
|
||||
const asker = g.truthtrance?.queue[0]?.player ?? g.players.find(row => row.id !== p.id)?.id ?? g.host;
|
||||
@@ -19110,6 +19141,34 @@ function phaseAnyLastCache(g: Game,p: Player): PhaseBidOpportunity | null {
|
||||
return Number.isSafeInteger(maximum) && maximum > 0
|
||||
? {turn:g.turn,player:p.id,kind:'future',minimum:1,maximum} : null;
|
||||
}
|
||||
/** Before the Advanced market closes, quote a possible later ordinary lot
|
||||
* from the actual cache, deck, public bid and this seat's own commitment.
|
||||
* Never inspect another player's sealed bid or assume a future refund. */
|
||||
function phaseAnyMarketOrdinary(g: Game,p: Player): PhaseBidOpportunity | null {
|
||||
const lot = g.richeseAuction, round = g.richeseBidding;
|
||||
if (g.phase !== 3 || lot?.source !== 'blackMarket' || !round || round.turn !== g.turn ||
|
||||
round.stage !== 'lot' || !(g.deck.length || g.discard.length)) return null;
|
||||
const cards = pendingBlackMarketCards(g,p);
|
||||
if (p.hand.length + cards >= handLimit(p)) return null;
|
||||
const ownBid = lot.outcome ? lot.outcome.kind === 'sold' && lot.outcome.winner === p.id :
|
||||
lot.method === 'silent' ? (lot.sealed[p.id] ?? 0) > 0 : lot.bidder === p.id;
|
||||
// While offers are still sealed, use only public hand capacities. A sale
|
||||
// could fill at most one other buyer's hand and reduce the ordinary pool.
|
||||
const possibleSale = !lot.outcome || lot.outcome.kind === 'sold';
|
||||
const mayFill = (buyer: Player) => buyer.id !== p.id && buyer.id !== lot.owner &&
|
||||
!buyer.hand.some(card => card.id === lot.cardId) && buyer.hand.length < handLimit(buyer) &&
|
||||
buyer.hand.length + 1 + Number(buyer.faction === 'harkonnen') >= handLimit(buyer);
|
||||
const possibleFullBuyer = lot.outcome?.kind === 'sold'
|
||||
? mayFill(getPlayer(g,lot.outcome.winner)) : !lot.outcome && g.players.some(mayFill);
|
||||
const eligible = auctionEligible(g).length;
|
||||
if (eligible - Number(possibleFullBuyer) - Number(possibleSale) -
|
||||
Number((g.richeseCache?.length ?? 0) > 0) < 1) return null;
|
||||
const lockedAid = ownBid ? (g.richeseFunding?.[p.id]?.allyPayment ?? 0) : 0;
|
||||
const maximum = Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,uncommittedSpice(g,p)) +
|
||||
Math.max(0,(aidFor(g,p)?.amount ?? 0)-lockedAid));
|
||||
return Number.isSafeInteger(maximum) && maximum > 0
|
||||
? {turn:g.turn,player:p.id,kind:'future',minimum:1,maximum} : null;
|
||||
}
|
||||
/** The waiting first cache is physical but its method and order are not yet
|
||||
* known. Reserve only owned spice and never assume another player's bid. */
|
||||
function pendingEarlyCacheMaximum(g: Game,p: Player): number {
|
||||
@@ -19197,18 +19256,34 @@ function phaseAnyBidWitnesses(g: Game, p: Player, promises: readonly PhaseBidPro
|
||||
const positive = phase.find(row => row.answer);
|
||||
if (!positive) return result;
|
||||
const neutralPhase = [...phase.filter(row => !row.answer),{...positive,minimum:1}];
|
||||
for (const opportunity of viablePhaseBidWitnesses(g,p,neutralPhase,true)) {
|
||||
if (special && lot?.source === 'blackMarket') {
|
||||
// The current market bid is distinct from the still-waiting cache.
|
||||
// Paid seller retention does not add a second card to its owner's hand.
|
||||
const joint = quoteJointEarlyRicheseBids({player:p.id,turn:g.turn,early,phase:neutralPhase,cacheMaximum,
|
||||
ordinary:{opportunity:special,cashAvailable:Math.max(0,uncommittedSpice(g,p)),
|
||||
aidAvailable:Math.max(0,aidFor(g,p)?.amount ?? 0),freeSlots:Math.max(0,handLimit(p)-p.hand.length),
|
||||
cacheWinSlots:1+Number(p.faction === 'harkonnen'),winSlots:lot.owner === p.id ? 0 : 1}});
|
||||
if (joint.separate) result.push({...special,...joint.separate.ordinary});
|
||||
}
|
||||
const marketOrdinary = phaseAnyMarketOrdinary(g,p);
|
||||
for (const opportunity of [...viablePhaseBidWitnesses(g,p,neutralPhase,true),
|
||||
...(marketOrdinary ? [marketOrdinary] : [])]) {
|
||||
// Later ordinary witnesses follow any required local purchase; current
|
||||
// witnesses are that purchase and must not reserve it twice.
|
||||
const source = opportunity.kind === 'future' ? afterLocal : g;
|
||||
const owner = getPlayer(source,p.id);
|
||||
const pendingCards = source.auction?.bidder === p.id && !source.currentAuctionSale
|
||||
? 1 + Number(p.faction === 'harkonnen') : 0;
|
||||
const freeSlots = Math.max(0,handLimit(owner)-owner.hand.length-pendingCards);
|
||||
const freeSlots = Math.max(0,handLimit(owner)-owner.hand.length-pendingCards-pendingBlackMarketCards(source,owner));
|
||||
const cash = Math.max(0,uncommittedSpice(source,owner));
|
||||
const lockedAid = source.auction?.bidder === p.id && !source.currentAuctionSale
|
||||
? (source.auction.allyPayment ?? 0) : 0;
|
||||
const aid = Math.max(0,(aidFor(source,owner)?.amount ?? 0)-lockedAid);
|
||||
const market = source.richeseAuction;
|
||||
const ownMarket = market?.source === 'blackMarket' && (market.outcome
|
||||
? market.outcome.kind === 'sold' && market.outcome.winner === p.id
|
||||
: market.method === 'silent' ? (market.sealed[p.id] ?? 0) > 0 : market.bidder === p.id);
|
||||
const marketAid = ownMarket ? (source.richeseFunding?.[p.id]?.allyPayment ?? 0) : 0;
|
||||
const aid = Math.max(0,(aidFor(source,owner)?.amount ?? 0)-lockedAid-marketAid);
|
||||
const joint = quoteJointEarlyRicheseBids({player:p.id,turn:g.turn,early,phase:neutralPhase,cacheMaximum,
|
||||
ordinary:{opportunity,cashAvailable:cash,aidAvailable:aid,freeSlots,
|
||||
cacheWinSlots:1+Number(p.faction === 'harkonnen')}});
|
||||
@@ -19279,12 +19354,31 @@ function reconcilePhaseAnyBids(g: Game,voluntary?: {actor:string;action:Action})
|
||||
if (!g.phaseAnyBidPromises?.length || g.truthtrance || g.response || g.decision || g.phaseOpening ||
|
||||
g.pendingTreacheryDiscard || g.pendingKarama || g.pendingKull || g.pendingRicheseBetrayal) return;
|
||||
for (const p of g.players) {
|
||||
const live = livePhaseBidPromises(g.phaseAnyBidPromises,p.id,g.turn);
|
||||
const live = livePhaseBidPromises(g.phaseAnyBidPromises ?? [],p.id,g.turn);
|
||||
if (!live.length) continue;
|
||||
const change = voluntary?.actor === p.id ? 'voluntary' : 'external';
|
||||
if (g.phase > 3) g.phaseAnyBidPromises = phaseBidRule(() => finishPhaseBidPhase(g.phaseAnyBidPromises!,p.id,g.turn,change));
|
||||
else g.phaseAnyBidPromises = phaseBidRule(() => reconcilePhaseBidPromises(g.phaseAnyBidPromises!,p.id,g.turn,
|
||||
phaseAnyBidWitnesses(g,p,g.phaseAnyBidPromises!),change));
|
||||
else {
|
||||
const witnesses = phaseAnyBidWitnesses(g,p,g.phaseAnyBidPromises!);
|
||||
// A pending market has not yet established its real ordinary-lot
|
||||
// count. Do not release a still-fundable Yes solely because the
|
||||
// conservative public-information lower bound cannot prove that count.
|
||||
const lot = g.richeseAuction;
|
||||
const deferred = new Set<string>();
|
||||
if (change === 'external' && lot?.source === 'blackMarket' && !lot.outcome &&
|
||||
liveEarlyRicheseBidPromises(g.earlyRicheseBidPromises ?? [],p.id,g.turn).length) {
|
||||
const maximum = Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,p.spice) + Math.max(0,aidFor(g,p)?.amount ?? 0));
|
||||
const no = live.filter(row => !row.answer);
|
||||
if (maximum > 0) for (const row of live) if (row.answer &&
|
||||
!witnesses.some(witness => !!phaseBidCompletionRange([...no,row],witness)) &&
|
||||
!!phaseBidCompletionRange([...no,row],{turn:g.turn,player:p.id,kind:'future',minimum:1,maximum}))
|
||||
deferred.add(row.event);
|
||||
}
|
||||
const before: PhaseBidPromise[] = g.phaseAnyBidPromises ?? [];
|
||||
const reconciled: PhaseBidPromise[] = phaseBidRule((): PhaseBidPromise[] =>
|
||||
reconcilePhaseBidPromises(before,p.id,g.turn,witnesses,change));
|
||||
g.phaseAnyBidPromises = reconciled.map((row,index) => deferred.has(row.event) ? before[index] : row);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** One exact native action is shared by both panels, bots and the clock. */
|
||||
@@ -19347,6 +19441,18 @@ function projectedPhaseAnyBidGuide(g: Game, id: string): {action:Action} | null
|
||||
if (!lot || (lot.method === 'silent' ? Object.hasOwn(lot.sealed,id) : lot.active !== id)) return null;
|
||||
if (['onceAround','silent'].includes(lot.method) && liveRicheseBidPromises(g.richeseBidPromises ?? [],
|
||||
{turn:g.turn,event:lot.event,player:id}).length) return projectedJointRicheseBidGuide(g,id);
|
||||
if (lot.source === 'blackMarket' && liveEarlyRicheseBidPromises(g.earlyRicheseBidPromises ?? [],id,g.turn).length) {
|
||||
const witnesses = phaseAnyBidWitnesses(g,p,live), required = live.some(row => row.answer);
|
||||
const current = witnesses.find(witness => witness.kind === 'current' && !!phaseBidCompletionRange(live,witness));
|
||||
const range = current && phaseBidCompletionRange(live,current);
|
||||
if (required && !range && !witnesses.some(witness => witness.kind === 'future' &&
|
||||
!!phaseBidCompletionRange(live,witness))) return null;
|
||||
const amount = required && range ? range.minimum : lot.method === 'silent' ? 0 : null;
|
||||
const own = uncommittedSpice(g,p) + richeseOwnCommitment(lot,g.richeseFunding ?? {},id);
|
||||
return {action:{type:'richeseBid',event:lot.event,amount,
|
||||
allyPayment:amount === null ? 0 : Math.max(0,amount-own),phaseAnyBidPromiseEvent:live[0].event,
|
||||
phaseAnyBidLotEvent:lot.event}};
|
||||
}
|
||||
const required = live.some(row => row.answer), opportunity = phaseAnySpecialOpportunity(g,p);
|
||||
const range = opportunity && phaseBidCompletionRange(live,opportunity);
|
||||
if (required && !range) return null;
|
||||
|
||||
@@ -32,6 +32,8 @@ export type JointEarlyRicheseBidInput = {
|
||||
freeSlots: number;
|
||||
/** Slots occupied by a potentially won cache card (including bonuses). */
|
||||
cacheWinSlots: number;
|
||||
/** Slots needed by the other bid; paid seller retention adds no card. */
|
||||
winSlots?: number;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -76,13 +78,13 @@ export function quoteJointEarlyRicheseBids(input: JointEarlyRicheseBidInput): Jo
|
||||
|
||||
let separate: JointEarlyRicheseBidQuote['separate'] = null;
|
||||
if (input.ordinary && phaseRequired) {
|
||||
const {opportunity, cashAvailable, aidAvailable, freeSlots, cacheWinSlots} = input.ordinary;
|
||||
const {opportunity, cashAvailable, aidAvailable, freeSlots, cacheWinSlots, winSlots = 1} = input.ordinary;
|
||||
if (!opportunity || opportunity.player !== input.player || opportunity.turn !== input.turn ||
|
||||
!whole(cashAvailable) || !whole(aidAvailable) || !whole(freeSlots) || !whole(cacheWinSlots))
|
||||
!whole(cashAvailable) || !whole(aidAvailable) || !whole(freeSlots) || !whole(cacheWinSlots) || !whole(winSlots))
|
||||
throw new EarlyRicheseBidError('Retain the funded separate ordinary bid and hand capacity.');
|
||||
const reserved = earlyRequired ? cache?.minimum : 0;
|
||||
if (reserved !== undefined && cashAvailable >= reserved &&
|
||||
freeSlots > (earlyRequired ? cacheWinSlots : 0)) {
|
||||
freeSlots >= (earlyRequired ? cacheWinSlots : 0) + winSlots) {
|
||||
const maximumOrdinary = Math.min(opportunity.maximum, Number.MAX_SAFE_INTEGER,
|
||||
cashAvailable - reserved + aidAvailable);
|
||||
if (maximumOrdinary >= opportunity.minimum) {
|
||||
|
||||
+2
-1
@@ -3791,8 +3791,9 @@ export const RULE_TOPICS: RuleTopic[] = [
|
||||
'Choose the separate all-auction phase bid question to include ordinary, Richese cache and Black Market declarations. One accepted qualifying bid fulfills Yes even if it loses; No caps qualifying bids until Bidding closes. Silent zero is a decline. Existing ordinary-only answers retain their original scope. Some combinations with other binding questions are not yet available.',
|
||||
'A current ordinary, Richese Once Around or Silent bid answer can coexist with the all-auction answer. One native declaration may satisfy both; each No caps that declaration, and a phase-wide Yes may instead wait for a separately funded later lot.',
|
||||
'In a Silent Richese lot the question binds the respondent’s single sealed submission. Zero declines; a positive bid remains hidden until the native simultaneous reveal. Available answers use that bidder’s own funding, without using opponents’ concealed amounts.',
|
||||
'Before Basic Bidding, ask about a minimum bid in the first actual Richese cache auction of this turn. The answer waits for the real event and does not predict its card or method. Current uncommitted personal funds and hand space supply a conservative Yes witness. You cannot cancel a cache required by your own feasible Yes; another player’s cancellation or opposing action can release an impossible commitment. The Richese owner’s Once Around turn may vanish if everyone else passes.',
|
||||
'Before Bidding in supported Basic and bare Advanced Richese games, ask about a minimum bid in the first actual cache auction of this turn. The answer waits for the real event and does not predict its card or method. Current uncommitted personal funds and hand space supply a conservative Yes witness; in Advanced, a Black Market purchase reserves its actual cost and hand space first. You cannot cancel a cache required by your own feasible Yes; another player’s cancellation or opposing action can release an impossible commitment. The Richese owner’s Once Around turn may vanish if everyone else passes.',
|
||||
'A supported early cache answer and the all-auction phase answer can coexist. A single qualifying cache bid may satisfy both; separate bids need enough currently funded spice and hand space for both purchases. A cache No ends with that lot, while a phase No continues until Bidding ends.',
|
||||
'In the Advanced preview, a separate current Black Market bid question cannot yet bind a respondent who already has a waiting early-cache answer. The all-auction phase question remains available within its stated limits.',
|
||||
'Your waiting cache commitment remains visible until its auction opens or it ends. Once the real lot opens, the ordinary Richese bid guide takes over.',
|
||||
'The phase-wide guide may wait for a later lot only when the existing funded sale, prepared next card and post-sale space and funds support it. An unbid lot, hypothetical rival raise, cancelable unfunded overbid or Harkonnen bonus slot is not invented as a future opportunity. Before Bidding, current funding and available card count provide a provisional forecast; special auction preparation and combined future commitments remain limited.',
|
||||
'In supported Basic Ixian or Richese games, a phase-wide ordinary bid can wait through Ixian inspection or a first-position Richese cache. Only ordinary bids count; a potential cache purchase reserves your funds and hand space. If the ordinary auction clock expires and your Yes forbids passing, the normal guide supplies the required legal bid.',
|
||||
|
||||
+3
-3
@@ -91,7 +91,7 @@ import { parseBidClaim, bidClaimText, bidPromiseModeSupported, currentBidPromise
|
||||
import { parsePhaseBidClaim, phaseBidClaimText, phaseBidPromiseModeSupported, type PhaseBidClaim } from './turn-bid-promises';
|
||||
import { parsePhaseAnyBidClaim, phaseAnyBidClaimText, phaseAnyBidPromiseModeSupported, type PhaseAnyBidClaim } from './phase-any-bid-promises';
|
||||
import { parseRicheseBidClaim, richeseBidClaimText, type RicheseBidClaim } from './richese-bid-promises';
|
||||
import { parseEarlyRicheseBidClaim, earlyRicheseBidClaimText, type EarlyRicheseBidClaim } from './early-richese-bid';
|
||||
import { earlyRicheseBidModeSupported, parseEarlyRicheseBidClaim, earlyRicheseBidClaimText, type EarlyRicheseBidClaim } from './early-richese-bid';
|
||||
|
||||
export type TruthFact =
|
||||
| KnowledgeFact
|
||||
@@ -448,11 +448,11 @@ function parseQuestion(g: Game, asker: string, value: unknown): TruthQuestion {
|
||||
check(Object.keys(v).sort().join(',') === 'kind,minimum,target,turn',
|
||||
'Supply the current turn, cache bid minimum and respondent.');
|
||||
const claim = parseEarlyRicheseBidClaim(v);
|
||||
check(bidPromiseModeSupported({ ...g, semutaPreview: undefined }) && !g.kullPreview && !g.advanced &&
|
||||
check(earlyRicheseBidModeSupported(g) &&
|
||||
g.status === 'playing' && g.phase >= 0 && g.phase <= 2 && claim.turn === g.turn &&
|
||||
g.players.some(player => player.faction === 'richese') && (g.richeseCache?.length ?? 0) > 0 &&
|
||||
!g.response && !g.decision && !g.phaseOpening && !g.pendingKarama && !g.pendingTreacheryDiscard,
|
||||
'Choose a quiet Basic turn before the first Richese cache auction.');
|
||||
'Choose a supported quiet turn before the first Richese cache auction.');
|
||||
return { kind: 'earlyRicheseBid', target: v.target, ...claim };
|
||||
}
|
||||
if (v.kind === 'richeseBid') {
|
||||
|
||||
Reference in new issue
Block a user