Resolve Duke uncertainty on public events
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 19:30:00 +11:00
1 parent 57e7611468
commit 59cb336c80
14 files changed
+360 -25

No files matched your search

+14 -1
View File
@@ -3887,6 +3887,7 @@ function playNexusEcazDuke(g: Game, p: Player, action: Action) {
(g.nexusEcazDukeEvents ??= []).push(receipt.event);
log(g, `${p.name} spent Ecaz Nexus Cunning to take Duke Prad Vidal for this turn. The shared leader remains physically unique and returns after use or at turn end.`,
{ faction: p.faction, name: 'Ecaz Nexus Cunning' });
g.dukeCaptureUncertain = false;
}
function playMoritaniBetrayal(g: Game, p: Player, action: Action) {
@@ -27441,6 +27442,7 @@ function decideAmbassador(g: Game, p: Player, action: Action) {
}
log(g, `${p.name} revived ${name} for free through the Tleilaxu Ambassador.${selected === DUKE_VIDAL_ID ? ' The living shared disc is set aside, unclaimed.' : ''} The ordinary leader allowance is unchanged.`,
{ faction: 'tleilaxu', name: 'Tleilaxu Ambassador' });
if (selected === DUKE_VIDAL_ID) g.dukeCaptureUncertain = false;
finishAmbassadorRevival(g, p, returned);
return;
}
@@ -28058,6 +28060,7 @@ function decideTerror(g: Game, p: Player, action: Action) {
finishLeaderSkillCustody(g);
p.spice += bounty;
log(g, `${victim.name} was assassinated; ${p.name} received ${bounty} spice.`);
if (victim.id === DUKE_VIDAL_ID) g.dukeCaptureUncertain = false;
} else {
log(g, `${p.name} revealed Assassination, but the entrant controlled no living leader. No leader died and no spice was awarded.`);
}
@@ -31308,6 +31311,7 @@ function claimHomeworldEcazDuke(g: Game, actor: string, event: unknown, recipien
(g.homeworldEcazDukeGrants ??= []).push(receipt);
log(g, `${getPlayer(g, actor).name} granted the living Duke Vidal to ${getPlayer(g, recipient).name} through occupied Ecaz. This provisional grant permits one battle and ends unused at turn end; only Ecaz may revive him.`,
{ faction: getPlayer(g, actor).faction, name: 'Occupied Ecaz Duke grant' });
g.dukeCaptureUncertain = false;
}
function reconcileHomeworldEcazDuke(g: Game) {
if (g.status !== 'playing' || !g.homeworldOccupationPreview || !byFaction(g, 'ecaz') || homeworldEcazDukeBoundaryBlocked(g)) return;
@@ -32216,6 +32220,7 @@ function playResidualPoison(
`${p.name} played Residual Poison against ${target.name}. ${victim.name} was randomly selected from the available leaders and sent to the Tanks. No spice is awarded, no forces are lost, and battle preparation continues.`,
{ faction: p.faction, name: 'Residual Poison' },
);
if (victim.id === DUKE_VIDAL_ID) g.dukeCaptureUncertain = false;
if (semutaAdvancedNativeProducerEnabled(g)) {
const continuation: ResidualPoisonDiscardContinuation = {
kind: 'residualPoisonDiscard', player: p.id, target: target.id,
@@ -33118,6 +33123,7 @@ function applyGholaEffect(g: Game, p: Player, action: Action, cardId?: string) {
g,
`${p.name} revived ${l.name} with Ghola.${l.id === DUKE_VIDAL_ID ? ' The living shared disc is set aside, unclaimed.' : ' The leader may fight again this turn;'} No spice or normal leader-revival allowance was spent.`,
);
if (l.id === DUKE_VIDAL_ID) g.dukeCaptureUncertain = false;
} else {
const n = integer(
action.amount ?? Math.min(5, p.tanks),
@@ -35627,8 +35633,12 @@ function resolveBattle(g: Game, retreat?: DiplomatRetreatSelection) {
if (choices.length)
g.pendingTech = { player: winner.id, loser: loser.id, choices };
}
if (g.dukeVidal && [ap.leader, dp.leader].includes(DUKE_VIDAL_ID))
if (g.dukeVidal && [ap.leader, dp.leader].includes(DUKE_VIDAL_ID)) {
g.dukeVidal = consumeDuke(g.dukeVidal);
// Revealed battle plans publicly establish the unique disc's location.
// A subsequent Harkonnen capture may make the result uncertain again.
if (b.revealed) g.dukeCaptureUncertain = false;
}
g.lastBattle = [a.id, d.id];
const battleEvent = b.event ?? g.pendingAuditor?.event ?? crypto.randomUUID();
const inspection: NexusChoamInspectionReceipt | null =
@@ -37281,6 +37291,7 @@ function finishRevival(
`${p.name} revived ${leader!.name}${revival.kind === 'foreignGhola' ? ' as a ghola' : ''}.${sharedDuke ? ' The living shared disc is set aside, unclaimed.' : ''}`,
{ faction: p.faction, name: 'Revival' },
);
if (sharedDuke) g.dukeCaptureUncertain = false;
}
}
g.pendingRevival = null;
@@ -38500,6 +38511,7 @@ function finishResponse(g: Game, canceled: boolean, settlement?: BureaucratSettl
} else if (!canceled && !g.dukeVidal.leader.dead) {
g.dukeVidal = acquireDuke(g.dukeVidal, response.owner, g.turn, 'moritani');
log(g, `${getPlayer(g, response.owner).name} acquired Duke Vidal for one battle this turn.`);
g.dukeCaptureUncertain = false;
} else if (!canceled) {
// A qualified public acquisition resolves the concealed disc's availability;
// never revive a privately executed Duke or leak it through a private-only gate.
@@ -38507,6 +38519,7 @@ function finishResponse(g: Game, canceled: boolean, settlement?: BureaucratSettl
'The unavailable acquisition lost the original executed Duke return.');
g.dukeVidal = consumeDuke(g.dukeVidal);
log(g, `${getPlayer(g, response.owner).name}'s Duke acquisition resolved with the shared disc in the Tanks. No acquisition occurred.`);
g.dukeCaptureUncertain = false;
} else
log(g, 'Karama prevented Moritani from acquiring Duke Vidal this turn.');
nextPhase(g);