Connect staged Advanced classic group alliances
Verify and publish checkpoint container / container (push) Successful in 10m53s

This commit is contained in:
Quintine committed 2026-10-29 02:37:23 +11:00
1 parent ef92ddf2b9
commit 3ba9087405
22 files changed
+561 -44

No files matched your search

+8 -6
View File
@@ -1,4 +1,5 @@
import type { Player } from './engine';
import { FACTIONS } from './catalog';
import { advisorStanceAfterSettlement } from './advisor-automatic-flip';
import type { ForcePresence } from './force-presence';
import { presenceAt, presenceByLocation } from './force-presence';
@@ -29,7 +30,7 @@ export type BoardSeat = Pick<Player, 'id' | 'faction' | 'ally' | 'allySinceTurn'
ForcePresence;
export type BoardContext = MobileBoard & {
advanced: boolean;
/** Fresh Basic coalition protocol; existing played Basic tables are not retrofitted. */
/** Existing pair games retain their original protocol. */
ecazOccupyPreview?: boolean;
storm: number;
order: readonly string[];
@@ -37,13 +38,14 @@ export type BoardContext = MobileBoard & {
coalitionState?: CoalitionState;
};
/** Three-member board rules are provisionally restricted to Basic without Ecaz. */
/** Advanced larger groups are currently scoped to the classic roster. */
function validateBoardCoalitions(g: BoardContext) {
if (g.coalitionState === undefined) return;
try {
for (const group of coalitionGroups(g.players, g.coalitionState))
if (group.members.length >= 3 && (g.advanced || g.players.some(player => player.faction === 'ecaz')))
throw new Error('Three-member board rules require Basic play without Ecaz.');
if (group.members.length >= 3 && (g.players.some(player => player.faction === 'ecaz') ||
g.advanced && g.players.some(player => !FACTIONS.some(faction => faction.id === player.faction && faction.expansion === 'base'))))
throw new Error('Larger alliance board rules require a supported roster without Ecaz.');
} catch (error) {
throw new BoardResolutionError((error as Error).message);
}
@@ -175,8 +177,8 @@ export function quoteBattleBoard(g: BoardContext) {
return { released, battles };
}
/** Union the per-edge Basic separation obligations without inventing an age for
* an older pair when a third player joins. No forces are removed by this quote. */
/** Union per-edge separation obligations without inventing an age for an older
* pair when a third player joins. Advanced applies at each player's turn end. */
export function quoteCoalitionAlliedSeparation(
g: BoardContext & { turn: number; remaining: readonly string[] },
player: string,