Compose selected E1/E2 independent cards with Nexus rules

Retain selected decks and original optional modules through normal setup, distinguish native Ixian Betrayal from absent-faction replacement, route explicit CHOAM fuel before printed effects, and preserve native No-Field invoices and pair continuation. Connect canonical native cancellation stock and existing human/minimal AI consumers.

Validation: 194 affected tests across 19 files, types/lint/build, bounded native invoice review and seven finite original-action/rendered-control programmes. Runtime ec5ad6c18996d8d958ec0d01132ef3e3ea6d23d36188902eca9a63d4db2efbf8; documentation-only proof overlay a5892004937434429916496497c07a3838a324b4a5d64d4a0eb804ab5212d5bd. Other envelopes, full combinations, comprehensive assurance and deployed acceptance remain open. No saved-room/provider changes.
This commit is contained in:
Quintine committed 2026-10-18 10:46:21 +11:00
1 parent 999edb67e6
commit 8422cf1f2d
20 files changed
+1413 -97

No files matched your search

+37 -8
View File
@@ -26,36 +26,65 @@ export type FactionModuleProfile = {
nexusHarkonnenBetrayalPreview?: unknown;
};
type ClassicNexusProfile = Partial<FactionModuleProfile> & Pick<FactionModuleProfile, 'expansions'> & {
type NexusCoreConfiguration = Partial<FactionModuleProfile> & Pick<FactionModuleProfile, 'expansions'> & {
sandtrout?: unknown; moritaniAssassinatePreview?: unknown;
};
/** Classic Nexus12 with selected base33/independent36, optional all14, original
* Homeworlds and phase modules. Native effect stamps are not selected overlays. */
export function classicNexusCoreProfile(game: ClassicNexusProfile): boolean {
export function classicNexusCoreProfile(game: NexusCoreConfiguration): boolean {
return nexusCoreRosterProfile(game, false);
}
/** Selected E1/E2 decks with the independent three-card variant. A deck selection
* does not require seating its native faction. Original optional modules compose. */
export function selectedIndependentNexusProfile(game: NexusCoreConfiguration): boolean {
return game.ecazTreachery === true && game.expansions.length > 0 && nexusCoreRosterProfile(game, true);
}
/** Common consumers of the classic and selected-independent fresh Nexus core. */
export function nexusCoreProfile(game: NexusCoreConfiguration): boolean {
return classicNexusCoreProfile(game) || selectedIndependentNexusProfile(game);
}
function nexusCoreRosterProfile(game: NexusCoreConfiguration, selectedDecks: boolean): boolean {
const players = game.players;
if (typeof game.advanced !== 'boolean' || !game.nexusCards ||
game.expansions.length !== 0 || !players || players.length < (game.techTokens ? 3 : 2) || players.length > 6 ||
!players || players.length < (game.techTokens ? 3 : 2) || players.length > 6 ||
(game.strongholdCards && !game.advanced) || game.sandtrout ||
game.discoveryEnabled || game.discoveries || game.discoveryStash || game.greatMaker ||
game.semutaPreview || game.moritaniAssassinatePreview || game.advancedPreview || game.kullPreview || game.nexusKullPreview ||
game.richeseBetrayalPreview ||
game.nexusIxianBetrayalPreview) return false;
(game.nexusIxianBetrayalPreview && (!selectedDecks || !players.some(player => player.faction === 'ixians')))) return false;
if (selectedDecks) {
if (game.expansions.length > 2) return false;
for (let i = 0; i < game.expansions.length; i++) {
if (game.expansions[i] !== 'ix' && game.expansions[i] !== 'choam') return false;
for (let j = 0; j < i; j++) if (game.expansions[j] === game.expansions[i]) return false;
}
} else if (game.expansions.length !== 0) return false;
for (let i = 0; i < players.length; i++) {
for (let j = 0; j < i; j++) if (players[j].faction === players[i].faction) return false;
let classic = false;
let permitted = false;
for (const faction of FACTIONS)
if (faction.id === players[i].faction) { classic = faction.expansion === 'base'; break; }
if (!classic) return false;
if (faction.id === players[i].faction) {
permitted = faction.expansion === 'base' || (selectedDecks && game.expansions.includes(faction.expansion));
break;
}
if (!permitted) return false;
}
return true;
}
/** Card consumers require the actual independent-variant selection. */
export function classicIndependentNexusProfile(game: ClassicNexusProfile): boolean {
export function classicIndependentNexusProfile(game: NexusCoreConfiguration): boolean {
return game.ecazTreachery === true && classicNexusCoreProfile(game);
}
export function independentNexusProfile(game: NexusCoreConfiguration): boolean {
return game.ecazTreachery === true && nexusCoreProfile(game);
}
/** Original E1/E2 families or standalone Ecaz/Moritani; explicit Semuta context only. */
export function nativeFactionTechProfile(game: FactionModuleProfile, semuta = false): boolean {
if (typeof game.advanced !== 'boolean' || !game.techTokens ||