Prototype conditional future battle Truthtrance
Verify and publish checkpoint container / container (push) Failing after 11m11s
Verify and publish checkpoint container / container (push) Failing after 11m11s
This commit is contained in:
1 parent
71009d73e3
commit
02695aea7c
15 files changed
+721
-8
No files matched your search
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
import { SaphoTruthOrder } from './sapho-truth-order';
|
||||
import { TruthFutureBattleLeader } from './truth-future-battle-leader';
|
||||
import { RicheseBidPromiseFields, richeseBidMinimumError } from './richese-bid-promise-fields';
|
||||
|
||||
import { TravelClaimFields, travelClaimInputError } from './travel-claim-fields';
|
||||
@@ -125,7 +126,7 @@ export function Truthtrance({
|
||||
g.players.find((p) => p.id !== me.id)!.id,
|
||||
);
|
||||
const [kind, setKind] = useState<
|
||||
'fact' | 'freeform' | 'charity' | 'battlePlan' | 'shipment' | 'mixedShipment' | 'movement' | 'traitorCall' | 'bid' | 'phaseBid' | 'richeseBid' | 'earlyRicheseBid' | 'revival' | 'bribe' | 'alliance' | 'leaderRevival' | 'revivalExpression' | 'bribeExpression' | 'movementExpression' | 'mixedMovement' | 'mixedBribe' | 'mixedRevival' | 'mixedBid' | 'allianceExpression' | 'mixedAlliance' | 'mixedBattlePlan' | 'mixedTraitorCall' | 'travel' | 'turnActions'
|
||||
'fact' | 'freeform' | 'charity' | 'battlePlan' | 'futureBattleLeader' | 'shipment' | 'mixedShipment' | 'movement' | 'traitorCall' | 'bid' | 'phaseBid' | 'richeseBid' | 'earlyRicheseBid' | 'revival' | 'bribe' | 'alliance' | 'leaderRevival' | 'revivalExpression' | 'bribeExpression' | 'movementExpression' | 'mixedMovement' | 'mixedBribe' | 'mixedRevival' | 'mixedBid' | 'allianceExpression' | 'mixedAlliance' | 'mixedBattlePlan' | 'mixedTraitorCall' | 'travel' | 'turnActions'
|
||||
>('fact');
|
||||
const [revivalLeader, setRevivalLeader] = useState(g.allLeaders.find(leader =>
|
||||
leader.faction === g.players.find(player => player.id === target)?.faction)?.id ?? '');
|
||||
@@ -225,6 +226,7 @@ export function Truthtrance({
|
||||
const invalidMixed = mixedShipmentInputError(mixed, g, target);
|
||||
const shipmentAvailable = g.truthShipmentTargets.includes(target);
|
||||
const [planClaim, setPlanClaim] = useState<PlanClaim>({ kind: 'dial', compare: 'gte', value: 1 });
|
||||
const [futureBattleLeader, setFutureBattleLeader] = useState('');
|
||||
const [scope, setScope] = useState<'fact' | 'currentTurn'>('fact');
|
||||
const [text, setText] = useState('');
|
||||
const [fact, setFact] = useState<TruthFact>({ kind: 'hand', name: 'Shield' });
|
||||
@@ -242,6 +244,7 @@ export function Truthtrance({
|
||||
target,
|
||||
fact,
|
||||
}
|
||||
: kind === 'futureBattleLeader' ? {kind, target, turn: g.turn, leader: futureBattleLeader}
|
||||
: kind === 'battlePlan'
|
||||
? {
|
||||
kind,
|
||||
@@ -521,6 +524,13 @@ export function Truthtrance({
|
||||
<TravelAnswers game={g} act={act} busy={busy} />
|
||||
) : w.question!.kind === 'traitorCall' || w.question!.kind === 'mixedTraitorCall' ? (
|
||||
<TraitorDecisionAnswers game={g} act={act} busy={busy} />
|
||||
) : w.question!.kind === 'futureBattleLeader' ? (
|
||||
<>
|
||||
<p className="notice">Your answer applies only if you fight a later battle this turn.</p>
|
||||
{(g.truthFutureBattleLeaderAnswers ?? []).map(answer => <div key={answer}>
|
||||
{button(answer === 'unknown' ? 'I don’t know yet' : `Answer ${answer === 'yes' ? 'Yes' : 'No'}`, {type: 'truthAnswer', answer})}
|
||||
</div>)}
|
||||
</>
|
||||
) : w.question!.kind === 'battlePlan' ? (
|
||||
<>
|
||||
<p className="notice">
|
||||
@@ -658,6 +668,7 @@ export function Truthtrance({
|
||||
Combine current facts and this-turn shipment
|
||||
</option>
|
||||
<option value="freeform">Write a game question</option>
|
||||
{g.truthFutureBattleLeaderTargets.length > 0 && <option value="futureBattleLeader">Ask about a leader in a later battle</option>}
|
||||
{g.battle && <option value="mixedBattlePlan">Combine current facts and this battle plan</option>}
|
||||
{g.battle && (
|
||||
<option value="battlePlan">
|
||||
@@ -891,6 +902,11 @@ export function Truthtrance({
|
||||
{invalidMixed ?? truthQuestionText(question, leaderName, locationName, name)}
|
||||
</p>}
|
||||
</>
|
||||
) : kind === 'futureBattleLeader' ? (
|
||||
<TruthFutureBattleLeader game={g} target={target} leader={futureBattleLeader}
|
||||
available={g.truthFutureBattleLeaderTargets.includes(target)} busy={busy}
|
||||
onLeaderChange={setFutureBattleLeader}
|
||||
onAsk={(player, leader) => act({type: 'truthAsk', question: {kind: 'futureBattleLeader', target: player, turn: g.turn, leader}})} />
|
||||
) : kind === 'battlePlan' ? (
|
||||
question.kind === 'battlePlan' && (
|
||||
<TruthBattlePlanQuestion game={g} question={question} busy={busy}
|
||||
@@ -933,7 +949,7 @@ export function Truthtrance({
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
{!['fact', 'battlePlan', 'shipment'].includes(kind) && button(
|
||||
{!['fact', 'battlePlan', 'futureBattleLeader', 'shipment'].includes(kind) && button(
|
||||
'Ask publicly',
|
||||
{ type: 'truthAsk', question },
|
||||
(kind === 'mixedMovement' && (!!mixedMovementError || !g.truthMixedMovementTargets.includes(target))) ||
|
||||
|
||||
Reference in new issue
Block a user