Support Advanced Semuta at Sapho auction ordering
Verify and publish checkpoint container / container (push) Canceled after 0s
Verify and publish checkpoint container / container (push) Canceled after 0s
This commit is contained in:
1 parent
868713eeb9
commit
dd4222ee92
9 files changed
+270
-19
No files matched your search
+32
-8
@@ -1766,7 +1766,7 @@ export type Game = {
|
||||
revision: number;
|
||||
mode: 'first' | 'last';
|
||||
truth: TruthWindow;
|
||||
/** Present only on new supported Richese cache continuations. */
|
||||
/** Present on supported cache and source-qualified Black Market continuations. */
|
||||
richeseLotEvent?: string;
|
||||
/** New battle continuations bind their original battle event and state. */
|
||||
battleEvent?: string;
|
||||
@@ -6668,7 +6668,9 @@ function saphoTruthOrderDiscardSignature(g: Game, c: SaphoTruthOrderDiscardConti
|
||||
...(g.auction ? {auction:g.auction,aid:g.aid} : {}),
|
||||
...(c.battleEvent ? {battleEvent:c.battleEvent,battle:g.battle} : {}),
|
||||
...(c.richeseLotEvent ? {richeseLotEvent:c.richeseLotEvent,richeseAuction:g.richeseAuction,
|
||||
richeseBidding:g.richeseBidding,richeseFunding:g.richeseFunding,richeseCache:g.richeseCache,aid:g.aid} : {})});
|
||||
richeseBidding:g.richeseBidding,richeseFunding:g.richeseFunding,richeseCache:g.richeseCache,aid:g.aid,
|
||||
...(g.richeseAuction?.source === 'blackMarket' ? {offered:g.richeseOfferedCard,
|
||||
reservedCard:richeseLotCard(g)} : {})} : {})});
|
||||
}
|
||||
type SaphoMovementDiscardContinuation = Extract<
|
||||
NonNullable<Game['pendingTreacheryDiscard']>['continuation'],
|
||||
@@ -8631,7 +8633,7 @@ function treacheryDiscardIntegrity(g: Game) {
|
||||
entry.discardedBy === c.player && entry.card.id === c.card &&
|
||||
richeseCardDefinition(entry.card)?.card.effect === 'juiceOfSapho' &&
|
||||
!c.resume.response && !c.resume.decision && !c.resume.pendingKarama && !c.resume.phaseOpening &&
|
||||
(!c.richeseLotEvent || supportedRicheseTruthLot(g) && g.richeseAuction?.event === c.richeseLotEvent) &&
|
||||
(!c.richeseLotEvent || supportedSaphoRicheseTruthLot(g) && g.richeseAuction?.event === c.richeseLotEvent) &&
|
||||
(!c.battleEvent || g.phase === 6 && g.battle?.event === c.battleEvent &&
|
||||
!g.battle.revealed && !g.battle.preparation) &&
|
||||
truth && truth.question === null && (truth.stage === 'order' || truth.stage === 'ask') &&
|
||||
@@ -9918,6 +9920,24 @@ function supportedRicheseTruthLot(g: Game): boolean {
|
||||
(lot.method === 'onceAround' || lot.method === 'silent') && !lot.outcome &&
|
||||
!g.currentAuctionSale && !g.auction && !g.ixAuction;
|
||||
}
|
||||
/** Sapho's new Advanced Black Market reaction binds only its own real parent;
|
||||
* it must not broaden the separate Truthtrance and Box discard profiles. */
|
||||
function supportedSaphoRicheseTruthLot(g: Game): boolean {
|
||||
if (supportedRicheseTruthLot(g)) return true;
|
||||
const lot = g.richeseAuction;
|
||||
const seller = lot && g.players.find(player => player.id === lot.owner);
|
||||
return g.semutaAdvancedOrdinaryPreview === true && bareAdvancedClassicSemutaProfile(g) &&
|
||||
g.phase === 3 && !!lot && lot.source === 'blackMarket' &&
|
||||
['normal','onceAround','silent'].includes(lot.method) && !lot.outcome &&
|
||||
!g.currentAuctionSale && !g.auction && !g.ixAuction && !!seller &&
|
||||
seller.hand.filter(card => card.id === lot.cardId).length === 1;
|
||||
}
|
||||
function advancedSaphoAuctionSemuta(g: Game): boolean {
|
||||
return g.semutaAdvancedOrdinaryPreview === true && bareAdvancedClassicSemutaProfile(g) &&
|
||||
g.status === 'playing' && g.phase === 3 && !g.currentAuctionSale && !g.ixAuction &&
|
||||
(supportedSaphoRicheseTruthLot(g) || !!g.auction && !g.richeseAuction &&
|
||||
!!g.auction.cards[g.auction.index] && !!g.auction.active);
|
||||
}
|
||||
/** 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,
|
||||
@@ -9987,6 +10007,9 @@ function semutaOfferSupported(
|
||||
const richeseTruthDiscard = supportedRicheseTruthLot(g) &&
|
||||
(continuation.kind === 'truthtranceDiscard' || continuation.kind === 'saphoTruthOrderDiscard') &&
|
||||
!!continuation.richeseLotEvent && continuation.richeseLotEvent === g.richeseAuction?.event;
|
||||
const advancedRicheseSaphoDiscard = continuation.kind === 'saphoTruthOrderDiscard' &&
|
||||
advancedSaphoAuctionSemuta(g) && supportedSaphoRicheseTruthLot(g) &&
|
||||
!!continuation.richeseLotEvent && continuation.richeseLotEvent === g.richeseAuction?.event;
|
||||
const richeseBoxDiscard = supportedRicheseTruthLot(g) && continuation.kind === 'nullentropyDiscard' &&
|
||||
continuation.auctionBinding?.kind === 'richese';
|
||||
const richeseDistransDiscard = continuation.kind === 'distransDiscard' &&
|
||||
@@ -10256,6 +10279,7 @@ function semutaOfferSupported(
|
||||
continuation.kind === 'battleCleanup' && continuation.source === 'winner' ||
|
||||
continuation.kind === 'nullentropyDiscard' || continuation.kind === 'distransDiscard' ||
|
||||
continuation.kind === 'residualPoisonDiscard' || continuation.kind === 'choamSaleDiscard' ||
|
||||
continuation.kind === 'saphoTruthOrderDiscard' && advancedSaphoAuctionSemuta(g) ||
|
||||
continuation.kind === 'karamaEmperorShareDiscard' &&
|
||||
emperorAuctionGiftResumeMatches(g, continuation.use.response, continuation.resume.decision) ||
|
||||
((continuation.kind === 'choamKulonDiscard' || continuation.kind === 'choamLaLaLaDiscard' ||
|
||||
@@ -10440,7 +10464,7 @@ function semutaOfferSupported(
|
||||
continuation.use.response.kind === 'emperorIncome') ||
|
||||
continuation.kind === 'karamaEmperorShareDiscard' &&
|
||||
emperorAuctionGiftResumeMatches(g, continuation.use.response, continuation.resume.decision) ||
|
||||
richeseTruthDiscard || richeseBoxDiscard || richeseDistransDiscard || !g.richeseAuction) &&
|
||||
richeseTruthDiscard || advancedRicheseSaphoDiscard || richeseBoxDiscard || richeseDistransDiscard || !g.richeseAuction) &&
|
||||
(richeseGiftDiscard || combatDiscard || alliedTraitorDiscard || occupyDiscard || continuation.kind === 'saphoAggressorDiscard' ||
|
||||
(continuation.kind === 'saphoTruthOrderDiscard' && !!continuation.battleEvent &&
|
||||
g.phase === 6 && g.battle?.event === continuation.battleEvent && !g.battle.revealed && !g.battle.preparation &&
|
||||
@@ -30325,12 +30349,12 @@ function saphoTruthOrderSemutaSupported(g: Game,p: Player,card: string,mode: 'fi
|
||||
recordNativePrintedCardPlay(trial,p.id,'juiceOfSapho');
|
||||
const used = discard(trial,actor,card);
|
||||
guardTurnActionPrintedCardCost(trial,actor,used);
|
||||
if (!trial.semutaPreview) return true;
|
||||
if (!trial.semutaPreview && !advancedSaphoAuctionSemuta(trial)) return true;
|
||||
w.queue = result.queue;
|
||||
if (result.done) { delete w.order; w.stage = 'ask'; } else w.order = result.frame;
|
||||
const c: SaphoTruthOrderDiscardContinuation = {kind:'saphoTruthOrderDiscard',player:p.id,card:used.id,
|
||||
event,revision,mode,truth:structuredClone(w),
|
||||
...(supportedRicheseTruthLot(trial) ? {richeseLotEvent:trial.richeseAuction!.event} : {}),
|
||||
...(supportedSaphoRicheseTruthLot(trial) ? {richeseLotEvent:trial.richeseAuction!.event} : {}),
|
||||
...(trial.battle?.event ? {battleEvent:trial.battle.event} : {}),
|
||||
resume:{response:trial.response,decision:trial.decision,
|
||||
pendingKarama:trial.pendingKarama,phaseOpening:trial.phaseOpening},stateSignature:''};
|
||||
@@ -30366,11 +30390,11 @@ function playSaphoTruthOrder(g: Game,p: Player,action: Action) {
|
||||
if (result.done) { delete w.order; w.stage = 'ask'; } else w.order = result.frame;
|
||||
log(g, `${p.name} discarded Juice of Sapho to ask ${String(action.mode)} among the simultaneous Truthtrance holders.`,
|
||||
{faction:p.faction,name:'Juice of Sapho'});
|
||||
if (g.semutaPreview) {
|
||||
if (g.semutaPreview || advancedSaphoAuctionSemuta(g)) {
|
||||
const c: SaphoTruthOrderDiscardContinuation = {kind:'saphoTruthOrderDiscard',player:p.id,card:used.id,
|
||||
event:action.event as string,revision:action.revision as number,mode:action.mode as 'first'|'last',
|
||||
truth:structuredClone(w),
|
||||
...(supportedRicheseTruthLot(g) ? {richeseLotEvent:g.richeseAuction!.event} : {}),
|
||||
...(supportedSaphoRicheseTruthLot(g) ? {richeseLotEvent:g.richeseAuction!.event} : {}),
|
||||
...(g.battle?.event ? {battleEvent:g.battle.event} : {}),
|
||||
resume:{response:g.response,decision:g.decision,pendingKarama:g.pendingKarama,phaseOpening:g.phaseOpening},
|
||||
stateSignature:''};
|
||||
|
||||
Reference in new issue
Block a user