Compose original mixed and paired Nexus optional modules

This commit is contained in:
Quintine committed 2026-10-07 14:12:47 +11:00
1 parent 0e1797d4e0
commit 05ab2c92b0
30 files changed
+2268 -203

No files matched your search

+58 -1
View File
@@ -1,6 +1,6 @@
import { FACTIONS } from './catalog';
import type { FactionModuleProfile } from './faction-module-profile';
import { classicDiscoveryNexusProfile, pairedDiscoveryNexusProfile, singleE1E2DiscoveryNexusProfile, standaloneE3DiscoveryNexusProfile } from './discovery-module-profile';
import { classicDiscoveryNexusProfile, mixedE1E2DiscoveryNexusProfile, pairedDiscoveryNexusProfile, pairedE3DiscoveryNexusProfile, singleE1E2DiscoveryNexusProfile, standaloneE3DiscoveryNexusProfile } from './discovery-module-profile';
/** Original classic Nexus modules, optionally Homeworlds; initializer checks undealt components. */
export function classicNexusModulesProfile(game: FactionModuleProfile): boolean {
@@ -115,3 +115,60 @@ export function singleE1E2NexusProfile(game: FactionModuleProfile): boolean {
}
return native === 1;
}
/** Both selected E1/E2 native families with original Nexus and optional modules, without Skills. */
export function mixedE1E2NexusProfile(game: FactionModuleProfile): boolean {
if (game.discoveryEnabled || game.discoveries) return mixedE1E2DiscoveryNexusProfile(game);
if (typeof game.advanced !== 'boolean' || !game.nexusCards ||
game.expansions.length !== 2 || !game.expansions.includes('ix') || !game.expansions.includes('choam') ||
game.players.length < 2 || game.players.length > 6 ||
(game.techTokens && game.players.length < 3) ||
(game.strongholdCards && !game.advanced) || game.leaderSkills ||
game.discoveryEnabled || game.discoveries || game.discoveryStash || game.greatMaker ||
game.ecazTreachery || game.semutaPreview || game.advancedPreview ||
game.kullPreview || game.nexusKullPreview || game.guildBetrayalPreview ||
game.richeseBetrayalPreview || game.nexusIxianReplacementPreview ||
game.nexusIxianBetrayalPreview || game.nexusHarkonnenBetrayalPreview) return false;
let ix = false, choam = false;
for (let i = 0; i < game.players.length; i++) {
const player = game.players[i];
for (let j = 0; j < i; j++) if (player.faction === game.players[j].faction) return false;
let family: string | undefined;
for (const faction of FACTIONS)
if (faction.id === player.faction) { family = faction.expansion; break; }
if (family !== 'base' && family !== 'ix' && family !== 'choam') return false;
if (family === 'ix') ix = true;
if (family === 'choam') choam = true;
}
return ix && choam;
}
/** Both original E3 natives with classic opponents, original Nexus and optional modules, without Skills. */
export function pairedE3NexusProfile(game: FactionModuleProfile): boolean {
if (game.discoveryEnabled || game.discoveries) return pairedE3DiscoveryNexusProfile(game);
if (typeof game.advanced !== 'boolean' || !game.nexusCards ||
game.expansions.length !== 1 || game.expansions[0] !== 'ecaz' ||
game.players.length < 2 || game.players.length > 6 ||
(game.techTokens && game.players.length < 3) ||
(game.strongholdCards && !game.advanced) || game.leaderSkills ||
game.discoveryEnabled || game.discoveries || game.discoveryStash || game.greatMaker ||
game.ecazTreachery || game.semutaPreview || game.advancedPreview ||
game.kullPreview || game.nexusKullPreview || game.guildBetrayalPreview ||
game.richeseBetrayalPreview || game.nexusIxianReplacementPreview ||
game.nexusIxianBetrayalPreview || game.nexusHarkonnenBetrayalPreview) return false;
let ecaz = false, moritani = false;
for (let i = 0; i < game.players.length; i++) {
const player = game.players[i];
for (let j = 0; j < i; j++) if (player.faction === game.players[j].faction) return false;
if (player.faction === 'ecaz') ecaz = true;
else if (player.faction === 'moritani') moritani = true;
else {
if (game.advanced && player.faction === 'harkonnen') return false;
let classic = false;
for (const faction of FACTIONS)
if (faction.id === player.faction) { classic = faction.expansion === 'base'; break; }
if (!classic) return false;
}
}
return ecaz && moritani;
}