Support group battle preparation powers
Verify and publish checkpoint container / container (push) Successful in 10m57s
Verify and publish checkpoint container / container (push) Successful in 10m57s
This commit is contained in:
1 parent
d8d2e7207b
commit
83ccd71821
10 files changed
+405
-26
No files matched your search
@@ -2,6 +2,7 @@ import { FACTIONS, type FactionId } from './catalog';
|
||||
import { voiceChoices } from './battle-cards';
|
||||
import { quoteEcazOccupyBattle, type EcazOccupyBattleProfile } from './ecaz-occupy-battle';
|
||||
import { validateNexusBorrowedVoice, type NexusBorrowedVoiceFrame } from './nexus-borrowed-voice';
|
||||
import { coalitionBattleBeneficiary, type CoalitionBattlePreparationContext } from './coalition-battle-preparation';
|
||||
|
||||
export type CombatCheckKind =
|
||||
| 'kwisatz'
|
||||
@@ -10,7 +11,7 @@ export type CombatCheckKind =
|
||||
| 'choamBattleAid';
|
||||
export type CombatResponseKind = CombatCheckKind | 'voice' | 'prescience';
|
||||
export type CombatCheck = { kind: CombatCheckKind; owner: string };
|
||||
export type CombatResponseInput = {
|
||||
export type CombatResponseInput = Omit<CoalitionBattlePreparationContext, 'players' | 'status' | 'advanced'> & {
|
||||
ecazOccupy?: EcazOccupyBattleProfile;
|
||||
status: string;
|
||||
phase: number;
|
||||
@@ -21,6 +22,7 @@ export type CombatResponseInput = {
|
||||
id: string;
|
||||
faction: FactionId;
|
||||
ally?: string | null;
|
||||
allySinceTurn?: number;
|
||||
specialKaramaUsed?: boolean;
|
||||
}[];
|
||||
battle: {
|
||||
@@ -317,11 +319,7 @@ function calculate(
|
||||
requireCombat(owner, 'Combat preparation response has no owner.');
|
||||
// Match battlePreparation's existing provider selection, including its
|
||||
// one-way ally link. CHOAM's queue above independently requires mutual links.
|
||||
const beneficiary = combatants.includes(owner.id)
|
||||
? owner.id
|
||||
: owner.ally && combatants.includes(owner.ally)
|
||||
? owner.ally
|
||||
: null;
|
||||
const beneficiary = coalitionBattleBeneficiary(input, owner.id, b.attacker, b.defender);
|
||||
requireCombat(
|
||||
beneficiary,
|
||||
'Combat preparation owner has no combatant beneficiary.',
|
||||
@@ -339,13 +337,7 @@ function calculate(
|
||||
// Voice has already advanced preparation to Prescience (or its finish).
|
||||
if (b.preparation !== undefined) {
|
||||
const atreides = input.players.find((p) => p.faction === 'atreides');
|
||||
const recipient =
|
||||
atreides &&
|
||||
(combatants.includes(atreides.id)
|
||||
? atreides.id
|
||||
: atreides.ally && combatants.includes(atreides.ally)
|
||||
? atreides.ally
|
||||
: null);
|
||||
const recipient = atreides && coalitionBattleBeneficiary(input, atreides.id, b.attacker, b.defender);
|
||||
requireCombat(
|
||||
record(b.preparation) &&
|
||||
b.preparation.kind === 'prescience' &&
|
||||
|
||||
Reference in new issue
Block a user