Pause printed CHOAM power cancellation costs for Semuta

This commit is contained in:
Quintine committed 2026-10-12 12:39:30 +11:00
1 parent bb6835e6c3
commit f68c556f8a
8 files changed
+244 -10

No files matched your search

+44 -10
View File
@@ -1344,7 +1344,7 @@ export type Game = {
stateSignature: string;
}
| {
kind: 'karamaCharityDiscard' | 'karamaInflationDiscard' | 'karamaBgCharityDiscard' | 'karamaBattleDiscard';
kind: 'karamaCharityDiscard' | 'karamaInflationDiscard' | 'karamaBgCharityDiscard' | 'karamaBattleDiscard' | 'karamaChoamWorthlessDiscard';
player: string;
card: string;
use: Extract<KaramaUse, { kind: 'cancel' }>;
@@ -5151,12 +5151,23 @@ function semutaBattleKaramaResponse(g: Game, response: ResponseWindow): boolean
(!g.advanced && response.kind === 'moritaniRetention' &&
g.moritaniRetention?.source === undefined);
}
/** Keep the same ordinary reactive parents admitted by the five printed cost continuations. */
function semutaChoamKaramaResponse(g: Game, response: ResponseWindow): boolean {
const pending = g.pendingChoamWorthless;
if (response.kind !== 'choamWorthless' || !pending || pending.effect === 'kull' ||
pending.owner !== response.owner || g.battle || g.ornithopter ||
g.pendingArrivalOverlap || g.ecologicalStorm) return false;
const movement = g.pendingChoamMove;
return !movement || (!movement.source && !movement.ornithopterEvent &&
!movement.ornithopterRange && !movement.discoveryFlight);
}
type KaramaResponseDiscardContinuation = Extract<
NonNullable<Game['pendingTreacheryDiscard']>['continuation'],
{ kind: 'karamaCharityDiscard' | 'karamaInflationDiscard' | 'karamaBgCharityDiscard' | 'karamaBattleDiscard' }
{ kind: 'karamaCharityDiscard' | 'karamaInflationDiscard' | 'karamaBgCharityDiscard' | 'karamaBattleDiscard' | 'karamaChoamWorthlessDiscard' }
>;
function karamaResponseDiscardSignature(g: Game, c: KaramaResponseDiscardContinuation) {
const battle = c.kind === 'karamaBattleDiscard';
const worthless = c.kind === 'karamaChoamWorthlessDiscard';
return JSON.stringify({
player: c.player, card: c.card, use: c.use,
parent: nullentropyParentSignature(g, c.resume,
@@ -5175,12 +5186,17 @@ function karamaResponseDiscardSignature(g: Game, c: KaramaResponseDiscardContinu
battleContext: battle ? g.lastBattleContext : undefined,
retention: battle ? g.moritaniRetention : undefined,
techTokens: battle ? g.techTokens : undefined,
choamWorthless: worthless ? {
declaration: g.pendingChoamWorthless, movement: g.pendingChoamMove,
revival: g.pendingRevival, storm: g.stormResolution,
mentat: g.choamMentatPending, nexus: g.nexusChoamHistory?.at(-1),
} : undefined,
order: g.order,
players: g.players.map(p => ({
id: p.id, faction: p.faction, ally: p.ally,
hand: p.hand.map(card => card.id), spice: p.spice,
physical: battle ? { forces: p.forces, reserves: p.reserves, tanks: p.tanks,
elites: p.elites, leaders: p.leaders } : undefined,
physical: battle || worthless ? { forces: p.forces, reserves: p.reserves, tanks: p.tanks,
elites: p.elites, leaders: battle ? p.leaders : undefined } : undefined,
})),
});
}
@@ -5942,7 +5958,8 @@ function treacheryDiscardIntegrity(g: Game) {
} else if (continuation?.kind === 'karamaCharityDiscard' ||
continuation?.kind === 'karamaInflationDiscard' ||
continuation?.kind === 'karamaBgCharityDiscard' ||
continuation?.kind === 'karamaBattleDiscard') {
continuation?.kind === 'karamaBattleDiscard' ||
continuation?.kind === 'karamaChoamWorthlessDiscard') {
const c = continuation, entry = batch.entries[0];
requireRule(
!g.response &&
@@ -5958,7 +5975,9 @@ function treacheryDiscardIntegrity(g: Game) {
g.players.some(p => p.id === c.use.response.owner &&
p.faction === 'beneGesserit' && p.charityTurn === g.turn)) ||
(c.kind === 'karamaBattleDiscard' && g.phase === 6 && !g.battle &&
semutaBattleKaramaResponse(g, c.use.response))) &&
semutaBattleKaramaResponse(g, c.use.response)) ||
(c.kind === 'karamaChoamWorthlessDiscard' &&
semutaChoamKaramaResponse(g, c.use.response))) &&
c.use.response.owner !== c.player &&
c.resume.response?.kind === c.use.response.kind &&
JSON.stringify(c.resume.response) === JSON.stringify(c.use.response) &&
@@ -5978,6 +5997,13 @@ function treacheryDiscardIntegrity(g: Game) {
ixSubstitutionCancellationQuote(g, c.use.response);
else validateAftermathCancellation(g, c.use.response);
}
if (c.kind === 'karamaChoamWorthlessDiscard') {
try { quoteChoamWorthlessCancellation(g, c.use.response); }
catch (error) {
if (error instanceof ChoamWorthlessCancellationError) throw new RuleError(error.message);
throw error;
}
}
} else if (continuation?.kind === 'karamaPurchaseDiscard' ||
continuation?.kind === 'karamaPaymentDiscard') {
const c = continuation, entry = batch.entries[0];
@@ -6775,6 +6801,7 @@ function semutaOfferSupported(
continuation.kind !== 'karamaInflationDiscard' &&
continuation.kind !== 'karamaBgCharityDiscard' &&
continuation.kind !== 'karamaBattleDiscard' &&
continuation.kind !== 'karamaChoamWorthlessDiscard' &&
continuation.kind !== 'karamaPurchaseDiscard' &&
continuation.kind !== 'karamaPaymentDiscard' &&
continuation.kind !== 'thumperDiscard' &&
@@ -6854,10 +6881,13 @@ function semutaOfferSupported(
(continuation.kind === 'karamaCharityDiscard' ||
continuation.kind === 'karamaInflationDiscard' ||
continuation.kind === 'karamaBgCharityDiscard' ||
continuation.kind === 'karamaBattleDiscard'
continuation.kind === 'karamaBattleDiscard' ||
continuation.kind === 'karamaChoamWorthlessDiscard'
? (continuation.kind === 'karamaBattleDiscard'
? semutaBattleKaramaResponse(g, continuation.use.response)
: ['choamCharity', 'choamInflation', 'bgCharity'].includes(continuation.resume.response?.kind ?? '')) &&
: continuation.kind === 'karamaChoamWorthlessDiscard'
? semutaChoamKaramaResponse(g, continuation.use.response)
: ['choamCharity', 'choamInflation', 'bgCharity'].includes(continuation.resume.response?.kind ?? '')) &&
!continuation.resume.decision && !continuation.resume.pendingKarama &&
!continuation.resume.phaseOpening && !g.pendingKarama &&
(!g.response || JSON.stringify(g.response) === JSON.stringify(continuation.resume.response))
@@ -6879,6 +6909,7 @@ function semutaOfferSupported(
continuation.kind === 'karamaInflationDiscard' ||
continuation.kind === 'karamaBgCharityDiscard' ||
continuation.kind === 'karamaBattleDiscard' ||
continuation.kind === 'karamaChoamWorthlessDiscard' ||
(!continuation.resume.response && !continuation.resume.decision &&
!continuation.resume.pendingKarama &&
(continuation.kind === 'amalDiscard'
@@ -7143,6 +7174,7 @@ function finishTreacheryDiscard(g: Game, claim?: { player: string; card: string
next.kind === 'karamaInflationDiscard' ||
next.kind === 'karamaBgCharityDiscard' ||
next.kind === 'karamaBattleDiscard' ||
next.kind === 'karamaChoamWorthlessDiscard' ||
next.kind === 'karamaPurchaseDiscard' ||
next.kind === 'karamaPaymentDiscard') {
g.response = next.resume.response;
@@ -13355,13 +13387,15 @@ function spendKarama(g: Game, p: Player, card: Card, use: KaramaUse, kullOffered
use.kind === 'cancel' &&
(use.response.kind === 'choamCharity' ||
use.response.kind === 'choamInflation' ||
use.response.kind === 'bgCharity' || semutaBattleKaramaResponse(g, use.response))) {
use.response.kind === 'bgCharity' || semutaBattleKaramaResponse(g, use.response) ||
semutaChoamKaramaResponse(g, use.response))) {
const continuation: KaramaResponseDiscardContinuation = {
kind: use.response.kind === 'choamCharity'
? 'karamaCharityDiscard'
: use.response.kind === 'choamInflation'
? 'karamaInflationDiscard'
: use.response.kind === 'bgCharity' ? 'karamaBgCharityDiscard' : 'karamaBattleDiscard',
: use.response.kind === 'bgCharity' ? 'karamaBgCharityDiscard'
: use.response.kind === 'choamWorthless' ? 'karamaChoamWorthlessDiscard' : 'karamaBattleDiscard',
player: p.id, card: used.id, use,
resume: { response: g.response, decision: g.decision,
pendingKarama: g.pendingKarama, phaseOpening: g.phaseOpening },
+2
View File
@@ -1183,6 +1183,7 @@ export const RULE_TOPICS: RuleTopic[] = [
'The explicit fresh Leader Skills entry composes Semuta with original all-fourteen-card native Basic Richese/CHOAM or Advanced E1/E2 setup, retaining original Tech and Advanced Stronghold prerequisites. Actual offers train original living discs; the native Auditor remains ineligible. A completed Hajr discard can resume the same Movement owner before an original private Mentat question. Mandatory loser disposal can resume trained Suk casualty rescue or Rihani’s normal private inspection and optional skilled exchange before winner cleanup. Winning compulsory Artillery stays held through the original skill, then becomes its own fresh Treachery discard. Traitor/Face Dancer movement is never a Semuta target; no rescue, question, inspection or exchange repeats. Basic Ix mixtures, E3, other module/Banker overlays and public starts stay separate.',
'The fresh semuta --nexus-cards entry retains original native E1/E2 Nexus setup, optionally explicit Skills and original Tech/Advanced Strongholds. There is no starting Nexus hand: an actual qualifying closing draw follows a Nexus and settled alliance. CHOAM Secret Ally with CHOAM absent spends a Worthless and its Nexus for two bank spice before the public discard offer; CHOAM Betrayal with CHOAM seated commits one random actual hand-card discard without compensation before its private offer. Claim or Continue retires the original receipt once, without another payment or sample. Separate Nexus cards never become Treachery targets. Homeworlds, Discovery, E3, played-save conversion and public starts stay gated.',
'The same original native Nexus entry offers the actual CHOAM Cunning fuel discard for Kulon, Gamont, Baliset, La La La and Jubba. Any eligible held Treachery card keeps its printed identity and private face; there is no fabricated named Worthless. Original cancellation retains fuel and the spent Nexus. After allowance, Commit or Continue resumes the selected effect and parent once: one range bonus, one typed force return and original closing owner, stopped ordinary movement/free revival, or one threatened-territory storm protection. Jubba protects CHOAM forces, not spice; unprotected forces and covered spice still suffer the original storm. Kull retains its separate guard.',
'A distinct printed Karama canceling those five ordinary native CHOAM printed or Cunning powers also offers its public cost before the original denial completes. CHOAM retains the declared fuel; a Cunning Nexus remains spent. Claim or Continue restores the same saved response and one original movement, free-revival, storm or closing-Mentat suffix. Acquiring Karama cannot return the canceled force, grant range, stop the original request, protect the storm or restore Nexus. The retained CHOAM fuel is not a discard candidate; Kull and unsupported arrival/flight parents remain separate.',
'An ordinary Ghola played during battle also offers its consumed card after revival. Claim or Continue preserves the revived leader or forces and the opposing sealed plan, then normal planning resumes. It cannot revive again by resuming the receipt.',
'A completed paid Nullentropy Box search during battle offers only the used Box. Claim or Continue preserves the two-spice payment, private recovered card, already-shuffled pile and sealed opposing plan. The recovered card may be used in normal legal planning; the search is not repeated.',
'A clean Distrans transfer during battle also offers only the used Distrans. The private card has already reached its recipient; claim or Continue cannot repeat the gift or change a sealed plan. A recipient holding Semuta may claim the used Distrans and keep the already-transferred card.',
@@ -1249,6 +1250,7 @@ export const RULE_TOPICS: RuleTopic[] = [
'tests/semuta-nexus-betrayal.test.ts',
'tests/semuta-nexus-cunning-proactive.test.ts',
'tests/semuta-nexus-cunning-reactive.test.ts',
'tests/semuta-choam-karama.test.ts',
],
},
],