Support native Truthtrance questions with Basic Kull

This commit is contained in:
Quintine committed 2026-10-27 21:39:42 +11:00
1 parent 1059cc1682
commit f96183f350
15 files changed
+443 -26

No files matched your search

+7 -4
View File
@@ -1,4 +1,5 @@
import { nativePromiseScopeSupported, type NativePromiseScope } from './native-promise-scope';
import { bribePromiseModeSupported } from './bribe-promises';
import { NexusAllianceError, quoteNexusAlliance } from './nexus-alliance';
export type AllianceClaim = { turn: number; partner: string };
@@ -39,14 +40,16 @@ export function parseAllianceClaim(value: unknown): AllianceClaim {
return { turn: input.turn, partner: input.partner };
}
/** This is the original bare native context. An ordinary worm Nexus does not
* require selecting the optional Nexus Cards module or change a start gate. */
/** An ordinary worm Nexus does not require the optional Nexus Cards module.
* Printed Kull can coexist in its existing supported Basic bribe envelope;
* native offers and final membership retain their independent continuation. */
export function alliancePromiseModeSupported(game: NativePromiseScope & {
semutaPreview?: unknown; kullPreview?: unknown; nexusKullPreview?: unknown;
richeseBetrayalPreview?: unknown;
}): boolean {
return nativePromiseScopeSupported(game) && !game.semutaPreview && !game.kullPreview &&
!game.nexusKullPreview && !game.richeseBetrayalPreview;
return nativePromiseScopeSupported(game) && !game.semutaPreview &&
!game.nexusKullPreview && !game.richeseBetrayalPreview &&
(!game.kullPreview || bribePromiseModeSupported(game));
}
export function allianceClaimText(claim: AllianceClaim, partnerName: (id: string) => string = id => id): string {
+8 -3
View File
@@ -1,4 +1,5 @@
import { nativePromiseScopeSupported, type NativePromiseScope } from './native-promise-scope';
import { bribePromiseModeSupported } from './bribe-promises';
export type BidClaim = { turn: number; lot: number; minimum: number };
export type BidPromise = BidClaim & {
@@ -31,10 +32,14 @@ export function parseBidClaim(value: unknown): BidClaim {
* retain their own required future commitment work. Never changes start gates. */
export function bidPromiseModeSupported(game: NativePromiseScope & {
semutaPreview?: unknown; kullPreview?: unknown; nexusKullPreview?: unknown;
richeseBetrayalPreview?: unknown;
richeseBetrayalPreview?: unknown; guildBetrayalPreview?: unknown;
nexusIxianReplacementPreview?: unknown; nexusIxianBetrayalPreview?: unknown;
nexusHarkonnenBetrayalPreview?: unknown; moritaniAssassinatePreview?: unknown;
mobileStronghold?: unknown;
}): boolean {
return nativePromiseScopeSupported(game) && !game.semutaPreview && !game.kullPreview &&
!game.nexusKullPreview && !game.richeseBetrayalPreview;
return nativePromiseScopeSupported(game) && !game.semutaPreview &&
!game.nexusKullPreview && !game.richeseBetrayalPreview &&
(!game.kullPreview || bribePromiseModeSupported(game));
}
export function bidClaimText(claim: BidClaim): string {
+11 -5
View File
@@ -15417,7 +15417,7 @@ function allianceOpportunity(g: Game): AllianceOpportunity | null {
}
function allianceQuestionWindow(g: Game): boolean {
return !!allianceOpportunity(g) && !g.spiceWindow && !g.spiceResolution && !g.response &&
!g.decision && !g.phaseOpening && !g.pendingTreacheryDiscard && !g.pendingKarama;
!g.decision && !g.phaseOpening && !g.pendingTreacheryDiscard && !g.pendingKarama && !g.pendingKull;
}
/** The original native reciprocal quote owns identity and pairing legality. */
function normalNexusAllianceQuote(g: Game, p: Player, target: string | null) {
@@ -16216,7 +16216,7 @@ function bidOpportunity(g: Game): BidOpportunity | null {
}
function bidQuestionWindow(g: Game): boolean {
return !!bidOpportunity(g) && !g.response && !g.decision && !g.phaseOpening && !g.richeseAuction &&
!g.ixAuction && !g.pendingKarama && !g.pendingTreacheryDiscard;
!g.ixAuction && !g.pendingKarama && !g.pendingTreacheryDiscard && !g.pendingKull;
}
/** A future lot is a witness only after a real funded bid has committed the
* current lot to sale. An unbid lot ends ordinary Bidding instead of opening
@@ -16445,7 +16445,7 @@ function projectedRicheseBidGuide(g: Game, player: string): {action:Action} | nu
function phaseBidQuestionWindow(g: Game): boolean {
return g.status === 'playing' && g.phase >= 0 && g.phase <= 3 && phaseBidPromiseModeSupported(g) &&
!g.response && !g.decision && !g.phaseOpening && !g.pendingKarama && !g.pendingTreacheryDiscard &&
!g.richeseAuction && !g.ixAuction && !g.currentAuctionSale && (g.phase < 3 || !!bidOpportunity(g));
!g.pendingKull && !g.richeseAuction && !g.ixAuction && !g.currentAuctionSale && (g.phase < 3 || !!bidOpportunity(g));
}
function phaseBidHonorsTurnActions(g: Game, p: Player, lot: BidOpportunity, action: Action): boolean {
if (!liveTurnActionPromises(g.turnActionPromises ?? [],p.id,g.turn).length) return true;
@@ -17681,6 +17681,12 @@ function normalKaramaAuction(
!payment || a.bidder === p.id,
'Only the original winning bidder may choose the auction payment.',
);
// A direct purchase closes the lot without placing the promised bid. Check
// before opening Kull: a later interruption must not hide the actor's own
// voluntary attempt to evade the original Truthtrance answer.
const opportunity = !payment && g.kullPreview ? bidOpportunity(g) : null;
requireRule(!opportunity || !bidRequired(g.bidPromises ?? [], p.id, opportunity),
'Place your promised Truthtrance bid before taking this lot with Karama.');
requireRule(
p.hand.length - Number(payment && spendingCard) < handLimit(p),
'Leave room for the committed Karama auction purchase.',
@@ -34362,7 +34368,7 @@ function revivalOpportunity(g: Game, player: string): boolean {
function revivalQuestionWindow(g: Game): boolean {
return g.status === 'playing' && g.phase >= 0 && g.phase <= 4 && revivalPromiseModeSupported(g) &&
!g.response && !g.decision && !g.phaseOpening && !g.pendingRevival &&
!g.pendingKarama && !g.pendingTreacheryDiscard;
!g.pendingKarama && !g.pendingTreacheryDiscard && !g.pendingKull;
}
function stagePromisedForceReturn(g: Game, p: Player, revival: PendingRevival) {
const quote = currentRevivalResumeQuote({ ...g, pendingRevival: { ...revival, checks: [] } }, 'finish');
@@ -34713,7 +34719,7 @@ function reconcileRevivalPromises(g: Game, voluntary?: { actor: string; action:
function projectedTypedRevivalPromiseGuide(g: Game, player: string, kind: 'forces' | 'leader' | 'expression'): { phase: number; action: Action } | null {
const ownPayment = g.phase === 3 && !g.response && !g.phaseOpening && g.decision?.kind === 'auctionPayment' && g.decision.player === player;
if ((!revivalQuestionWindow(g) && !ownPayment) || g.truthtrance || !revivalOpportunity(g, player) ||
g.pendingRevival || g.pendingKarama || g.pendingTreacheryDiscard ||
g.pendingRevival || g.pendingKarama || g.pendingTreacheryDiscard || g.pendingKull ||
g.phase === 4 && nativeRevivalOrderBlock(g, player) ||
g.phase === 2 && nativeCharityOrderBlock(g, player)) return null;
// The separate bid guide owns a jointly binding Yes declaration. Passing
+2 -2
View File
@@ -4783,7 +4783,7 @@ export const RULE_TOPICS: RuleTopic[] = [
summary: 'React before a Karama is played; a distinct counter can stop Kull before its phase restriction begins.',
steps: [
'In the lobby, the host can opt into this Basic development preview with CHOAM, Richese, Ixians, Tleilaxu, Ecaz, Moritani and classic factions, the CHOAM and Ix decks, each seated faction’s deck, and no other optional modules. It uses printed ordinary Karama. The preview withholds some structured Truthtrance question types and defers unfunded non-CHOAM Karama-dependent bids; leave it off to retain the ordinary current game. A separate Advanced development profile supports Bene Gesserit substitutions and legal special powers. Existing games are not retrofitted, and the warning is not rules-completion approval.',
'In the supported Basic printed Kull preview without Richese, ordinary, grouped and mixed Truthtrance bribe questions remain available. The existing Semuta preview does not yet admit structured bribe commitments. A pending Kull response temporarily holds bribe controls; its real resolution resumes the existing commitment. Other structured question types remain incomplete in this preview.',
'In the supported Basic printed Kull preview without Richese, existing current-lot ordinary bid, Revival, alliance and bribe Truthtrance questions are available, including supported grouped and mixed forms. A pending Kull response holds their controls while the original transaction resolves. The existing Richese Semuta preview does not yet admit these structured commitments; phase-wide bid and combined turn-action questions and wider interactions remain incomplete.',
'Another player’s legal Karama cancellation, shipment-rate use, immediate auction purchase, winning-bid payment or supported special activation pauses before its card and other costs. CHOAM sees the attempted player and purpose and may decline or choose a legal held Kull Wahad. Each Use names its printed source explicitly. The separate Nexus Kull guide covers additional Cunning costs in its new profile only. The same public opportunity appears without Kull in hand, so waiting does not disclose hidden ownership. Invalid attempts never open this window; CHOAM does not receive a self-targeted Kull offer.',
'Decline resumes the original attempt once. Declaring Kull opens the ordinary CHOAM-effect response. Kull is still pending: its target may counter with a different eligible physical Karama before any phase ban applies. The interrupted card stays reserved and cannot serve as its own counter. Other eligible responders use their existing response controls.',
'If everyone allows Kull, CHOAM discards the exact Kull card. The original attempted card remains in its owner’s hand; its effect and additional costs do not occur, and an attempted special once-per-game use remains unspent. Basic prevents that player’s Karama activations for this phase. A new Advanced attempt instead prevents only the specific effect: shipment pricing, free Treachery purchase, that faction’s special, or cancellation of the particular advantage. Other effects remain available; printed and substituted Karama share the same restriction. An allied shipment recipient is not automatically the restricted player.',
@@ -4797,7 +4797,7 @@ export const RULE_TOPICS: RuleTopic[] = [
example: 'Bene Gesserit attempts to use Baliset as Karama. CHOAM declares Kull. Baliset cannot also counter Kull; a different eligible Karama may. If Kull succeeds, Baliset stays held; in a new Advanced attempt BG cannot repeat that specific Karama effect this phase but may use another legal effect. If a distinct counter prevents Kull, the original Baliset attempt proceeds to its normal conversion response.',
related: ['choam-worthless', 'nexus-choam-kull', 'faction-choam', 'card-karama', 'advanced-beneGesserit', 'special-karama', 'bidding', 'choam-karama', 'nexus-cards', 'implementation-checklist'],
checklist: [
{ area: 'Implementation', status: 'Partial', detail: 'Opt-in Kull binds typed intents, distinct physical counters and Basic/legacy all-purpose or new Advanced semantic-effect restrictions. Different effects remain playable; phase expiry is provisional in Advanced. Basic printed Kull admits native Richese, Ixians, Tleilaxu, Ecaz and Moritani; supported clean Kull discards offer Semuta before their suspended parent resumes. Without Richese, structured bribe promises persist through its response; deferred overbid recovery and broader module support remain excluded.', evidence: ['game/choam-kull.ts', 'game/kull-purpose.ts', 'game/bribe-promises.ts', 'game/engine.ts', 'tests/kull-native-ix-runtime.test.ts', 'tests/kull-native-e3-runtime.test.ts', 'tests/kull-ground-movement-runtime.test.ts', 'tests/kull-richese-semuta-runtime.test.ts'] },
{ area: 'Implementation', status: 'Partial', detail: 'Opt-in Kull binds typed intents, distinct physical counters and Basic/legacy all-purpose or new Advanced semantic-effect restrictions. Different effects remain playable; phase expiry is provisional in Advanced. Basic printed Kull admits native Richese, Ixians, Tleilaxu, Ecaz and Moritani; supported clean Kull discards offer Semuta before their suspended parent resumes. Without Richese, supported current-lot bid, Revival, alliance and bribe commitments can coexist with the preview; deferred overbid recovery, phase-wide and whole-turn answers and broader module support remain excluded.', evidence: ['game/choam-kull.ts', 'game/kull-purpose.ts', 'game/bribe-promises.ts', 'game/engine.ts', 'tests/kull-bid-runtime.test.ts', 'tests/kull-truth-revival-runtime.test.ts', 'tests/kull-alliance-runtime.test.ts', 'tests/kull-richese-semuta-runtime.test.ts'] },
{ area: 'Player controls', status: 'Partial', detail: 'Owner-only legal held costs and decline use the Kull event; counters reuse ordinary response controls. Public viewers receive purpose/actors, not private intent payloads or hidden choices.', evidence: ['components/choam-kull.tsx', 'components/game-table.tsx'] },
{ area: 'AI', status: 'Partial', detail: 'Legal preview participation uses projected reactor choices and ordinary distinct counter controls. Full strategy and difficulty calibration remain deferred.', evidence: ['game/bot-choam-kull.ts', 'game/bots.ts'] },
{ area: 'Documentation', status: 'Partial', detail: 'Pending versus active restrictions, distinct custody, decline/prevention/success, BG-before-conversion and deferred overbid limits have internal explanations. Publisher-source and full-faction acceptance remain separate.', evidence: ['docs/CHOAM_KULL_DESIGN.md', 'docs/CHOAM_KULL_SOURCE_UPDATE.md', 'docs/NEXUS_CHOAM_RULES.md'] },
+10 -5
View File
@@ -1,4 +1,5 @@
import { nativePromiseScopeSupported, type NativePromiseScope } from './native-promise-scope';
import { bribePromiseModeSupported } from './bribe-promises';
export type RevivalClaim = { turn: number; counter: 'total' | 'normal' | 'elite'; minimum: number };
export type RevivalPromise = RevivalClaim & {
@@ -32,14 +33,18 @@ export function parseRevivalClaim(value: unknown): RevivalClaim {
return { turn: input.turn, counter: input.counter, minimum: input.minimum };
}
/** The original bare native scope is unchanged. Timing, allowance, payment,
* typed Tanks and actual ordinary-return sources remain the engine's rules. */
/** The original bare native scope and the supported Basic printed-Kull roster.
* Timing, allowance, payment, typed Tanks and actual ordinary-return sources
* remain the engine's rules; Richese Semuta and Nexus Kull stay fenced. */
export function revivalPromiseModeSupported(game: NativePromiseScope & {
semutaPreview?: unknown; kullPreview?: unknown; nexusKullPreview?: unknown;
richeseBetrayalPreview?: unknown;
richeseBetrayalPreview?: unknown; guildBetrayalPreview?: unknown;
nexusIxianReplacementPreview?: unknown; nexusIxianBetrayalPreview?: unknown;
nexusHarkonnenBetrayalPreview?: unknown; moritaniAssassinatePreview?: unknown;
mobileStronghold?: unknown;
}): boolean {
return nativePromiseScopeSupported(game) && !game.semutaPreview && !game.kullPreview &&
!game.nexusKullPreview && !game.richeseBetrayalPreview;
return nativePromiseScopeSupported(game) && !game.semutaPreview && !game.nexusKullPreview &&
!game.richeseBetrayalPreview && (!game.kullPreview || bribePromiseModeSupported(game));
}
export function revivalClaimText(claim: RevivalClaim): string {
+5 -1
View File
@@ -42,7 +42,11 @@ export function parsePhaseBidClaim(value: unknown): PhaseBidClaim {
return { turn: input.turn, minimum: input.minimum };
}
export const phaseBidPromiseModeSupported = bidPromiseModeSupported;
/** A phase-wide Yes can depend on an unopened later lot; its Kull purchase
* interruption needs a separate continuation proof from a current-lot Yes. */
export function phaseBidPromiseModeSupported(game: Parameters<typeof bidPromiseModeSupported>[0]): boolean {
return !game.kullPreview && bidPromiseModeSupported(game);
}
export function phaseBidClaimText(claim: PhaseBidClaim): string {
return `place a bid of at least ${claim.minimum} spice from now until this turn's Bidding phase closes`;