Offer Semuta before clean CHOAM Kulon movement bonus
This commit is contained in:
1 parent
8f67b39735
commit
88bcb33342
8 files changed
+273
-18
No files matched your search
+72
-10
@@ -1214,6 +1214,13 @@ export type Game = {
|
||||
spiceAfter: number;
|
||||
stateSignature: string;
|
||||
}
|
||||
| {
|
||||
kind: 'choamKulonDiscard';
|
||||
player: string;
|
||||
card: string;
|
||||
before: number;
|
||||
stateSignature: string;
|
||||
}
|
||||
| {
|
||||
kind: 'thumperDiscard';
|
||||
player: string;
|
||||
@@ -4932,6 +4939,23 @@ function choamSaleDiscardSignature(g: Game, c: ChoamSaleDiscardContinuation) {
|
||||
hand: owner.hand.map(card => card.id), spice: owner.spice,
|
||||
});
|
||||
}
|
||||
type ChoamKulonDiscardContinuation = Extract<
|
||||
NonNullable<Game['pendingTreacheryDiscard']>['continuation'],
|
||||
{ kind: 'choamKulonDiscard' }
|
||||
>;
|
||||
function choamKulonDiscardSignature(g: Game, c: ChoamKulonDiscardContinuation) {
|
||||
const owner = getPlayer(g, c.player);
|
||||
return JSON.stringify({
|
||||
player: c.player, card: c.card, before: c.before,
|
||||
turn: g.turn, phase: g.phase, active: g.active, order: g.order,
|
||||
movement: g.choamMovement, remaining: g.movementRemaining,
|
||||
parent: nullentropyParentSignature(g,
|
||||
{ response: null, decision: null, pendingKarama: null, phaseOpening: null },
|
||||
`choam:kulon:${c.card}`),
|
||||
hand: owner.hand.map(card => card.id), moved: owner.moved,
|
||||
shipped: owner.shipped, spice: owner.spice,
|
||||
});
|
||||
}
|
||||
type ThumperDiscardContinuation = Extract<
|
||||
NonNullable<Game['pendingTreacheryDiscard']>['continuation'],
|
||||
{ kind: 'thumperDiscard' }
|
||||
@@ -5557,6 +5581,23 @@ function treacheryDiscardIntegrity(g: Game) {
|
||||
c.stateSignature === choamSaleDiscardSignature(g, c),
|
||||
'The sold CHOAM card no longer matches its saved income and market.',
|
||||
);
|
||||
} else if (continuation?.kind === 'choamKulonDiscard') {
|
||||
const c = continuation, entry = batch.entries[0];
|
||||
const owner = g.players.find(p => p.id === c.player);
|
||||
requireRule(
|
||||
g.phase === 5 && g.active === c.player &&
|
||||
owner?.faction === 'choam' && owner.moved < movesAllowed(g, owner) &&
|
||||
!g.pendingChoamWorthless && !g.response && !g.decision &&
|
||||
!g.phaseOpening && !g.ornithopter && !g.pendingChoamMove &&
|
||||
batch.cause === 'choam:kulon' && batch.entries.length === 1 &&
|
||||
entry.publicFace && entry.discardedBy === c.player &&
|
||||
entry.card.id === c.card && entry.card.kind === 'worthless' &&
|
||||
entry.card.name === 'Kulon' &&
|
||||
Number.isSafeInteger(c.before) && c.before >= 0 &&
|
||||
c.before === (g.choamMovement?.turn === g.turn ? g.choamMovement.bonus : 0) &&
|
||||
c.stateSignature === choamKulonDiscardSignature(g, c),
|
||||
'The used Kulon no longer matches its pending movement bonus.',
|
||||
);
|
||||
} else if (continuation?.kind === 'thumperDiscard') {
|
||||
const c = continuation, entry = batch.entries[0];
|
||||
requireRule(
|
||||
@@ -6223,6 +6264,7 @@ function semutaOfferSupported(
|
||||
continuation.kind !== 'amalDiscard' &&
|
||||
continuation.kind !== 'ixAllyCard' &&
|
||||
continuation.kind !== 'choamSaleDiscard' &&
|
||||
continuation.kind !== 'choamKulonDiscard' &&
|
||||
!(continuation.kind === 'battleCleanup' && continuation.source === 'winner') &&
|
||||
continuation.kind !== 'winnerMandatoryDiscard' &&
|
||||
continuation.kind !== 'battleResolved' &&
|
||||
@@ -6290,6 +6332,7 @@ function semutaOfferSupported(
|
||||
continuation.kind === 'battleResolved' ||
|
||||
continuation.kind === 'ixAllyCard' ||
|
||||
continuation.kind === 'choamSaleDiscard' ||
|
||||
continuation.kind === 'choamKulonDiscard' ||
|
||||
(continuation.kind === 'karamaCharityDiscard' ||
|
||||
continuation.kind === 'karamaInflationDiscard' ||
|
||||
continuation.kind === 'karamaBgCharityDiscard' ||
|
||||
@@ -6309,6 +6352,9 @@ function semutaOfferSupported(
|
||||
(continuation.kind === 'saphoAuctionDiscard' || !g.richeseAuction) &&
|
||||
(continuation.kind === 'saphoAggressorDiscard' ||
|
||||
continuation.kind === 'residualPoisonDiscard' || !g.battle) &&
|
||||
(continuation.kind !== 'choamKulonDiscard' ||
|
||||
(!g.ornithopter && !g.pendingChoamMove && !g.summonedWorm &&
|
||||
g.wormRides.length === 0)) &&
|
||||
!g.pendingExchange && !g.pendingIxAlly && !g.pendingNullentropy &&
|
||||
!g.pendingAmbassador && !g.pendingTerrorEntry && !g.pendingShipment &&
|
||||
!g.pendingHomeworldShipment && !g.pendingRicheseGift &&
|
||||
@@ -6459,6 +6505,8 @@ function finishTreacheryDiscard(g: Game, claim?: { player: string; card: string
|
||||
finishAmbassador(g);
|
||||
} else if (next.kind === 'choamSaleDiscard') {
|
||||
resumeChoamMarket(g);
|
||||
} else if (next.kind === 'choamKulonDiscard') {
|
||||
completeChoamKulon(g, getPlayer(g, next.player));
|
||||
} else if (next.kind === 'nullentropyDiscard') {
|
||||
g.response = next.resume.response;
|
||||
g.decision = next.resume.decision;
|
||||
@@ -20277,6 +20325,13 @@ function currentPlacementCancellationQuote(g: Game, response: ResponseWindow) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
function completeChoamKulon(g: Game, owner: Player) {
|
||||
g.choamMovement = {
|
||||
turn: g.turn,
|
||||
bonus: (g.choamMovement?.turn === g.turn ? g.choamMovement.bonus : 0) + 1,
|
||||
};
|
||||
log(g, `${owner.name} used Kulon to move one extra territory this turn.`);
|
||||
}
|
||||
function finishResponse(g: Game, canceled: boolean,bureaucratDiversion?:number) {
|
||||
karamaConversionIntegrity(g);
|
||||
currentFactionPayment(g);
|
||||
@@ -20626,18 +20681,25 @@ function finishResponse(g: Game, canceled: boolean,bureaucratDiversion?:number)
|
||||
(pending.effect !== 'jubba' ||
|
||||
choamStormOptions(g).some((t) => t.territory === pending.location))
|
||||
) {
|
||||
discard(g, choam, pending.card);
|
||||
const used = discard(g, choam, pending.card);
|
||||
finishNexusChoam(g,pending,'complete');
|
||||
if (pending.effect === 'kulon') {
|
||||
g.choamMovement = {
|
||||
turn: g.turn,
|
||||
bonus:
|
||||
(g.choamMovement?.turn === g.turn ? g.choamMovement.bonus : 0) + 1,
|
||||
};
|
||||
log(
|
||||
g,
|
||||
`${choam.name} used Kulon to move one extra territory this turn.`,
|
||||
);
|
||||
if (g.semutaPreview && used.name === 'Kulon' &&
|
||||
!pending.storm && !pending.revival && !pending.movement &&
|
||||
!pending.mentat && !pending.nexusEvent) {
|
||||
const continuation: ChoamKulonDiscardContinuation = {
|
||||
kind: 'choamKulonDiscard', player: choam.id, card: used.id,
|
||||
before: g.choamMovement?.turn === g.turn ? g.choamMovement.bonus : 0,
|
||||
stateSignature: '',
|
||||
};
|
||||
const entries = [{ card: used, discardedBy: choam.id, publicFace: true }];
|
||||
if (semutaOfferSupported(g, continuation, entries)) {
|
||||
continuation.stateSignature = choamKulonDiscardSignature(g, continuation);
|
||||
stageTreacheryDiscard(g, 'choam:kulon', entries, continuation);
|
||||
return;
|
||||
}
|
||||
}
|
||||
completeChoamKulon(g, choam);
|
||||
} else if (pending.effect === 'jubba') {
|
||||
(g.stormResolution!.choamProtected ??= []).push(pending.location!);
|
||||
log(
|
||||
|
||||
+4
-4
@@ -1156,7 +1156,7 @@ export const RULE_TOPICS: RuleTopic[] = [
|
||||
: definition.card.effect === 'portableSnooper'
|
||||
? 'Choose Portable Snooper as your ordinary poison defense, or use the late-defense panel after reveal before your own traitor decision. It uses ordinary winner retention and cannot stop Poison Tooth.'
|
||||
: definition.card.effect === 'semutaDrug'
|
||||
? 'In the explicit Richese development preview, every seat sees a neutral response to supported clean discards. A CHOAM & Richese game may include the Ix deck: Thumper pauses before worm/spice draw; Amal pauses after halving spice before opening resumes. Other public sources include ordinary cards, paid Box, Ornithopter, Distrans, final Truthtrance, four clean Sapho scopes, pre-leader Residual Poison, printed Karama canceling clean CHOAM Charity, Inflation or Bene Gesserit Charity, a clean printed Karama normal-auction purchase or winning-bid payment before lot settlement, a completed CHOAM card sale after its bank income, and three battle batches. A private normal-auction Ixian ally replacement also pauses before drawing, without showing its face until a holder commits. Commit held Semuta with a free hand slot; for multiple eligible cards, inspect and select exactly one after commitment. Saved effects resume once. Other private discards, Karama uses, inspected/partly ready battles, nested responses, pending rewards, full-hand sequencing and public starts remain unfinished.'
|
||||
? 'In the explicit Richese development preview, every seat sees a neutral response to supported clean discards. A CHOAM & Richese game may include the Ix deck: Thumper pauses before worm/spice draw; Amal pauses after halving spice before opening resumes. Other public sources include ordinary cards, paid Box, Ornithopter, Distrans, final Truthtrance, four clean Sapho scopes, pre-leader Residual Poison, printed Karama canceling clean CHOAM Charity, Inflation or Bene Gesserit Charity, a clean printed Karama normal-auction purchase or winning-bid payment before lot settlement, a completed CHOAM card sale after its bank income, clean Kulon Worthless disposal before its movement bonus, and three battle batches. A private normal-auction Ixian ally replacement also pauses before drawing, without showing its face until a holder commits. Commit held Semuta with a free hand slot; for multiple eligible cards, inspect and select exactly one after commitment. Saved effects resume once. Other private discards, Karama uses, inspected/partly ready battles, nested responses, pending rewards, full-hand sequencing and public starts remain unfinished.'
|
||||
: 'Reference component only: this Richese card’s game actions are not enabled.',
|
||||
],
|
||||
...(definition.card.effect === 'semutaDrug'
|
||||
@@ -1166,7 +1166,7 @@ export const RULE_TOPICS: RuleTopic[] = [
|
||||
area: 'Implementation' as const,
|
||||
status: 'Partial' as const,
|
||||
detail:
|
||||
'The Richese preview interrupts clean ordinary-card, paid Box, Ornithopter, Distrans, Truthtrance, four Sapho scopes, pre-leader Residual Poison, printed Karama canceling clean CHOAM Charity, Inflation or Bene Gesserit Charity or settling a normal auction purchase or winning bid, a completed CHOAM card sale, Ix-deck Thumper/Amal and three battle discard stages. A private normal-auction Ixian ally replacement pauses before its draw with a neutral, face-hidden offer. CHOAM sale income is committed before its neutral offer and the same market resumes once. Karama’s physical cost is discarded before its neutral offer; the original response is canceled or the reserved lot settles once. Residual Poison commits one random leader death; Sapho commits its finite priority. Thumper waits before worm/spice draw; Amal restores an already-halved opening. Owner-only candidates and one physical Semuta transfer retain privacy. Other Karama uses, private discards, nested responses, pending rewards and full-hand exchange remain unfinished.',
|
||||
'The Richese preview interrupts clean ordinary-card, paid Box, Ornithopter, Distrans, Truthtrance, four Sapho scopes, pre-leader Residual Poison, printed Karama canceling clean CHOAM Charity, Inflation or Bene Gesserit Charity or settling a normal auction purchase or winning bid, a completed CHOAM sale, clean Kulon Worthless use, Ix-deck Thumper/Amal and three battle discard stages. A private normal-auction Ixian ally replacement pauses before its draw with a neutral, face-hidden offer. CHOAM sale income is committed before its neutral offer and the same market resumes once; Kulon adds its one movement range only after the offer. Karama’s physical cost is discarded before its neutral offer; the original response is canceled or the reserved lot settles once. Residual Poison commits one random leader death; Sapho commits its finite priority. Thumper waits before worm/spice draw; Amal restores an already-halved opening. Owner-only candidates and one physical Semuta transfer retain privacy. Other Karama uses, private discards, nested responses, pending rewards and full-hand exchange remain unfinished.',
|
||||
},
|
||||
{
|
||||
area: 'Player controls' as const,
|
||||
@@ -1184,13 +1184,13 @@ export const RULE_TOPICS: RuleTopic[] = [
|
||||
area: 'Documentation' as const,
|
||||
status: 'Partial' as const,
|
||||
detail:
|
||||
'The guide distinguishes clean public ordinary-card, paid Box, Ornithopter, Distrans, Truthtrance, four Sapho scopes, pre-leader Residual Poison, printed Karama cancellation of CHOAM Charity, Inflation or Bene Gesserit Charity or clean normal-auction purchase or winning-bid payment, completed CHOAM card sales, Ix-deck Thumper/Amal and three battle batches from a private normal-auction Ixian ally replacement, privacy-neutral acknowledgements, provisional free-slot policy and remaining discard sources.',
|
||||
'The guide distinguishes clean public ordinary-card, paid Box, Ornithopter, Distrans, Truthtrance, four Sapho scopes, pre-leader Residual Poison, printed Karama cancellation of CHOAM Charity, Inflation or Bene Gesserit Charity or clean normal-auction purchase or winning-bid payment, completed CHOAM card sales, clean Kulon Worthless, Ix-deck Thumper/Amal and three battle batches from a private normal-auction Ixian ally replacement, privacy-neutral acknowledgements, provisional free-slot policy and remaining discard sources.',
|
||||
},
|
||||
{
|
||||
area: 'Verification' as const,
|
||||
status: 'Partial' as const,
|
||||
detail:
|
||||
'Genuine setup, custody, hidden-hand parity, saved JSON, authenticated SQLite continuation and legal AI participation cover clean ordinary-card, paid Box, Ornithopter, Distrans, Truthtrance, four Sapho scopes, pre-leader Residual Poison, printed Karama cancellation of CHOAM Charity, Inflation or Bene Gesserit Charity or clean normal-auction purchase or winning-bid payment, completed CHOAM card sales, Ix-deck Thumper/Amal, a private normal-auction Ixian ally replacement and three battle discard stages. Other private producers, Karama uses, pending rewards, full games and live deployment remain unverified.',
|
||||
'Genuine setup, custody, hidden-hand parity, saved JSON, authenticated SQLite continuation and legal AI participation cover clean ordinary-card, paid Box, Ornithopter, Distrans, Truthtrance, four Sapho scopes, pre-leader Residual Poison, printed Karama cancellation of CHOAM Charity, Inflation or Bene Gesserit Charity or clean normal-auction purchase or winning-bid payment, completed CHOAM card sales, clean Kulon Worthless, Ix-deck Thumper/Amal, a private normal-auction Ixian ally replacement and three battle discard stages. Other private producers, Karama uses, pending rewards, full games and live deployment remain unverified.',
|
||||
evidence: [
|
||||
'tests/semuta-engine.test.ts',
|
||||
'tests/semuta-recovery.test.ts',
|
||||
|
||||
Reference in new issue
Block a user