Support Truthtrance in Richese Silent bidding
This commit is contained in:
1 parent
090d764f6f
commit
3061dc5004
18 files changed
+442
-50
No files matched your search
@@ -12,10 +12,12 @@ export function RicheseBidPromiseFields(props: {
|
||||
minimum: number;
|
||||
onMinimum: (value: number) => void;
|
||||
disabled: boolean;
|
||||
method?: 'onceAround' | 'silent';
|
||||
}) {
|
||||
const silent = props.method === 'silent';
|
||||
const error = richeseBidMinimumError(props.minimum);
|
||||
return <fieldset className="grid gap-2" disabled={props.disabled} aria-label="Richese Once Around bid condition">
|
||||
<legend>Bid in this Once Around auction</legend>
|
||||
return <fieldset className="grid gap-2" disabled={props.disabled} aria-label={`Richese ${silent ? 'Silent' : 'Once Around'} bid condition`}>
|
||||
<legend>Bid in this {silent ? 'Silent' : 'Once Around'} auction</legend>
|
||||
<label htmlFor="truth-richese-bid-minimum">Minimum bid in spice</label>
|
||||
<Input id="truth-richese-bid-minimum" type="number" min={1} max={Number.MAX_SAFE_INTEGER} step={1} required
|
||||
disabled={props.disabled} value={Number.isFinite(props.minimum) ? props.minimum : ''}
|
||||
@@ -26,9 +28,10 @@ export function RicheseBidPromiseFields(props: {
|
||||
}} />
|
||||
{error && <p role="alert">{error}</p>}
|
||||
<p className="fine" id="truth-richese-bid-help">
|
||||
This asks about the bidder’s remaining opportunity in this Once Around lot.
|
||||
Earlier declarations do not count; a qualifying bid does not promise a win
|
||||
or change the winning payment.
|
||||
{silent
|
||||
? 'This asks about the bidder’s unsubmitted sealed bid in this Silent lot. A zero submission is permitted when compatible with the answer; submitted amounts remain private until bids are revealed.'
|
||||
: 'This asks about the bidder’s remaining opportunity in this Once Around lot. Earlier declarations do not count.'}
|
||||
{' '}A qualifying bid does not promise a win or change the winning payment.
|
||||
</p>
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -15,7 +15,7 @@ export type RicheseBidPromiseReceipt = {
|
||||
export type RicheseBidPromisePanelProps = {
|
||||
promises: RicheseBidPromiseReceipt[];
|
||||
guide: { action: Action } | null;
|
||||
game: { turn: number; richeseAuction: { event: string } | null };
|
||||
game: { turn: number; richeseAuction: { event: string; method?: 'onceAround' | 'silent' | 'normal' } | null };
|
||||
act: (action: Action) => void;
|
||||
busy: boolean;
|
||||
};
|
||||
@@ -40,7 +40,9 @@ export function RicheseBidPromiseGuide(props: RicheseBidPromisePanelProps) {
|
||||
disabled={!canAct()} onClick={() => { if (canAct()) props.act(action); }}>
|
||||
{typeof action.amount === 'number' && action.amount > 0
|
||||
? `Bid ${action.amount} spice while honoring your answer`
|
||||
: 'Pass this lot while honoring your answer'}
|
||||
: action.amount === 0
|
||||
? 'Submit zero spice while honoring your answer'
|
||||
: 'Pass this lot while honoring your answer'}
|
||||
</Button>;
|
||||
}
|
||||
|
||||
@@ -49,15 +51,18 @@ export function RicheseBidPromisePanel(props: RicheseBidPromisePanelProps) {
|
||||
if (!props.promises.length) return null;
|
||||
const waiting = props.promises.some(promise => promise.turn === props.game.turn &&
|
||||
promise.event === props.game.richeseAuction?.event && !promise.fulfilled && !promise.released);
|
||||
return <section className="notice space-y-3" aria-label="Your Richese Once Around bid promises">
|
||||
<h3>Your Once Around bid promises</h3>
|
||||
const silent = props.game.richeseAuction?.method === 'silent';
|
||||
const auction = silent ? 'Silent' : 'Once Around';
|
||||
return <section className="notice space-y-3" aria-label={`Your Richese ${auction} bid promises`}>
|
||||
<h3>Your {auction} bid promises</h3>
|
||||
<ul>{props.promises.map(promise => <li key={promise.id}>
|
||||
Turn {promise.turn}: You answered {promise.answer ? 'Yes' : 'No'} to bidding at least {promise.minimum} spice in this Once Around lot.
|
||||
Turn {promise.turn}: You answered {promise.answer ? 'Yes' : 'No'} to bidding at least {promise.minimum} spice in this Richese lot.
|
||||
{promise.released ? ' Released: this commitment is no longer possible.'
|
||||
: promise.fulfilled ? ' Fulfilled: this commitment is complete.' : ' This answer is binding for your remaining opportunity.'}
|
||||
</li>)}</ul>
|
||||
<p>Yes requires a qualifying bid while possible. No forbids a qualifying bid.
|
||||
The original auction order and payment rules still apply.</p>
|
||||
The original auction and payment rules still apply.
|
||||
{silent && ' Your submitted amount remains private until all bids are revealed.'}</p>
|
||||
{waiting && <RicheseBidPromiseGuide {...props} />}
|
||||
</section>;
|
||||
}
|
||||
@@ -430,7 +430,7 @@ export function Truthtrance({
|
||||
</>
|
||||
) : w.question!.kind === 'richeseBid' ? (
|
||||
<>
|
||||
<p className="notice">Yes requires a qualifying bid in your one remaining Once Around opportunity while possible. No forbids a qualifying bid. Winning still requires payment.</p>
|
||||
<p className="notice">Yes requires a qualifying bid in your one remaining opportunity while possible. No forbids a qualifying bid. Silent amounts remain sealed until all submit; winning still requires payment.</p>
|
||||
{(g.truthRicheseBidAnswers ?? []).map(answer => <div key={answer}>
|
||||
{button(`Answer ${answer === 'yes' ? 'Yes' : answer === 'no' ? 'No' : 'I don’t know'}`, { type: 'truthAnswer', answer })}
|
||||
</div>)}
|
||||
@@ -598,7 +598,7 @@ export function Truthtrance({
|
||||
<option value="revival">Bind ordinary force revivals this turn</option>
|
||||
<option value="bid">Bind a bid in this ordinary lot</option>
|
||||
<option value="phaseBid">Bind a bid this Bidding phase</option>
|
||||
<option value="richeseBid">Bind a bid in this Once Around lot</option>
|
||||
<option value="richeseBid">Bind a bid in this Richese lot</option>
|
||||
<option value="mixedBid">Combine current facts and ordinary bids</option>
|
||||
<option value="traitorCall">Bind this battle’s Traitor declaration</option>
|
||||
<option value="mixedTraitorCall">Combine current facts and this Traitor declaration</option>
|
||||
@@ -744,9 +744,9 @@ export function Truthtrance({
|
||||
</>
|
||||
) : kind === 'richeseBid' ? (
|
||||
<>
|
||||
<RicheseBidPromiseFields minimum={bidMinimum} onMinimum={setBidMinimum} disabled={busy || !g.richeseAuction} />
|
||||
{!g.truthRicheseBidTargets.includes(target) && <p className="notice">Choose a bidder with a remaining Once Around opportunity.</p>}
|
||||
<p className="notice" aria-label="Public Once Around bid question preview">{truthQuestionText(question, leaderName, locationName, name)}</p>
|
||||
<RicheseBidPromiseFields minimum={bidMinimum} onMinimum={setBidMinimum} disabled={busy || !g.richeseAuction} method={g.richeseAuction?.method === 'silent' ? 'silent' : 'onceAround'} />
|
||||
{!g.truthRicheseBidTargets.includes(target) && <p className="notice">Choose a bidder with a remaining Richese auction opportunity.</p>}
|
||||
<p className="notice" aria-label="Public Richese bid question preview">{truthQuestionText(question, leaderName, locationName, name)}</p>
|
||||
</>
|
||||
) : kind === 'phaseBid' ? (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user