Support group Harkonnen traitor calls
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-28 23:46:15 +11:00
1 parent 83ccd71821
commit 478b38f5de
10 files changed
+343 -13

No files matched your search

+10 -4
View File
@@ -3939,8 +3939,12 @@ function nexusTraitorParentSignature(g: Game, event: string) {
function traitorDeclarationContext(g: Game): TraitorDeclarationContext {
const b = g.battle!;
return { event: b.event!, attacker: b.attacker, defender: b.defender, plans: b.plans,
status: g.status, advanced: g.advanced, coalitionState: g.coalitionState, expansions: g.expansions,
homeworlds: g.homeworlds, nexusCards: g.nexusCards, leaderSkills: g.leaderSkills,
techTokens: g.techTokens, strongholdCards: g.strongholdCards, ecazTreachery: g.ecazTreachery,
discoveryEnabled: g.discoveryEnabled,
...(b.ecazOccupy ? { ecazOccupy: ecazBattleProfile(g)! } : {}),
players: g.players.map(({id,faction,ally,traitors}) => ({id,faction,ally,traitors})),
players: g.players.map(({id,faction,ally,allySinceTurn,traitors}) => ({id,faction,ally,allySinceTurn,traitors})),
heroLeaderIds: physicalTreacheryCards(g).filter(c => c.kind === 'hero').map(c => c.id),
};
}
@@ -32545,9 +32549,10 @@ function traitorVoters(g: Game, b: Battle) {
for (const owner of [b.ecazOccupy.ecaz, b.ecazOccupy.ally])
if (!voters.includes(owner)) voters.push(owner);
const harkonnen = byFaction(g, 'harkonnen');
const harkonnenBeneficiary = harkonnen && coalitionBattleBeneficiary(g, harkonnen.id, b.attacker, b.defender);
if (
harkonnen?.ally &&
voters.includes(harkonnen.ally) &&
harkonnen && harkonnenBeneficiary &&
voters.includes(harkonnenBeneficiary) &&
!voters.includes(harkonnen.id)
)
voters.push(harkonnen.id);
@@ -32555,7 +32560,7 @@ function traitorVoters(g: Game, b: Battle) {
}
function traitorBeneficiary(g: Game, b: Battle, id: string) {
if (b.ecazOccupy?.lead && [b.ecazOccupy.ecaz, b.ecazOccupy.ally].includes(id)) return b.ecazOccupy.lead;
return [b.attacker, b.defender].includes(id) ? id : getPlayer(g, id).ally;
return coalitionBattleBeneficiary(g, id, b.attacker, b.defender);
}
/** One native eligibility quote for declarations and private Truthtrance answers. */
function traitorCallBlock(g: Game, b: Battle, id: string, held = getPlayer(g, id).traitors): string | null {
@@ -47453,6 +47458,7 @@ export function viewGame(state: Game, id: string, now?: number) {
? { [id]: b.plans[id] }
: {},
traitorSubmitted: Object.keys(b.traitorCalls),
traitorBeneficiary: traitorVoters(g, b).includes(id) ? traitorBeneficiary(g, b, id) : null,
traitorCallChoices: (() => { const context = traitorTruthContext(g, id); return context
? turnActionTraitorChoices(g, id,
traitorDecisionRule(() => traitorDecisionChoices(context, b.traitorDecisionPromises ?? []))) : null; })(),