Expand Basic Semuta and Truthtrance rules
Verify and publish checkpoint container / container (push) Canceled after 0s
Verify and publish checkpoint container / container (push) Canceled after 0s
This commit is contained in:
1 parent
7e6e8c2d12
commit
4f990db52e
13 files changed
+351
-12
No files matched your search
+10
-2
@@ -68,6 +68,7 @@ import { TRUTH_CARD_NAMES } from './truthtrance-card-names';
|
||||
import { parseFreeformFactV1 } from './truthtrance-freeform-facts';
|
||||
import { parseFreeformFactV2 } from './truthtrance-freeform-facts-v2';
|
||||
import { parseFreeformFactV3 } from './truthtrance-freeform-facts-v3';
|
||||
import { parseFreeformFactV4 } from './truthtrance-freeform-facts-v4';
|
||||
import { CHEAP_HERO_TRAITOR } from './traitors';
|
||||
import {
|
||||
TRUTH_FACT_MAX_NODES, TRUTH_FACT_MAX_DEPTH, TRUTH_FACT_MAX_TERMS,
|
||||
@@ -132,7 +133,7 @@ export type TruthQuestion =
|
||||
text: string;
|
||||
scope: 'fact' | 'currentTurn';
|
||||
/** Only newly asked, explicitly recognized facts carry this stable interpretation. */
|
||||
interpreted?: { version: 1; fact: Extract<TruthFact, { kind: 'hand' | 'spice' }> } | { version: 2 | 3; fact: TruthFact };
|
||||
interpreted?: { version: 1; fact: Extract<TruthFact, { kind: 'hand' | 'spice' }> } | { version: 2 | 3 | 4; fact: TruthFact };
|
||||
};
|
||||
export type TruthAnswer = 'yes' | 'no' | 'unknown';
|
||||
export type TruthQueueEntry = {
|
||||
@@ -676,9 +677,12 @@ function parseQuestion(g: Game, asker: string, value: unknown): TruthQuestion {
|
||||
const newFact = question.scope === 'fact' && marker.version === 2 ? parseFreeformFactV2(question.text) : null;
|
||||
const categoryFact = question.scope === 'fact' && marker.version === 3 && !parseFreeformFactV2(question.text)
|
||||
? parseFreeformFactV3(question.text) : null;
|
||||
const negativeFact = question.scope === 'fact' && marker.version === 4 && !parseFreeformFactV3(question.text)
|
||||
? parseFreeformFactV4(question.text) : null;
|
||||
const expected = oldFact ? { version: 1 as const, fact: oldFact }
|
||||
: newFact ? { version: 2 as const, fact: newFact }
|
||||
: categoryFact ? { version: 3 as const, fact: categoryFact } : null;
|
||||
: categoryFact ? { version: 3 as const, fact: categoryFact }
|
||||
: negativeFact ? { version: 4 as const, fact: negativeFact } : null;
|
||||
check(expected !== null && JSON.stringify(v.interpreted) === JSON.stringify(expected),
|
||||
'The saved freeform interpretation does not match its original question.');
|
||||
question.interpreted = expected;
|
||||
@@ -1146,6 +1150,10 @@ export function resolveTruthAction(
|
||||
else {
|
||||
const categoryFact = parseFreeformFactV3(w.question.text);
|
||||
if (categoryFact) w.question.interpreted = { version: 3, fact: categoryFact };
|
||||
else {
|
||||
const negativeFact = parseFreeformFactV4(w.question.text);
|
||||
if (negativeFact) w.question.interpreted = { version: 4, fact: negativeFact };
|
||||
}
|
||||
}
|
||||
}
|
||||
if (w.question.kind === 'mixedBattlePlan')
|
||||
|
||||
Reference in new issue
Block a user