Support early Charity Truthtrance commitments
This commit is contained in:
1 parent
72ff9db5e8
commit
2cd2a60a36
12 files changed
+407
-32
No files matched your search
@@ -10,7 +10,8 @@ type Props = { game: GameView; busy: boolean; send: (action: Action) => void };
|
||||
export function TruthCharityPromise({ game, busy, send }: Props) {
|
||||
const own = game.truthCharityPromises.filter(promise => promise.turn === game.turn && promise.player === game.me);
|
||||
if (!own.length) return null;
|
||||
const guide = game.truthCharityGuide, actor = game.me, turn = game.turn, action = guide?.action;
|
||||
// A later-phase forecast never becomes a current action before Charity opens.
|
||||
const guide = game.phase === 2 ? game.truthCharityGuide : null, actor = game.me, turn = game.turn, action = guide?.action;
|
||||
const signature = JSON.stringify(action), event = action?.charityPromiseEvent;
|
||||
const canAct = () => {
|
||||
const me = game.players.find(player => player.id === actor);
|
||||
@@ -34,11 +35,12 @@ export function TruthCharityPromise({ game, busy, send }: Props) {
|
||||
return <section className="notice space-y-3" aria-label="Your Truthtrance Charity promises" id="charity-promise-guidance">
|
||||
<h3>Your Charity promises</h3>
|
||||
<ul>{own.map(promise => <li key={promise.event}>
|
||||
You answered {promise.answer ? 'Yes' : 'No'} to claiming Charity in this phase.
|
||||
You answered {promise.answer ? 'Yes' : 'No'} to claiming Charity in this turn’s {game.phase < 2 ? 'upcoming' : game.phase === 2 ? 'current' : 'completed'} Charity phase.
|
||||
{' '}{promise.released ? 'Released: this commitment is no longer possible.'
|
||||
: promise.fulfilled ? 'Fulfilled: this commitment is complete.' : 'This answer remains binding while possible.'}
|
||||
</li>)}</ul>
|
||||
<p>Yes requires an actual eligible claim after the answer; No forbids claiming during the rest of this Charity phase. Earlier claims do not count.</p>
|
||||
<p>Yes requires an actual eligible claim after the answer; No forbids claiming during this Charity phase. Earlier claims do not count.</p>
|
||||
{game.phase < 2 && <p className="fine">Charity has not opened yet. The current turn and its original decisions continue; any claim guide appears only when Charity is available.</p>}
|
||||
{guide && action?.type === 'bribe' && <p className="fine">The quoted payment can make you eligible for Charity. You pay immediately; the other player receives the bribe at the start of Mentat Pause.</p>}
|
||||
{guide && action && <Button className="game-action min-h-11 whitespace-normal" data-testid="charity-promise-guide"
|
||||
disabled={!canAct()} onClick={() => { if (canAct()) send(action); }}>
|
||||
|
||||
@@ -434,7 +434,7 @@ export function Truthtrance({
|
||||
</>
|
||||
) : w.question!.kind === 'charity' ? (
|
||||
<>
|
||||
<p className="notice">This asks whether you will claim Charity after your answer in this Charity phase. Yes requires a legal claim while it remains possible; No means you cannot claim during this phase. Native eligibility and payment rules still apply.</p>
|
||||
<p className="notice">This asks whether you will claim Charity after your answer in the upcoming or current Charity phase. Yes requires a legal claim while it remains possible; No means you cannot claim during that phase. The provisional forecast can include one ordinary payment to reach eligibility. Native eligibility and payment rules still apply, and an unresolved outcome may make an answer unknown.</p>
|
||||
{(g.truthCharityAnswers ?? []).map(answer => <div key={answer}>
|
||||
{button(answer === 'unknown' ? 'I don’t know' : `Answer ${answer === 'yes' ? 'Yes' : 'No'}`, { type: 'truthAnswer', answer })}
|
||||
</div>)}
|
||||
@@ -608,7 +608,7 @@ export function Truthtrance({
|
||||
<option value="leaderRevival">Bind a named leader revival this turn</option>
|
||||
<option value="revival">Bind ordinary force revivals this turn</option>
|
||||
<option value="bid">Bind a bid in this ordinary lot</option>
|
||||
<option value="charity">Bind a Charity claim this phase</option>
|
||||
<option value="charity">Bind a Charity claim this turn</option>
|
||||
<option value="phaseBid">Bind a bid this Bidding phase</option>
|
||||
<option value="richeseBid">Bind a bid in this Richese lot</option>
|
||||
<option value="mixedBid">Combine current facts and ordinary bids</option>
|
||||
@@ -756,7 +756,7 @@ export function Truthtrance({
|
||||
</>
|
||||
) : kind === 'charity' ? (
|
||||
<>
|
||||
<p className="fine">Ask whether the selected player will claim Charity after answering during this phase. Earlier claims do not count; native eligibility and payment still apply.</p>
|
||||
<p className="fine">Ask whether the selected player will claim Charity after answering in the upcoming or current Charity phase. Earlier claims do not count; native eligibility and payment still apply. An unresolved outcome may leave the answer unknown.</p>
|
||||
{!g.truthCharityTargets.includes(target) && <p className="notice">Choose a player with a supported remaining Charity opportunity.</p>}
|
||||
<p className="notice" aria-label="Public Charity question preview">{truthQuestionText(question, leaderName, locationName, name)}</p>
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user