Expand recognized Truthtrance fact questions
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 04:34:29 +11:00
1 parent 8ae275f598
commit 9dd386ff7a
11 files changed
+279 -16

No files matched your search

+3 -3
View File
@@ -6,7 +6,7 @@ import { DIFFICULTIES } from '../game/bot-profiles';
import { moveSemutaEmperorCard } from './fixture-semuta-emperor-share';
import { knowledgeGame, knowledgePhysical, rejectKnowledge } from './truthtrance-knowledge-fixture';
type Stamp = { version: 1; fact: unknown };
type Stamp = { version: 1 | 2; fact: unknown };
type Freeform = {kind: 'freeform'; target: string; text: string; scope: 'fact' | 'currentTurn'; interpreted?: Stamp};
/** Actual Truthtrance declaration, priority, question and response actions.
@@ -51,7 +51,7 @@ for (const expected of ['yes','no'] as const) for (const kind of ['spice','hand'
const physical = knowledgePhysical(initial);
const card = initial.players[0].hand.find(item => item.effect === 'truthtrance')!;
const pending = ask(initial, {kind:'freeform', target:target.id, scope:'fact', text});
assert.deepEqual(freeform(pending).interpreted, {version:1, fact});
assert.deepEqual(freeform(pending).interpreted, {version:2, fact});
assert.equal(viewGame(pending, target.id).truthAnswer, expected);
for (const id of ['a','f','o']) assert.equal(viewGame(pending,id).truthAnswer, null);
rejectKnowledge(pending, target.id, {type:'truthAnswer', answer:expected === 'yes' ? 'no' : 'yes'});
@@ -74,7 +74,7 @@ void test('only server interpretation is used when a client forges a stamp', ()
initial.players.find(player => player.id === 'b')!.spice = 4;
const asked = ask(initial, {kind:'freeform', target:'b', scope:'fact',
text:'Do you have at least 5 spice?', interpreted:{version:1, fact:{kind:'spice', compare:'gte', value:0}}});
assert.deepEqual(freeform(asked).interpreted, {version:1, fact:{kind:'spice',compare:'gte',value:5}});
assert.deepEqual(freeform(asked).interpreted, {version:2, fact:{kind:'spice',compare:'gte',value:5}});
assert.equal(viewGame(asked,'b').truthAnswer,'no');
rejectKnowledge(asked,'b',{type:'truthAnswer',answer:'yes'});
const unsupported = ask(initial, {kind:'freeform', target:'b', scope:'fact',