Allow proposers to commit their own travel
Verify and publish checkpoint container / container (push) Successful in 11m23s
Verify and publish checkpoint container / container (push) Successful in 11m23s
This commit is contained in:
1 parent
235696263a
commit
13c337a24a
11 files changed
+456
-27
No files matched your search
@@ -87,8 +87,9 @@ export function publicDealOfferAction(targets: readonly string[], terms: string,
|
||||
const travelDeadline = travel && Object.hasOwn(travel, 'dueTurn') ? travel.dueTurn : undefined;
|
||||
if (travel && (!proposer || targets.includes(proposer) ||
|
||||
(groupTravel ? travelKeys !== 'actor,answer,kind,minimum,territory' ||
|
||||
typeof travel.actor !== 'string' || !targets.includes(travel.actor) :
|
||||
travelKeys !== 'answer,kind,minimum,territory') ||
|
||||
typeof travel.actor !== 'string' || ![proposer, ...targets].includes(travel.actor) :
|
||||
travelKeys !== 'answer,kind,minimum,territory' &&
|
||||
(travelKeys !== 'actor,answer,kind,minimum,territory' || travel.actor !== proposer)) ||
|
||||
(Object.hasOwn(travel, 'dueTurn') && (!Number.isSafeInteger(travelDeadline) || (travelDeadline as number) < 1 ||
|
||||
(currentTurn !== undefined && (!Number.isSafeInteger(currentTurn) || currentTurn < 1 || (travelDeadline as number) < currentTurn)))) ||
|
||||
!['ship', 'move'].includes(travel.kind) || !TERRITORIES.some(territory => territory.id === travel.territory) ||
|
||||
@@ -174,7 +175,9 @@ export function PublicDealList({ game, act, disabled }: {
|
||||
})}
|
||||
{travel && <p><strong>{travelTurn === deal.turn ? 'Current-turn travel term:' : 'Travel term:'}</strong> {name(travelActor!)} {deal.status === 'offered' || deal.status === 'declined' || deal.status === 'withdrawn' ? 'would' : 'agrees to'} {travel.answer ? 'make' : 'avoid'} {travel.kind === 'ship' ? 'a reserve shipment' : 'a ground movement'} of at least {travel.minimum} physical forces in one action to {travelDestination ?? travel.territory} during turn {travelTurn}. {travelStatus ? `Travel status: ${travelStatus}.` : deal.status === 'offered' ? 'The term becomes binding on final acceptance.' : deal.status === 'declined' || deal.status === 'withdrawn' ? 'The term did not become binding.' : 'Travel status is unavailable.'}</p>}
|
||||
{travel && travelTurn !== undefined && travelTurn > deal.turn && <p>Before turn {travelTurn}, this term reserves no forces or spice. Its status and legal options update during that turn.</p>}
|
||||
{travel && participants.length > 2 && deal.status === 'offered' && <p>{name(travelActor!)} must accept last, after the other recipients. Anyone invited may decline at any time.</p>}
|
||||
{travel && participants.length > 2 && deal.status === 'offered' && (travelActor === deal.from
|
||||
? <p>The proposer already consented to their own travel term by making this offer. All invited participants must accept; anyone invited may decline at any time.</p>
|
||||
: <p>{name(travelActor!)} must accept last, after the other recipients. Anyone invited may decline at any time.</p>)}
|
||||
{deal.status === 'offered' && <p>
|
||||
Accepted by {accepted.map(name).join(', ')}. Waiting for {participants.filter(id => !accepted.includes(id)).map(name).join(', ')}.
|
||||
</p>}
|
||||
@@ -275,7 +278,7 @@ export function PublicDeals({ game, act, busy }: {
|
||||
const travelDueValid = travelDueTurn.trim() !== '' && Number.isSafeInteger(travelTurn) && travelTurn >= game.turn;
|
||||
const travel: DealTravel | undefined = includeTravel ? {kind:travelKind, territory:travelTerritory,
|
||||
minimum:Number(travelMinimum), answer:travelAnswer,
|
||||
...(selected.length > 1 ? {actor:travelActor} : {}),
|
||||
...(selected.length > 1 ? {actor:travelActor} : travelActor === me?.id ? {actor:travelActor} : {}),
|
||||
...(travelTurn > game.turn ? {dueTurn:travelTurn} : {})} : undefined;
|
||||
const offer = legalSelection && paymentValid && (!includeTravel || travelDueValid)
|
||||
? publicDealOfferAction(selected, terms, payment, me?.id, game.turn, travel, additionalPayments, additionalImmediatePayments) : null;
|
||||
@@ -434,13 +437,13 @@ export function PublicDeals({ game, act, busy }: {
|
||||
{!includeTravel && selected.length === 0 && <p className="fine">Select at least one human recipient to add a travel term.</p>}
|
||||
{includeTravel && <fieldset>
|
||||
<legend>Travel term</legend>
|
||||
<p className="fine">This term concerns one physical action during the selected turn. The sole recipient commits to travel in a two-party deal. In a group deal, choose one recipient to commit; they accept last after all other recipients. Written terms remain player-managed.</p>
|
||||
<p className="fine">A travel term may include an immediate payment or a payment due by the end of a selected turn. Payment and travel may have different participants and turns. The payment recipient collects their share at the next Mentat opening and can use it after collection. All invited parties accept before the traveler gives final consent.</p>
|
||||
<p className="fine">This term concerns one physical action during the selected turn. Choose a participant to commit. An invited traveler accepts last after all other recipients; a proposer consents to their own travel by making the offer. Written terms remain player-managed.</p>
|
||||
<p className="fine">A travel term may include an immediate payment or a payment due by the end of a selected turn. Payment and travel may have different participants and turns. The payment recipient collects their share at the next Mentat opening and can use it after collection. All invited parties must accept.</p>
|
||||
{selected.length > 1 && <label>Committed traveler
|
||||
<select value={selected.includes(travelActor) ? travelActor : ''} disabled={disabled}
|
||||
<select value={parties.some(player => player.id === travelActor) ? travelActor : ''} disabled={disabled}
|
||||
onChange={event => setTravelActor(event.target.value)}>
|
||||
<option value="">Choose a recipient</option>
|
||||
{selectedPlayers.map(player => <option key={player.id} value={player.id}>{player.name} · {faction(player.faction).name}</option>)}
|
||||
<option value="">Choose a participant</option>
|
||||
{parties.map(player => <option key={player.id} value={player.id}>{player.name} · {faction(player.faction).name}</option>)}
|
||||
</select>
|
||||
</label>}
|
||||
<p className="fine">Travel terms are available in Basic games with classic factions and no expansions or optional modules. A current-turn term must be possible when accepted. A later-turn term reserves no forces or spice in advance; if no legal completion is found when the travel turn closes, the term may be marked void.</p>
|
||||
@@ -462,6 +465,13 @@ export function PublicDeals({ game, act, busy }: {
|
||||
{TERRITORIES.map(territory => <option key={territory.id} value={territory.id}>{territory.name}</option>)}
|
||||
</select>
|
||||
</label>
|
||||
{selected.length === 1 && <label>Committed traveler
|
||||
<select value={travelActor === me?.id ? travelActor : ''} disabled={disabled}
|
||||
onChange={event => setTravelActor(event.target.value)}>
|
||||
<option value="">{selectedPlayers[0]?.name ?? 'Recipient'} · recipient</option>
|
||||
{me && <option value={me.id}>{me.name} · proposer (you)</option>}
|
||||
</select>
|
||||
</label>}
|
||||
<label>Minimum physical forces in one action
|
||||
<input type="number" inputMode="numeric" min={1} max={20} step={1} value={travelMinimum} disabled={disabled}
|
||||
onChange={event => setTravelMinimum(event.target.value)} />
|
||||
|
||||
Reference in new issue
Block a user