Support bribe promises with Kull and Richese
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
52d932002b
commit
2eaaab876e
15 files changed
+422
-10
No files matched your search
@@ -0,0 +1,56 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { alliancePromiseModeSupported } from '../game/alliance-promises';
|
||||
import { bidPromiseModeSupported, currentBidPromiseModeSupported } from '../game/bid-promises';
|
||||
import { bribeExpressionPromiseModeSupported } from '../game/bribe-expression-promises';
|
||||
import { bribePromiseModeSupported } from '../game/bribe-promises';
|
||||
import { revivalPromiseModeSupported } from '../game/revival-promises';
|
||||
import { viewGame } from '../game/engine';
|
||||
import { createKullRicheseSemutaFixture } from './fixture-kull-richese-semuta';
|
||||
|
||||
const profile = {
|
||||
advanced: false, expansions: ['choam','ix'], kullPreview: true, semutaPreview: true,
|
||||
players: [{faction:'choam'}, {faction:'richese'}, {faction:'emperor'}, {faction:'harkonnen'}],
|
||||
};
|
||||
|
||||
void test('Basic Kull and Semuta expose the bribe family only in the supported native profile', () => {
|
||||
for (const quote of [bribePromiseModeSupported, bribeExpressionPromiseModeSupported]) {
|
||||
assert.equal(quote(profile), true);
|
||||
assert.equal(quote({...profile, expansions:['ix','choam']}), true);
|
||||
assert.equal(quote({...profile, expansions:['choam','ix','ecaz'],
|
||||
players:[...profile.players, {faction:'moritani'}, {faction:'ecaz'}]}), true);
|
||||
for (const unsupported of [
|
||||
{...profile, advanced:true},
|
||||
{...profile, expansions:['choam']},
|
||||
{...profile, expansions:['choam','ix','ix']},
|
||||
{...profile, players:profile.players.filter(player => player.faction !== 'choam')},
|
||||
{...profile, players:profile.players.filter(player => player.faction !== 'richese')},
|
||||
{...profile, players:[...profile.players, {faction:'ecaz'}]},
|
||||
{...profile, players:[...profile.players, {faction:'richese'}]},
|
||||
]) assert.equal(quote(unsupported), false);
|
||||
for (const key of ['homeworlds','nexusCards','leaderSkills','techTokens','strongholdCards',
|
||||
'discoveryEnabled','nexusKullPreview','richeseBetrayalPreview','guildBetrayalPreview',
|
||||
'nexusIxianReplacementPreview','nexusIxianBetrayalPreview','nexusHarkonnenBetrayalPreview',
|
||||
'moritaniAssassinatePreview'] as const)
|
||||
assert.equal(quote({...profile,[key]:true}),false,key);
|
||||
}
|
||||
});
|
||||
|
||||
void test('admitting bribes does not silently enable unrelated Semuta promise families', () => {
|
||||
assert.equal(alliancePromiseModeSupported(profile),false);
|
||||
assert.equal(revivalPromiseModeSupported(profile),false);
|
||||
assert.equal(bidPromiseModeSupported(profile),false);
|
||||
assert.equal(currentBidPromiseModeSupported(profile),true);
|
||||
});
|
||||
|
||||
void test('a genuine public Basic Kull and Richese start projects the ordinary bribe controls', () => {
|
||||
const {game} = createKullRicheseSemutaFixture();
|
||||
assert.equal(game.kullPreview,true);
|
||||
assert.equal(game.semutaPreview,true);
|
||||
const view = viewGame(game,'emperor');
|
||||
assert.ok(view.truthBribeTargets.includes('harkonnen'));
|
||||
assert.ok(view.truthBribeExpressionTargets.includes('harkonnen'));
|
||||
assert.ok(view.truthMixedBribeTargets.includes('harkonnen'));
|
||||
assert.deepEqual(view.truthAllianceTargets,[]);
|
||||
assert.deepEqual(view.truthRevivalTargets,[]);
|
||||
});
|
||||
Reference in new issue
Block a user