Support phase-wide bidding across all auctions
Verify and publish checkpoint container / container (push) Successful in 12m14s

This commit is contained in:
Quintine committed 2026-11-16 19:17:36 +11:00
1 parent 12060f3112
commit 38f1684e03
17 files changed
+1070 -18

No files matched your search

+28 -1
View File
@@ -159,7 +159,7 @@ export function Truthtrance({
g.players.find((p) => p.id !== me.id)!.id,
);
const [kind, setKind] = useState<
'fact' | 'freeform' | 'charity' | 'battlePlan' | 'futureBattleLeader' | 'shipment' | 'mixedShipment' | 'movement' | 'traitorCall' | 'bid' | 'phaseBid' | 'richeseBid' | 'earlyRicheseBid' | 'revival' | 'bribe' | 'pledgeAid' | 'alliance' | 'leaderRevival' | 'gholaLeader' | 'revivalExpression' | 'bribeExpression' | 'movementExpression' | 'mixedMovement' | 'mixedBribe' | 'mixedRevival' | 'mixedBid' | 'mixedRicheseBid' | 'allianceExpression' | 'mixedAlliance' | 'mixedBattlePlan' | 'mixedTraitorCall' | 'travel' | 'turnActions'
'fact' | 'freeform' | 'charity' | 'battlePlan' | 'futureBattleLeader' | 'shipment' | 'mixedShipment' | 'movement' | 'traitorCall' | 'bid' | 'phaseBid' | 'phaseAnyBid' | 'richeseBid' | 'earlyRicheseBid' | 'revival' | 'bribe' | 'pledgeAid' | 'alliance' | 'leaderRevival' | 'gholaLeader' | 'revivalExpression' | 'bribeExpression' | 'movementExpression' | 'mixedMovement' | 'mixedBribe' | 'mixedRevival' | 'mixedBid' | 'mixedRicheseBid' | '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 ?? '');
@@ -312,6 +312,7 @@ export function Truthtrance({
: kind === 'mixedRicheseBid' ? { kind, target, turn: g.turn, event: g.richeseAuction?.event ?? '', mixed: mixedBid }
: kind === 'bid' ? { kind, target, ...bidClaim }
: kind === 'phaseBid' ? { kind, target, ...phaseBidClaim }
: kind === 'phaseAnyBid' ? { kind, target, ...phaseBidClaim }
: kind === 'earlyRicheseBid' ? { kind, target, turn:g.turn, minimum:bidMinimum }
: kind === 'richeseBid' ? { kind, target, turn:g.turn, event:g.richeseAuction?.event ?? '', minimum:bidMinimum }
: kind === 'charity' ? { kind, target, turn:g.turn }
@@ -553,6 +554,13 @@ export function Truthtrance({
{button(`Answer ${answer === 'yes' ? 'Yes' : answer === 'no' ? 'No' : 'I don’t know'}`, { type: 'truthAnswer', answer })}
</div>)}
</>
) : w.question!.kind === 'phaseAnyBid' ? (
<>
<p className="notice">Yes requires one qualifying accepted bid in any supported auction before this Bidding phase closes, while possible. No forbids qualifying bids in those auctions. A bid does not promise a win; the original funding and payment rules still apply. Some combinations with other bidding commitments are not yet available.</p>
{(g.truthPhaseAnyBidAnswers ?? []).map(answer => <div key={answer}>
{button(`Answer ${answer === 'yes' ? 'Yes' : answer === 'no' ? 'No' : 'I don’t know'}`, { type: 'truthAnswer', answer })}
</div>)}
</>
) : w.question!.kind === 'bid' ? (
<>
<p className="notice">Yes requires one qualifying bid in this ordinary lot while possible. No forbids qualifying bids until it closes. A bid does not promise a win; winning still requires the original payment. Keep the funding needed by your answer.</p>
@@ -719,6 +727,7 @@ export function Truthtrance({
<option value="bid">Bind a bid in this ordinary lot</option>
<option value="charity">Bind a Charity claim this turn</option>
<option value="phaseBid">Bind an ordinary bid this Bidding phase</option>
<option value="phaseAnyBid">Bind a bid in any auction this Bidding phase</option>
<option value="earlyRicheseBid">Bind a bid in the first Richese cache auction</option>
<option value="richeseBid">Bind a bid in this Richese lot</option>
<option value="mixedRicheseBid">Combine current facts and a Richese bid</option>
@@ -907,6 +916,23 @@ export function Truthtrance({
{!g.truthPhaseBidTargets.includes(target) && <p className="notice">Choose a supported current-turn Bidding question and finish pending decisions.</p>}
<p className="notice" aria-label="Public phase bid question preview">{truthQuestionText(question, leaderName, locationName, name)}</p>
</>
) : kind === 'phaseAnyBid' ? (
<>
<fieldset className="grid gap-2" disabled={busy} aria-label="Any auction Bidding phase condition">
<legend>Bid in any auction during this turn</legend>
<p>Turn {g.turn} · Remaining Bidding phase</p>
<label htmlFor="truth-phase-any-bid-minimum">Minimum bid in spice</label>
<Input id="truth-phase-any-bid-minimum" type="number" min={1} max={Number.MAX_SAFE_INTEGER}
step={1} required disabled={busy} value={Number.isFinite(bidMinimum) ? bidMinimum : ''}
aria-describedby="truth-phase-any-bid-help" onChange={event => {
const next = event.currentTarget.valueAsNumber;
if (!busy && !phaseBidClaimInputError({turn:g.turn,minimum:next})) setBidMinimum(next);
}} />
<p className="fine" id="truth-phase-any-bid-help">One accepted qualifying bid in an ordinary, Richese cache or Black Market auction counts. Earlier bids do not count. A bid does not promise a win. Some combinations with other bidding commitments remain unavailable.</p>
</fieldset>
{!g.truthPhaseAnyBidTargets.includes(target) && <p className="notice">Choose a supported participant and finish pending decisions before asking.</p>}
<p className="notice" aria-label="Public any-auction bid question preview">{truthQuestionText(question, leaderName, locationName, name)}</p>
</>
) : kind === 'bid' ? (
<>
<BidClaimFields value={bidClaim} disabled={busy || !g.bidPromiseLot}
@@ -1058,6 +1084,7 @@ export function Truthtrance({
(kind === 'richeseBid' && (!!richeseBidMinimumError(bidMinimum) || !g.richeseAuction || !g.truthRicheseBidTargets.includes(target))) ||
(kind === 'charity' && !g.truthCharityTargets.includes(target)) ||
(kind === 'phaseBid' && (!!phaseBidClaimInputError(phaseBidClaim) || !g.truthPhaseBidTargets.includes(target))) ||
(kind === 'phaseAnyBid' && (!!phaseBidClaimInputError(phaseBidClaim) || !g.truthPhaseAnyBidTargets.includes(target))) ||
(kind === 'turnActions' && (!!turnActionsError || !g.truthTurnActionTargets.includes(target))) ||
(kind === 'travel' && (!!travelError || !g.truthTravelTargets.includes(target))) ||
(kind === 'mixedTraitorCall' && (!!mixedTraitorError || !g.truthMixedTraitorTargets.includes(target))) ||