Allow user-approved atomic full-hand Semuta exchange

This commit is contained in:
Quintine committed 2026-09-30 17:39:23 +10:00
1 parent 98d556a0e0
commit 3285172eec
16 files changed
+168 -69

No files matched your search

+3 -3
View File
@@ -6554,7 +6554,7 @@ function semutaContext(g: Game, owner: Player): SemutaContext {
batch: pending.batch, event: pending.batch.event, turn: g.turn, phase: g.phase,
owner: owner.id, ownerHand: owner.hand, discard: g.discard,
semutaId: SEMUTA_DRUG_ID, handLimit: handLimit(owner),
incomingReservedSlots: 0, capacityPolicy: 'freeSlot', reservedTargetIds: [],
incomingReservedSlots: 0, reservedTargetIds: [],
};
}
function semutaCandidates(g: Game, owner: Player) {
@@ -6587,8 +6587,8 @@ function projectedSemutaReaction(g: Game, me: Player) {
const held = !!semuta;
const blocked = !held || passed ? null
: transferCardBlock(g, me, semuta!) ??
(me.hand.length >= handLimit(me)
? 'A free hand slot is required before taking a card with Semuta Drug.'
(me.hand.length > handLimit(me)
? 'Resolve your excess hand cards before using Semuta Drug.'
: pending.batch.entries.every(entry => entry.discardedBy === me.id)
? 'No other player discarded a card in this fresh event.'
: null);
+3 -3
View File
@@ -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, clean Kulon Worthless disposal before its movement bonus, proactive La La La disposal before blocking free revival, proactive Baliset before restricting movement, proactive ordinary Trip to Gamont before returning a force, accepted Jubba Cloak before storm protection, 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, reactive Worthless uses except printed Jubba, elite or concealed Trip returns, 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, proactive La La La disposal before blocking free revival, proactive Baliset before restricting movement, proactive ordinary Trip to Gamont before returning a force, accepted Jubba Cloak before storm protection, and three battle batches. A private normal-auction Ixian ally replacement also pauses before drawing, without showing its face until a holder commits. Under the user-selected exchange ruling, Commit may replace Semuta even at your faction hand limit: acquisition and Semuta disposal settle atomically, without increasing your completed hand. Reserved incoming cards still need room. For multiple eligible cards, inspect and select exactly one after commitment. Saved effects resume once. Other private discards, Karama uses, reactive Worthless uses except printed Jubba, elite or concealed Trip returns, inspected/partly ready battles, nested responses, pending rewards 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 sale, clean Kulon and proactive La La La/Baliset/ordinary Trip to Gamont Worthless use, accepted printed Jubba before storm protection, 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 one movement range, La La La blocks one target’s free revival, Baliset restricts the chosen player’s movement, ordinary Trip returns one selected force, and Jubba protects one CHOAM territory only after their offers. 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, other reactive Worthless 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 and proactive La La La/Baliset/ordinary Trip to Gamont Worthless use, accepted printed Jubba before storm protection, 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 one movement range, La La La blocks one target’s free revival, Baliset restricts the chosen player’s movement, ordinary Trip returns one selected force, and Jubba protects one CHOAM territory only after their offers. 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. The user-approved full-hand exchange preserves final hand count and incoming reservations. Other Karama uses, other reactive Worthless uses, private discards, nested responses and pending rewards remain unfinished.',
},
{
area: 'Player controls' as const,
@@ -1184,7 +1184,7 @@ 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, clean Kulon/proactive La La La/Baliset/ordinary Trip to Gamont Worthless and accepted printed Jubba Cloak, 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/proactive La La La/Baliset/ordinary Trip to Gamont Worthless and accepted printed Jubba Cloak, Ix-deck Thumper/Amal and three battle batches from a private normal-auction Ixian ally replacement, privacy-neutral acknowledgements, the user-approved atomic full-hand exchange and remaining discard sources.',
},
{
area: 'Verification' as const,
+7 -18
View File
@@ -25,8 +25,6 @@ export type SemutaContext = {
semutaId: string;
handLimit: number;
incomingReservedSlots: number;
/** Mandatory caller policy; neither full-hand ruling is inferred here. */
capacityPolicy: 'exchange' | 'freeSlot';
reservedTargetIds: readonly string[];
};
export type SemutaCommitment = {
@@ -96,23 +94,14 @@ function validate(context: SemutaContext) {
throw new Error(
'Semuta requires a current owner, event and physical card custody.',
);
if (
!count(context.handLimit) ||
!count(context.incomingReservedSlots) ||
!['exchange', 'freeSlot'].includes(context.capacityPolicy)
)
if (!count(context.handLimit) || !count(context.incomingReservedSlots))
throw new Error(
'Semuta requires an explicit capacity policy and nonnegative safe hand limits and reservations.',
);
const occupied = context.ownerHand.length;
const room = context.handLimit - context.incomingReservedSlots;
if (
occupied > room ||
(context.capacityPolicy === 'freeSlot' && occupied >= room)
)
throw new Error(
'The selected Semuta capacity policy leaves no available hand capacity.',
'Semuta requires nonnegative safe hand limits and reservations.',
);
// User-selected exchange: the acquired card replaces Semuta atomically.
// Mandatory incoming cards still require capacity in the completed hand.
if (context.ownerHand.length > context.handLimit - context.incomingReservedSlots)
throw new Error('Semuta exchange exceeds available hand capacity.');
const seen = new Set<string>();
for (const card of [
...Array.from(context.ownerHand),
@@ -206,7 +195,7 @@ export function committedSemutaCandidates(
* Fresh-event transfer only. Engine owns timing, globally unique custody outside
* these supplied zones, activation reservations and persisted commitment. A
* direct selection is also usable when the target face is already authorized.
* Capacity is evaluated under the caller's explicit ruling; no spice is paid.
* Acquisition and disposal form an atomic exchange; no spice is paid.
*/
export function resolveSemutaDrug(
context: SemutaContext,