Support current battle choice promises and persistent notices
Verify and publish checkpoint container / container (push) Successful in 11m42s
Verify and publish checkpoint container / container (push) Successful in 11m42s
This commit is contained in:
1 parent
77d02b3231
commit
bd8377d87b
16 files changed
+684
-32
No files matched your search
+12
-1
@@ -63,7 +63,8 @@ import {
|
||||
} from './battle-promises';
|
||||
import { gameTerritories } from './board';
|
||||
import { leaders } from './cards';
|
||||
import { combatLocationName } from './combat-location';
|
||||
import { combatLocationName, quoteCombatBoard } from './combat-location';
|
||||
import { battleChooserEvent, quoteBattleChoosers } from './battle-chooser-order';
|
||||
import { parseForceCountFact, forceCountFactMatches, forceCountFactText, forceCountCounterError, type ForceCountFact, type ForceCountPlayer } from './truthtrance-force-count';
|
||||
import type { Action, Game, Player } from './engine';
|
||||
import { coalitionAllies } from './coalition-alliance';
|
||||
@@ -536,6 +537,15 @@ function parseQuestion(g: Game, asker: string, value: unknown): TruthQuestion {
|
||||
const respondent = g.players.find(player => player.id === v.target)!;
|
||||
const mixed = parseMixedActionExpression(v.mixed, fact => parseFact(g, fact, respondent), input => {
|
||||
const action = parseTurnActionLeaf(input);
|
||||
if (action.kind === 'battleChoice') {
|
||||
const source = battleChooserEvent(g.turn, g.lastBattleContext?.turn === g.turn ? g.lastBattleContext.event : null,
|
||||
g.battleOrder?.uses.length ?? 0);
|
||||
const choices = quoteBattleChoosers(quoteCombatBoard(g).battles,g.order,g.battleOrder?.priority).choices;
|
||||
check(g.phase === 6 && !g.battle && g.active === respondent.id && action.source === source &&
|
||||
choices.some(choice => choice.chooser === respondent.id && choice.territory === action.territory &&
|
||||
(choice.attacker === respondent.id ? choice.defender : choice.attacker) === action.target),
|
||||
'Choose the current player’s original available battle and opponent.');
|
||||
}
|
||||
if (battleCancel) check(action.kind === 'windowCardPlay' && action.effect === 'karamaBattleCancel' &&
|
||||
action.source === battleCancel.source, 'Ask only about the current printed Karama cancellation in this response.');
|
||||
if (action.kind === 'stormDial') {
|
||||
@@ -991,6 +1001,7 @@ export function truthQuestionText(
|
||||
};
|
||||
if (q.kind === 'turnActions') return `Is it true that ${mixedActionExpressionText(q.mixed, clause,
|
||||
action => {
|
||||
if (action.kind === 'battleChoice') return `you choose the battle against ${playerName(action.target)} in ${locationName(action.territory)} at this battle-choice opportunity`;
|
||||
if (action.kind === 'stormDial') return `you submit ${action.compare === 'gte' ? 'at least' : action.compare === 'lte' ? 'at most' : 'exactly'} ${action.value} on your original storm dial this turn`;
|
||||
if (action.kind === 'windowCardPlay') {
|
||||
if (action.effect === 'karamaHarkonnenSpecial')
|
||||
|
||||
Reference in new issue
Block a user