Support freeform Traitor and Face Dancer facts
Verify and publish checkpoint container / container (push) Successful in 11m16s
Verify and publish checkpoint container / container (push) Successful in 11m16s
This commit is contained in:
1 parent
152476c348
commit
34f533ae8d
10 files changed
+402
-6
No files matched your search
@@ -66,6 +66,7 @@ import { useId, useState } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { CHEAP_HERO_TRAITOR } from '@/game/traitors';
|
||||
import { DUKE_VIDAL_ID } from '@/game/duke-vidal';
|
||||
import { parseFreeformFactV2 } from '@/game/truthtrance-freeform-facts-v2';
|
||||
import { parseFreeformFactV3 } from '@/game/truthtrance-freeform-facts-v3';
|
||||
import { parseFreeformFactV4 } from '@/game/truthtrance-freeform-facts-v4';
|
||||
@@ -73,6 +74,7 @@ import { parseTruthFreeformFactsV5 } from '@/game/truthtrance-freeform-facts-v5'
|
||||
import { parseFreeformFactV6 } from '@/game/truthtrance-freeform-facts-v6';
|
||||
import { parseTruthFreeformFactsV7 } from '@/game/truthtrance-freeform-facts-v7';
|
||||
import { parseTruthFreeformFactsV8 } from '@/game/truthtrance-freeform-facts-v8';
|
||||
import { parseTruthFreeformFactsV9 } from '@/game/truthtrance-freeform-facts-v9';
|
||||
import {
|
||||
truthQuestionText,
|
||||
type TruthFact,
|
||||
@@ -108,13 +110,16 @@ export function EarlyRicheseBidFields({ minimum, onMinimum, disabled }: {
|
||||
|
||||
/** Show only a recognized current-fact interpretation; unsupported text and
|
||||
* current-turn promises keep their existing manual-answer guidance. */
|
||||
export function FreeformFactPreview({ scope, text, target, leaderName, locationName, playerName }: {
|
||||
export function FreeformFactPreview({ scope, text, target, leaderName, locationName, playerName, publicLeaders = [] }: {
|
||||
scope: 'fact' | 'currentTurn'; text: string; target: string;
|
||||
leaderName: (id: string) => string; locationName: (id: string) => string; playerName: (id: string) => string;
|
||||
publicLeaders?: readonly { id: string; name: string }[];
|
||||
}) {
|
||||
const leaders = [...publicLeaders.filter(leader => leader.id !== DUKE_VIDAL_ID),
|
||||
{ id: CHEAP_HERO_TRAITOR, name: 'Cheap Hero / Heroine' }];
|
||||
const fact = scope === 'fact' ? parseFreeformFactV2(text) || parseFreeformFactV3(text) ||
|
||||
parseFreeformFactV4(text) || parseTruthFreeformFactsV5(text) || parseFreeformFactV6(text) ||
|
||||
parseTruthFreeformFactsV7(text) || parseTruthFreeformFactsV8(text) : null;
|
||||
parseTruthFreeformFactsV7(text) || parseTruthFreeformFactsV8(text) || parseTruthFreeformFactsV9(text, leaders) : null;
|
||||
return fact ? <p className="notice" aria-label="Recognized freeform question">
|
||||
This will be checked as: {truthQuestionText({ kind: 'fact', target, fact }, leaderName, locationName, playerName)}
|
||||
</p> : <p className="notice">
|
||||
@@ -1002,7 +1007,7 @@ export function Truthtrance({
|
||||
/>
|
||||
</label>
|
||||
<FreeformFactPreview scope={scope} text={text} target={target}
|
||||
leaderName={leaderName} locationName={locationName} playerName={name} />
|
||||
leaderName={leaderName} locationName={locationName} playerName={name} publicLeaders={g.allLeaders} />
|
||||
</>
|
||||
)}
|
||||
{kind === 'pledgeAid' && <>
|
||||
|
||||
Reference in new issue
Block a user