Interpret compound Truthtrance hand facts
Verify and publish checkpoint container / container (push) Successful in 10m54s
Verify and publish checkpoint container / container (push) Successful in 10m54s
This commit is contained in:
1 parent
4224bb3e2a
commit
15a4f3038a
9 files changed
+268
-17
No files matched your search
+20
-11
@@ -69,6 +69,7 @@ import { CHEAP_HERO_TRAITOR } from '@/game/traitors';
|
||||
import { parseFreeformFactV2 } from '@/game/truthtrance-freeform-facts-v2';
|
||||
import { parseFreeformFactV3 } from '@/game/truthtrance-freeform-facts-v3';
|
||||
import { parseFreeformFactV4 } from '@/game/truthtrance-freeform-facts-v4';
|
||||
import { parseTruthFreeformFactsV5 } from '@/game/truthtrance-freeform-facts-v5';
|
||||
import {
|
||||
truthQuestionText,
|
||||
type TruthFact,
|
||||
@@ -102,6 +103,23 @@ export function EarlyRicheseBidFields({ minimum, onMinimum, disabled }: {
|
||||
</fieldset>;
|
||||
}
|
||||
|
||||
/** 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 }: {
|
||||
scope: 'fact' | 'currentTurn'; text: string; target: string;
|
||||
leaderName: (id: string) => string; locationName: (id: string) => string; playerName: (id: string) => string;
|
||||
}) {
|
||||
const fact = scope === 'fact' ? parseFreeformFactV2(text) || parseFreeformFactV3(text) ||
|
||||
parseFreeformFactV4(text) || parseTruthFreeformFactsV5(text) : 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">
|
||||
This wording is not automatically interpreted. Players must answer
|
||||
facts truthfully; AI will answer I don’t know. Automatic checks
|
||||
for arbitrary promises remain unfinished.
|
||||
</p>;
|
||||
}
|
||||
|
||||
export function Truthtrance({
|
||||
game: g,
|
||||
act,
|
||||
@@ -979,17 +997,8 @@ export function Truthtrance({
|
||||
placeholder="Will you ship at least six forces to Carthag this turn?"
|
||||
/>
|
||||
</label>
|
||||
{scope === 'fact' && (parseFreeformFactV2(text) || parseFreeformFactV3(text) || parseFreeformFactV4(text)) ? (
|
||||
<p className="notice" aria-label="Recognized freeform question">
|
||||
This will be checked as: {truthQuestionText({ kind: 'fact', target, fact: (parseFreeformFactV2(text) || parseFreeformFactV3(text) || parseFreeformFactV4(text))! }, leaderName, locationName, name)}
|
||||
</p>
|
||||
) : (
|
||||
<p className="notice">
|
||||
This wording is not automatically interpreted. Players must answer
|
||||
facts truthfully; AI will answer I don’t know. Automatic checks
|
||||
for arbitrary promises remain unfinished.
|
||||
</p>
|
||||
)}
|
||||
<FreeformFactPreview scope={scope} text={text} target={target}
|
||||
leaderName={leaderName} locationName={locationName} playerName={name} />
|
||||
</>
|
||||
)}
|
||||
{kind === 'pledgeAid' && <>
|
||||
|
||||
Reference in new issue
Block a user