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

+1 -10
View File
@@ -13,7 +13,7 @@ export type EcazDukeContext = Omit<Partial<FactionModuleProfile>, 'players'> & {
dukeVidal?: DukeState;
dukeCaptureUncertain?: boolean;
};
type Failure = 'context' | 'custody' | 'table' | 'captureUncertain' | 'alreadyControlled' | 'sameHolderTable';
type Failure = 'context' | 'custody' | 'table' | 'captureUncertain' | 'alreadyControlled';
export class EcazDukeAcquisitionError extends Error {
constructor(
message: string,
@@ -34,8 +34,6 @@ const whole = (n: unknown): n is number =>
Number.isSafeInteger(n) && (n as number) >= 0;
const tableBlock =
'Duke Vidal acquisition with Advanced Harkonnen is still being implemented.';
const sameHolderTableBlock =
'Same-holder Duke acquisition with Advanced Harkonnen is not available in this preview.';
const alreadyBlock =
'Ecaz already controls Duke Vidal through its Ambassador.';
const allyAlreadyBlock = 'The chosen beneficiary already controls Duke Vidal through the Ambassador.';
@@ -97,12 +95,6 @@ export function quoteEcazDukeAcquisition(
whole(duke.leader.deaths),
'The shared Duke Vidal disc has invalid physical identity or history.',
);
// Harkonnen may privately capture Duke without changing his public prior
// controller. Keep same-holder availability independent of that hidden
// custody until a public-safe capture continuation is implemented.
requireDuke(duke.controller !== recipientId || !g.advanced ||
!g.players.some(player => player.faction === 'harkonnen'),
sameHolderTableBlock, 'sameHolderTable');
// A direct Ambassador grant is already in force for this recipient. Other
// sources may be converted to this until-battle tenure without moving or
// recreating the disc. Check public tenure before private custody details.
@@ -144,7 +136,6 @@ export function ecazDukeAcquisitionBlock(
if (error instanceof EcazDukeAcquisitionError) {
if (error.reason === 'captureUncertain') return dukeCaptureUncertaintyBlock(g);
if (error.reason === 'table') return tableBlock;
if (error.reason === 'sameHolderTable') return sameHolderTableBlock;
if (error.reason === 'alreadyControlled')
return recipientId === ownerId ? alreadyBlock : allyAlreadyBlock;
}