Support board-wide Truthtrance force questions
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 03:41:29 +11:00
1 parent f1007a4ea8
commit 89589878fc
12 files changed
+144 -29

No files matched your search

+5 -2
View File
@@ -1,6 +1,6 @@
import { FACTIONS, type FactionId } from './catalog';
import { leaders, SPICE_CARDS } from './cards';
import { territory } from './board';
import { gameTerritories, territory } from './board';
import { TRUTH_CARD_NAMES } from './truthtrance-card-names';
import { battleCategoryInspectionValue } from './battle-card-slots';
import type { Game, Player } from './engine';
@@ -31,6 +31,8 @@ export type KnowledgeFact =
/** Only values already chosen or actually known by this respondent. */
export type TruthKnowledge = {
/** Public board locations available in this room at the time of the answer. */
boardLocations?: readonly { territory: string; sector: number }[];
prediction: { faction: FactionId; turn: number } | null;
stormDial: number | null;
stormForecast: number | null;
@@ -96,7 +98,7 @@ export function parseKnowledgeFact(value: unknown): KnowledgeFact {
}
export function truthKnowledgeOf(
g: Pick<Game, 'phase' | 'turn' | 'advanced' | 'stormDials' | 'stormDialers' | 'stormCard' | 'stormCardKnown' | 'spicePeekKnown' | 'spiceDeck' | 'auction' | 'richeseAuction' | 'richeseCache' | 'richesePeekKnown' | 'richeseOfferedCard' | 'ixAuction' | 'ixAuctionKnown' | 'homeworldOccupationPreview' | 'battle' | 'players' | 'dukeVidal'>,
g: Pick<Game, 'phase' | 'turn' | 'advanced' | 'stormDials' | 'stormDialers' | 'stormCard' | 'stormCardKnown' | 'spicePeekKnown' | 'spiceDeck' | 'auction' | 'richeseAuction' | 'richeseCache' | 'richesePeekKnown' | 'richeseOfferedCard' | 'ixAuction' | 'ixAuctionKnown' | 'homeworldOccupationPreview' | 'battle' | 'players' | 'dukeVidal' | 'mobileStronghold' | 'discoveries'>,
p: Pick<Player, 'id' | 'faction' | 'prediction'>,
): TruthKnowledge {
const dial = g.stormDials[p.id];
@@ -157,6 +159,7 @@ export function truthKnowledgeOf(
}
}
return {
boardLocations: gameTerritories(g).flatMap(t => t.sectors.map(sector => ({ territory: t.id, sector }))),
prediction: p.faction === 'beneGesserit' && p.prediction
? { ...p.prediction } : null,
stormDial: g.phase === 0 && g.stormDialers.includes(p.id) &&