Connect Harkonnen Nexus to Ecaz Occupy
Verify and publish checkpoint container / container (push) Successful in 11m17s

This commit is contained in:
Quintine committed 2026-11-16 21:11:16 +11:00
1 parent 007508185e
commit a2e7029a72
12 files changed
+529 -19

No files matched your search

+11 -5
View File
@@ -11958,7 +11958,9 @@ function recordMoritaniAssassinateOpportunity(g: Game, b: Battle, winner: Player
faction:winner.faction,event:g.lastBattleContext!.event,turn:g.turn,territory:b.territory,
opposingLeader:opposingLeader?.id ?? null,opposingLeaderSurvived:!!opposingLeader && !opposingLeader.dead,
normalBattle:g.lastBattleContext!.result === 'normal',lostBattle:true,
traitorCalled:Object.values(b.traitorCalls).some(Boolean)};
// Betrayal cancels the battle outcome, not the preceding public reveal.
traitorCalled:Object.values(b.traitorCalls).some(Boolean) ||
!!g.nexusHarkonnenBetrayalHistory?.some(r => r.outcome === 'use' && r.source.battle.event === b.event)};
if (!moritaniAssassinateTrigger(trigger)) return;
const receipt = createMoritaniAssassinateOpportunity(trigger);
if (g.leaderSkills) receipt.stage = 'skills';
@@ -12992,7 +12994,12 @@ function harkonnenNexusBetrayalContext(g: Game) {
const plans = Object.fromEntries([b.attacker,b.defender].map(id => [id,{
leader:b.plans[id].leader,...(b.plans[id].kwisatz === undefined ? {} : {kwisatz:b.plans[id].kwisatz}),
}]));
// A previously opened Basic Occupy reaction retains its original source
// shape; only newly opened reactions bind the coalition profile.
const legacyOccupySource = !!g.pendingNexusHarkonnenBetrayal &&
!Object.hasOwn(g.pendingNexusHarkonnenBetrayal.source.battle, 'ecazOccupy');
const battle = {event:b.event!,attacker:b.attacker,defender:b.defender,plans,
...(b.ecazOccupy && !legacyOccupySource ? {ecazOccupy:ecazBattleProfile(g)!} : {}),
heroLeaderIds:g.expansions.includes('ix') ? physicalTreacheryCards(g).filter(card => card.kind === 'hero').map(card => card.id) : []};
return {status:g.status,phase:g.phase,turn:g.turn,advanced:g.advanced,ecazTreachery:g.ecazTreachery === true,
...(g.expansions.length ? {expansions:g.expansions} : {}),
@@ -13010,7 +13017,9 @@ function harkonnenNexusBetrayalAuthority(g: Game): HarkonnenBetrayalAuthority {
'The Harkonnen reaction lost its original legal native call.');
const declaration = nexusRule(() => createTraitorDeclaration(traitorDeclarationContext(g),allowance.provider));
requireRule(JSON.stringify(declaration) === JSON.stringify(b.traitorDeclarations?.[allowance.provider]) &&
allowance.nativeWindow === ([b.attacker,b.defender].includes(allowance.provider) ? 'direct' : 'harkonnenTraitor'),
allowance.nativeWindow === ([b.attacker,b.defender].includes(allowance.provider) ||
!!b.ecazOccupy && [b.ecazOccupy.ecaz,b.ecazOccupy.ally].includes(allowance.provider)
? 'direct' : 'harkonnenTraitor'),
'The Harkonnen call lost its original canonical declaration or native window.');
const required = allowance.nativeWindow === 'direct' ? [] :
g.players.filter(p => responseCancelCards(g,p,{kind:'harkonnenTraitor',owner:allowance.provider,passed:[]}).length > 0).map(p => p.id);
@@ -13093,9 +13102,6 @@ function harkonnenNexusBetrayalIntegrity(g: Game, mentatOpening = false): void {
function offerHarkonnenNexusBetrayal(g: Game, provider: string, response?: ResponseWindow): boolean {
if (!g.nexusHarkonnenBetrayalPreview || getPlayer(g,provider).faction !== 'harkonnen') return false;
const b = g.battle!;
// Occupy can add co-side voters that the current two-sided source cannot bind.
// Retain the original Traitor call until that declaration is supported.
if (b.ecazOccupy && harkonnenE3NexusBetrayalProfile(g)) return false;
const required = nexusRule(() => harkonnenBetrayalResponders(g.nexusCards!.cards!,g.players));
if (!required.length) return false;
requireRule(!b.nexusHarkonnenAllowance && (!response || response.kind === 'harkonnenTraitor'),