Add optional short alliance victory
Verify and publish checkpoint container / container (push) Successful in 11m2s
Verify and publish checkpoint container / container (push) Successful in 11m2s
This commit is contained in:
1 parent
8fb9f59106
commit
e896570f07
25 files changed
+632
-27
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
controllerStrongholdTarget,
|
||||
physicalControllerCount,
|
||||
type TwoPlayerControllers,
|
||||
} from './two-player-controllers';
|
||||
|
||||
/** GF9's optional two-member alliance / three-stronghold variant. The
|
||||
* two-person four-stronghold rule still applies, as do ordinary solo targets.
|
||||
* Callers add any separately agreed increase after this base target. */
|
||||
export function allianceVictoryTarget(
|
||||
seats: readonly string[],
|
||||
controllers: TwoPlayerControllers | null | undefined,
|
||||
allied: boolean,
|
||||
shortAlliance?: boolean,
|
||||
): 3 | 4 {
|
||||
if (shortAlliance !== undefined && typeof shortAlliance !== 'boolean')
|
||||
throw new TypeError('Choose whether the shorter alliance victory option is enabled.');
|
||||
const target = controllerStrongholdTarget(seats, controllers, allied);
|
||||
if (shortAlliance === true && allied && physicalControllerCount(seats, controllers) >= 3)
|
||||
return 3;
|
||||
return target;
|
||||
}
|
||||
Reference in new issue
Block a user