Allow Richese special purchase at Ix openings
Verify and publish checkpoint container / container (push) Successful in 10m34s

This commit is contained in:
Quintine committed 2026-11-16 15:40:07 +11:00
1 parent d169740adf
commit 53780c11d8
10 files changed
+395 -5

No files matched your search

+15 -2
View File
@@ -2728,7 +2728,10 @@ export type Game = {
owner: string;
turn: number;
phase: number;
resume: Pick<Game, 'response' | 'decision' | 'pendingKarama'>;
resume: Pick<Game, 'response' | 'decision' | 'pendingKarama'> & {
/** Present only when a newer purchase suspended an Ix phase opening. */
phaseOpening?: Game['phaseOpening'];
};
} | null;
pendingKarama?: {
owner: string;
@@ -27398,6 +27401,7 @@ function runOccupiedPercentageSuffix(g: Game, suffix: OccupiedPercentageSuffix)
else if (suffix.kind === 'richesePurchase') {
g.pendingRichesePurchaseIncome = null;
g.response = suffix.resume.response; g.decision = suffix.resume.decision; g.pendingKarama = suffix.resume.pendingKarama;
if (Object.hasOwn(suffix.resume, 'phaseOpening')) g.phaseOpening = suffix.resume.phaseOpening;
} else if (suffix.kind === 'none') {
g.decision = suffix.decision;
}
@@ -40066,6 +40070,7 @@ function finishResponse(g: Game, canceled: boolean, settlement?: BureaucratSettl
g.response = resume.response;
g.decision = resume.decision;
g.pendingKarama = resume.pendingKarama;
if (Object.hasOwn(resume, 'phaseOpening')) g.phaseOpening = resume.phaseOpening;
} else if (response.kind === 'emperorIncome') {
if (!canceled) {
const owner = getPlayer(g, response.owner);
@@ -42936,7 +42941,9 @@ export function prepareSpecialKaramaIntent(
requireRule(!g.truthtrance, 'Resolve the current Truthtrance first.');
if (p.faction !== 'choam') {
requireRule(
!g.phaseOpening,
!g.phaseOpening || p.faction === 'richese' && g.expansions.includes('ix') &&
!g.response && !g.decision && !g.pendingKarama && !g.pendingKull && !g.pendingTreacheryDiscard &&
!(g.phase === 3 && g.nexusIxianReplacementPreview),
'Play Amal or pass the phase opening before taking other actions.',
);
requireRule(
@@ -43400,10 +43407,12 @@ function resolveSpecialKaramaEffect(g: Game, p: Player, card: Card, intent: Spec
response: g.response,
decision: g.decision,
pendingKarama: g.pendingKarama ?? null,
...(g.phaseOpening ? {phaseOpening: structuredClone(g.phaseOpening)} : {}),
},
};
g.decision = null;
g.pendingKarama = null;
if (g.phaseOpening) g.phaseOpening = null;
g.response = {
kind: 'richesePurchaseIncome',
owner: emperor.id,
@@ -45412,6 +45421,10 @@ function applyActionInner(
specialKarama(g, p, action);
return g;
}
if (t === 'card' && action.mode === 'special' && p.faction === 'richese' && g.phaseOpening) {
specialKarama(g, p, action);
return g;
}
if (t === 'card' && choamSaleGholaTiming(g) &&
p.hand.some((card) => card.id === action.card && card.effect === 'ghola')) {
playMarketGhola(g, p, action);
+1
View File
@@ -622,6 +622,7 @@ export const RULE_TOPICS: RuleTopic[] = [
'Spend a held Karama once per game to buy one private cache card for three own spice. An eligible Emperor Nexus joint option proves and retains that price while spending both cards at native purchase commit.',
steps: [
'In advanced development tables, Richese can use its special Karama once per game. Select an available Karama in your hand and one eligible card from your own cache. The activating Karama is discarded; the chosen card enters your hand secretly.',
'In a supported clean Ix phase opening, this purchase can occur without abandoning earlier passes. If the Emperor is present, the opening waits while the separate income response is resolved; its existing passes then resume. Some optional-module combinations remain guarded.',
'This is a purchase for Richese itself. Pay three of your available spice to Emperor when present, otherwise the bank. The general Emperor purchase-income rule supplies this payment destination. An ally receives no Harkonnen bonus or Ixian replacement from this direct cache acquisition.',
'With Emperor absent, an actual unallied Emperor Nexus holder may use the private joint option after proving three own uncommitted spice. Original Karama and Nexus both spend at purchase commit, one exact cache card enters your hand and native once-use/capacity/reservations remain. No bank money, reimbursement, ally bonus or fake auction is created. The separate Betrayal preview may pause before those costs. This purchase composition is visibly provisional; ordinary paid use remains available.',
'A Karama cannot cancel the special purchase itself. Emperor income has a separate response: canceling that income does not undo the purchase or restore the spent special power.',
+7 -2
View File
@@ -174,6 +174,7 @@ export type RicheseCancellationContext = Pick<
| 'turn'
| 'phase'
| 'advanced'
| 'expansions'
| 'players'
| 'pendingRicheseGift'
| 'richeseGiftBlocked'
@@ -304,6 +305,10 @@ function calculate(
g.players.some((p) => p.faction === 'richese'),
'The canceled purchase income needs its original Emperor and three-spice receipt.',
);
if (object(value.resume) && Object.hasOwn(value.resume, 'phaseOpening'))
requireRichese(g.expansions.includes('ix') && object(value.resume.phaseOpening) &&
value.resume.response == null && value.resume.decision == null && value.resume.pendingKarama == null,
'The suspended Richese purchase opening lost its original clean Ix window.');
}
};
receipt(response, pending);
@@ -349,7 +354,7 @@ function calculate(
receipt(r, parent);
const nested = new Set(nextPath);
nested.add(parent);
controls(parent.resume, r.kind === 'richeseGift', nested);
controls(parent.resume, true, nested);
}
};
followResponse(value.response);
@@ -424,7 +429,7 @@ function calculate(
'The suspended BG response has no conversion declaration.',
);
};
controls(pending.resume, response.kind === 'richeseGift', new Set([pending]));
controls(pending.resume, true, new Set([pending]));
if (response.kind === 'richeseGift') {
const gift = g.pendingRicheseGift!;
const current =