Support group Harkonnen traitor calls
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
83ccd71821
commit
478b38f5de
10 files changed
+343
-13
No files matched your search
@@ -1,8 +1,9 @@
|
||||
import { FACTIONS, type FactionId } from './catalog';
|
||||
import { CHEAP_HERO_TRAITOR } from './traitors';
|
||||
import { quoteEcazOccupyBattle, type EcazOccupyBattleProfile } from './ecaz-occupy-battle';
|
||||
import { coalitionBattleBeneficiary, type CoalitionBattlePreparationContext } from './coalition-battle-preparation';
|
||||
|
||||
export type TraitorDeclarationContext = {
|
||||
export type TraitorDeclarationContext = Omit<Partial<CoalitionBattlePreparationContext>, 'players'> & {
|
||||
ecazOccupy?: EcazOccupyBattleProfile;
|
||||
event: string;
|
||||
attacker: string;
|
||||
@@ -12,6 +13,7 @@ export type TraitorDeclarationContext = {
|
||||
id: string;
|
||||
faction: FactionId;
|
||||
ally?: string | null;
|
||||
allySinceTurn?: number;
|
||||
traitors: readonly string[];
|
||||
}[];
|
||||
heroLeaderIds: readonly string[];
|
||||
@@ -98,7 +100,9 @@ function declaredElements(context: TraitorDeclarationContext, voter: string) {
|
||||
const combatants = [context.attacker, context.defender];
|
||||
const occupy = context.ecazOccupy;
|
||||
const coSide = !!occupy && [occupy.ecaz, occupy.ally].includes(voter);
|
||||
const beneficiary = coSide ? occupy.lead : combatants.includes(voter) ? voter : owner.ally;
|
||||
const beneficiary = coSide ? occupy.lead : combatants.includes(voter) ? voter :
|
||||
owner.faction === 'harkonnen' ? coalitionBattleBeneficiary(
|
||||
{...context, status: context.status ?? ''}, voter, context.attacker, context.defender) : null;
|
||||
requireDeclaration(
|
||||
beneficiary &&
|
||||
combatants.includes(beneficiary) &&
|
||||
|
||||
Reference in new issue
Block a user