Support staged group Emperor aid
Verify and publish checkpoint container / container (push) Successful in 10m13s
Verify and publish checkpoint container / container (push) Successful in 10m13s
This commit is contained in:
1 parent
b89c225d5b
commit
9081249574
10 files changed
+413
-17
No files matched your search
@@ -3,6 +3,7 @@ import {
|
||||
GuildAmbassadorContinuationError,
|
||||
} from './guild-ambassador-continuation';
|
||||
import type { Game, ResponseWindow } from './engine';
|
||||
import { coalitionOf, CoalitionAllianceError } from './coalition-alliance';
|
||||
import {
|
||||
homeworldMovementForesightBlock,
|
||||
homeworldSpiritualAdvisorAllowance,
|
||||
@@ -57,6 +58,7 @@ export type TerminalCancellationContext = Pick<
|
||||
| 'turn'
|
||||
| 'advanced'
|
||||
| 'players'
|
||||
| 'coalitionState'
|
||||
| 'auction'
|
||||
| 'richeseAuction'
|
||||
| 'stormCard'
|
||||
@@ -138,10 +140,21 @@ export function validateTerminalCancellation(
|
||||
case 'emperorRevival': {
|
||||
faction('emperor');
|
||||
amount();
|
||||
let allied = owner.ally === response.recipient;
|
||||
if (!allied && g.coalitionState) {
|
||||
try {
|
||||
const group = coalitionOf(g.players, g.coalitionState, owner.id);
|
||||
allied = !!group && group.members.length === 3 && !!response.recipient &&
|
||||
group.members.includes(response.recipient);
|
||||
} catch (error) {
|
||||
if (error instanceof CoalitionAllianceError) throw new TerminalCancellationError(error.message);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
requireTerminal(
|
||||
recipient() &&
|
||||
response.recipient !== owner.id &&
|
||||
owner.ally === response.recipient,
|
||||
allied,
|
||||
'The canceled Emperor power needs its originally declared ally.',
|
||||
);
|
||||
const elite = response.elite ?? 0;
|
||||
|
||||
Reference in new issue
Block a user