diff --git a/components/truthtrance-card-count.tsx b/components/truthtrance-card-count.tsx index 8d082cb5..eb831d77 100644 --- a/components/truthtrance-card-count.tsx +++ b/components/truthtrance-card-count.tsx @@ -4,29 +4,56 @@ import { useId } from 'react'; import { Input } from '@/components/ui/input'; import { TRUTH_CARD_NAMES } from '@/game/truthtrance'; import type { CardCountFact } from '@/game/truthtrance-card-count'; +import { + HAND_INVENTORY_LABELS, + type HandInventoryFact, +} from '@/game/truthtrance-hand-inventory'; -export function CardCountFields({ +export function CardCountFields({ value, onChange, }: { - value: CardCountFact; - onChange: (fact: CardCountFact) => void; + value: T; + onChange: (fact: T) => void; }) { const id = useId(); const invalid = !Number.isSafeInteger(value.value) || value.value < 0; return ( <> - + {value.kind === 'handCount' ? ( + + ) : ( + + )}

- Counts copies of this exact named card in the player’s hand now. Cards - in the deck, discard pile, or a separate cache do not count. The answer - reveals only whether the comparison is true. + {value.kind === 'handCount' + ? 'Counts copies of this exact named card' + : value.category === 'all' + ? 'Counts all physical cards' + : 'Counts physical cards of the selected primary role'}{' '} + in the player’s hand now. Cards in the deck, discard pile, or a separate + cache do not count. The answer reveals only whether the comparison is + true.

+ {value.kind === 'handInventory' && value.category !== 'all' && ( +

+ Primary roles follow the cards: Weirding Way is a weapon and Chemistry + is a defense. Worthless cards stay separate, including for Bene + Gesserit or CHOAM. Alternate uses and faction powers do not change + this count. +

+ )} {invalid && (

Automatic enforcement currently supports the active player’s unused shipment in base Basic games and base - Advanced games without Guild or optional modules. Select that player and finish pending - decisions first. Earlier questions and other rules - configurations remain unfinished. + Advanced games without Guild or optional modules. Select + that player and finish pending decisions first. Earlier + questions and other rules configurations remain + unfinished.

)}

@@ -442,16 +445,23 @@ export function Truthtrance({ compare: 'gte', value: 2, } - : e.target.value === 'spice' + : e.target.value === 'handInventory' ? { - kind: 'spice', + kind: 'handInventory', + category: 'all', compare: 'gte', - value: 6, - } - : { - kind: 'traitor', - leader: g.allLeaders[0].id, + value: 2, } + : e.target.value === 'spice' + ? { + kind: 'spice', + compare: 'gte', + value: 6, + } + : { + kind: 'traitor', + leader: g.allLeaders[0].id, + } : old, ), ) @@ -461,6 +471,9 @@ export function Truthtrance({ +