diff --git a/components/mixed-shipment-fields.tsx b/components/mixed-shipment-fields.tsx index 5796c798..c5c39820 100644 --- a/components/mixed-shipment-fields.tsx +++ b/components/mixed-shipment-fields.tsx @@ -13,6 +13,8 @@ import { CardCountFields } from './truthtrance-card-count'; import { KnowledgeFactFields } from './truthtrance-knowledge'; import { ForceCountFields, forceCountInputError } from './truthtrance-force-count'; import { ShipmentClauseFields, invalidShipmentClause } from './shipment-claim-fields'; +import { NoFieldValueFields } from './truthtrance-no-field-value'; +import { parseNoFieldValueFact } from '@/game/truthtrance-no-field-value'; export function invalidTruthFact(fact: TruthFact, game: GameView, target: string): boolean { if (fact.kind === 'and' || fact.kind === 'or') { @@ -21,6 +23,10 @@ export function invalidTruthFact(fact: TruthFact, game: GameView, target: string if (fact.kind === 'spice' || fact.kind === 'handCount' || fact.kind === 'handInventory') { return !Number.isSafeInteger(fact.value) || fact.value < 0; } + if (fact.kind === 'noFieldValue') { + try { parseNoFieldValueFact(fact); return false; } + catch { return true; } + } if (isKnowledgeFact(fact)) return !!knowledgeFactInputError(fact); if (fact.kind === 'forceCount') { return !!forceCountInputError(fact, game, game.players.find(player => player.id === target)!); @@ -47,6 +53,7 @@ export function TruthFactFields({ value: fact, game, target, onChange }: { stormForecast: { kind: 'stormForecast', compare: 'gte', value: 1 }, spice: { kind: 'spice', compare: 'gte', value: 6 }, forceCount: { kind: 'forceCount', zone: { kind: 'reserves' }, counter: 'total', compare: 'gte', value: 6 }, + noFieldValue: { kind: 'noFieldValue', value: 3 }, }; return <> {fact.kind === 'hand' ? : fact.kind === 'handCount' || fact.kind === 'handInventory' ? - : fact.kind === 'forceCount' ? - player.id === target)!} onChange={onChange} /> : + : fact.kind === 'noFieldValue' ? + : fact.kind === 'forceCount' ? + player.id === target)!} onChange={onChange} /> : fact.kind === 'prediction' || fact.kind === 'stormDial' || fact.kind === 'stormForecast' ? : fact.kind === 'spice' ? <>