'use client'; import { useId } from 'react'; import { FACTIONS } from '@/game/catalog'; import { territory } from '@/game/board'; import { knowledgeFactInputError, PRESCIENCE_LEADER_NAMES, SPICE_PEEK_VALUES, type KnowledgeFact } from '@/game/truthtrance-knowledge'; import { TRUTH_CARD_NAMES } from '@/game/truthtrance-card-names'; import { Input } from '@/components/ui/input'; type NumericKnowledgeFact = Exclude; function isNumericKnowledgeFact(fact: KnowledgeFact): fact is NumericKnowledgeFact { return fact.kind !== 'spicePeek' && fact.kind !== 'auctionPeek' && fact.kind !== 'cacheLot' && fact.kind !== 'ixPoolPeek' && fact.kind !== 'presciencePeek' && (fact.kind !== 'prediction' || fact.field === 'turn'); } export function KnowledgeFactFields({ value, onChange, }: { value: KnowledgeFact; onChange: (fact: KnowledgeFact) => void; }) { const id = useId(); const isFaction = value.kind === 'prediction' && value.field === 'faction'; const numericValue = isNumericKnowledgeFact(value) ? value : null; const isTurn = numericValue?.kind === 'prediction' && numericValue.field === 'turn'; const min = isTurn ? 1 : numericValue?.kind === 'stormForecast' ? 1 : 0; const max = isTurn ? 10 : numericValue?.kind === 'stormForecast' ? 6 : 20; const invalid = knowledgeFactInputError(value); return ( <> {value.kind === 'presciencePeek' ? ( <> {value.field === 'dial' ? : }

This asks what the target currently knows from Prescience in this battle. If that field is unknown or no longer available, the answer is I don’t know. Only the answer is published.

) : value.kind === 'ixPoolPeek' ? ( <>

During Bidding, this asks whether the named card is in the Ixian’s recorded inspected auction pool. If that knowledge is unavailable, the answer is I don’t know. Only the answer is published; the pool itself remains private.

) : value.kind === 'cacheLot' ? ( <>

This asks about the current public Richese cache auction card. If that auction is unavailable, the answer is I don’t know. Only the answer is published.

) : value.kind === 'auctionPeek' ? ( <>

This asks about the current ordinary auction card the target has privately inspected. If no current card is known, the answer is I don’t know. Only the answer is published.

) : value.kind === 'spicePeek' ? ( <>

This asks about the card the target currently knows from their private Spice Blow peek. If no card is known, the answer is I don’t know. Only the answer is published.

) : isFaction ? ( ) : numericValue && ( <> {(isTurn || numericValue.kind === 'stormDial' || numericValue.kind === 'stormForecast') && ( )}

This asks about an already recorded choice or a forecast the target currently knows. If no such value is available, the answer is I don’t know. Only the answer is published.

)} {isFaction &&

This asks about an already recorded faction choice. If no such value is available, the answer is I don’t know. Only the answer is published.

} {invalid && } ); }