Prototype two-player four-faction setup

This commit is contained in:
Quintine committed 2026-10-27 23:48:08 +11:00
1 parent 70ef142577
commit 24255905ed
28 files changed
+1091 -73

No files matched your search

+20 -1
View File
@@ -8,7 +8,8 @@ import type { BoardContext, BoardSeat } from '../game/board-resolution-quote';
import type { Game } from '../game/engine';
import { createTechTokens, TECH_TOKENS } from '../game/tech-tokens';
import { MOBILE_STRONGHOLD, MOBILE_LOCATION } from '../game/board';
type Context = BoardContext & Pick<Game, 'techTokens'>;
import type { TwoPlayerControllers } from '../game/two-player-controllers';
type Context = BoardContext & Pick<Game, 'techTokens'> & { twoPlayerControllers?: TwoPlayerControllers };
const keys = [
'arrakeen:10',
'carthag:11',
@@ -94,6 +95,24 @@ void test('unallied target is three except in a two-player game', () => {
occupy(g, 'e', keys);
assert.equal(row(g).qualifies, true);
});
void test('two controllers with four factions need four holds without pooling their separate factions', () => {
const g = fixture(false);
g.players = [...g.players, { id: 'h', faction: 'harkonnen', ally: null, forces: {} }];
g.order = [...g.order, 'h'];
g.twoPlayerControllers = { version: 1, controllers: [
{ id: 'e', seats: ['e', 'a'] }, { id: 'x', seats: ['x', 'h'] },
] };
occupy(g, 'e', keys.slice(0, 3));
occupy(g, 'a', [keys[3]]);
assert.equal(row(g).target, 4);
assert.deepEqual(row(g).members, ['e']);
assert.equal(row(g).qualifies, false);
occupy(g, 'a', []);
occupy(g, 'e', keys);
assert.equal(row(g).qualifies, true);
g.twoPlayerControllers.controllers[1].seats.pop();
assert.throws(() => strongholdProgress(g), VictoryProgressError);
});
void test('technology requires one member to hold all three and never supplies a joint territory', () => {
const g = fixture();
occupy(g, 'e', keys.slice(0, 2));