Support Emperor gifts in Nexus Richese cache sales
Verify and publish checkpoint container / container (push) Successful in 11m37s
Verify and publish checkpoint container / container (push) Successful in 11m37s
This commit is contained in:
1 parent
eaaab566e2
commit
021a8c3e7f
11 files changed
+276
-20
No files matched your search
@@ -16,6 +16,7 @@ export type RicheseBetrayalFixtureOptions = {
|
||||
allyPayment?: number;
|
||||
allyIsSeller?: boolean;
|
||||
allySpice?: number;
|
||||
emperorAlly?: boolean;
|
||||
beforeFinalBid?: (g: Game) => void;
|
||||
bonusCounter?: boolean;
|
||||
};
|
||||
@@ -58,9 +59,12 @@ export function createRicheseBetrayalFixture(
|
||||
assert.ok(kind !== 'purchase' || source === 'cache');
|
||||
const advanced = options.advanced ?? source === 'blackMarket';
|
||||
assert.ok(source !== 'blackMarket' || advanced);
|
||||
if (options.emperorAlly) assert.ok(source === 'cache' && !options.allyIsSeller &&
|
||||
(kind === 'purchase' || options.allyPayment));
|
||||
let g = createGame('RICHESEBETRAYAL',newPlayer(target,'Richese','richese'),advanced,['choam']);
|
||||
for (let i = 1; i < ids.length; i++)
|
||||
joinGame(g,newPlayer(ids[i],RICHESE_BETRAYAL_FIXTURE_FACTIONS[i],RICHESE_BETRAYAL_FIXTURE_FACTIONS[i]));
|
||||
joinGame(g,newPlayer(ids[i],RICHESE_BETRAYAL_FIXTURE_FACTIONS[i],
|
||||
options.emperorAlly && i === 3 ? 'emperor' : RICHESE_BETRAYAL_FIXTURE_FACTIONS[i]));
|
||||
g.nexusCards = {cards:null,phase:null};
|
||||
for (const p of g.players) g = applyAction(g,p.id,{type:'ready'});
|
||||
g = initializeRicheseBetrayalGameForAudit(g);
|
||||
@@ -83,6 +87,10 @@ export function createRicheseBetrayalFixture(
|
||||
ally = options.allyIsSeller ? target : other;
|
||||
g.players.find(p => p.id === harkonnen)!.ally = ally;
|
||||
g.players.find(p => p.id === ally)!.ally = harkonnen;
|
||||
} else if (options.emperorAlly && kind === 'purchase') {
|
||||
ally = other;
|
||||
g.players.find(p => p.id === target)!.ally = other;
|
||||
g.players.find(p => p.id === other)!.ally = target;
|
||||
} else holdNexus(g,other,'guild');
|
||||
const card = source === 'cache' ? g.richeseCache![0].id : (() => {
|
||||
const index = g.deck.findIndex(c => c.kind === 'shield');
|
||||
@@ -111,7 +119,7 @@ export function createRicheseBetrayalFixture(
|
||||
g.players.find(p => p.id === other)!.hand.push(counter);
|
||||
counterCard = counter.id;
|
||||
}
|
||||
if (ally) {
|
||||
if (ally && contribution) {
|
||||
if (options.allySpice !== undefined) g.players.find(p => p.id === ally)!.spice = options.allySpice;
|
||||
g = applyAction(g,ally,{type:'pledgeAid',amount:contribution});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user