Support unused selected decks with Nexus and Discovery
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
c8dbd44975
commit
91d45d1dec
14 files changed
+405
-17
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { FACTIONS } from './catalog';
|
||||
import { independentDiscoveryProfile, mixedE3NexusRosterProfile, selectedPhaseModuleRoster, type FactionModuleProfile } from './faction-module-profile';
|
||||
import { independentDiscoveryProfile, mixedE3NexusRosterProfile, selectedNexusWithoutCardsProfile, selectedPhaseModuleRoster, type FactionModuleProfile } from './faction-module-profile';
|
||||
import type { LeaderSkillProfile } from './leader-skill-profile';
|
||||
|
||||
/** Public unused-lobby admission only. The original initializer owns physical
|
||||
@@ -17,7 +17,7 @@ export function homeworldDiscoveryProfile(game: FactionModuleProfile): boolean {
|
||||
/** The same roster/module contract during play; live Discovery frames are expected. */
|
||||
export function discoveryModeSupported(game: FactionModuleProfile): boolean {
|
||||
if (independentDiscoveryProfile(game)) return true;
|
||||
if (game.nexusCards) return standaloneE3DiscoveryNexusProfile(game) || singleE1E2DiscoveryNexusProfile(game) ||
|
||||
if (game.nexusCards) return (game.discoveryEnabled === true && selectedNexusWithoutCardsProfile(game)) || standaloneE3DiscoveryNexusProfile(game) || singleE1E2DiscoveryNexusProfile(game) ||
|
||||
mixedE3DiscoveryNexusProfile(game) || mixedE1E2DiscoveryNexusProfile(game) || pairedE3DiscoveryNexusProfile(game);
|
||||
if (typeof game.advanced !== 'boolean' || game.discoveryEnabled !== true ||
|
||||
game.players.length < 2 || game.players.length > 6 ||
|
||||
@@ -41,7 +41,7 @@ export function discoveryModeSupported(game: FactionModuleProfile): boolean {
|
||||
if (e3 ? expansion !== 'ecaz' : expansion !== 'ix' && expansion !== 'choam') return false;
|
||||
for (let j = 0; j < i; j++) if (game.expansions[j] === expansion) return false;
|
||||
}
|
||||
let native = 0, moritani = false, harkonnen = false;
|
||||
let moritani = false, harkonnen = false;
|
||||
for (let i = 0; i < game.players.length; i++) {
|
||||
const player = game.players[i];
|
||||
for (let j = 0; j < i; j++) if (game.players[j].faction === player.faction) return false;
|
||||
@@ -52,12 +52,11 @@ export function discoveryModeSupported(game: FactionModuleProfile): boolean {
|
||||
if (expansion !== 'base') {
|
||||
if (e3 ? player.faction !== 'ecaz' && player.faction !== 'moritani'
|
||||
: !game.expansions.includes(expansion)) return false;
|
||||
native++;
|
||||
}
|
||||
if (player.faction === 'moritani') moritani = true;
|
||||
if (player.faction === 'harkonnen') harkonnen = true;
|
||||
}
|
||||
return (!e3 || native >= 1 && native <= 2) && !(game.advanced && moritani && harkonnen);
|
||||
return !(game.advanced && moritani && harkonnen);
|
||||
}
|
||||
|
||||
/** The original E3 pair can use selected decks with Discovery without Nexus or cards. */
|
||||
|
||||
Reference in new issue
Block a user