diff --git a/components/public-deals.tsx b/components/public-deals.tsx index 6385c0c6..5cf9b1ad 100644 --- a/components/public-deals.tsx +++ b/components/public-deals.tsx @@ -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 &&

{travelTurn === deal.turn ? 'Current-turn travel term:' : 'Travel term:'} {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.'}

} {travel && travelTurn !== undefined && travelTurn > deal.turn &&

Before turn {travelTurn}, this term reserves no forces or spice. Its status and legal options update during that turn.

} - {travel && participants.length > 2 && deal.status === 'offered' &&

{name(travelActor!)} must accept last, after the other recipients. Anyone invited may decline at any time.

} + {travel && participants.length > 2 && deal.status === 'offered' && (travelActor === deal.from + ?

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.

+ :

{name(travelActor!)} must accept last, after the other recipients. Anyone invited may decline at any time.

)} {deal.status === 'offered' &&

Accepted by {accepted.map(name).join(', ')}. Waiting for {participants.filter(id => !accepted.includes(id)).map(name).join(', ')}.

} @@ -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 &&

Select at least one human recipient to add a travel term.

} {includeTravel &&
Travel term -

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.

-

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.

+

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.

+

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.

{selected.length > 1 && }

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.

@@ -462,6 +465,13 @@ export function PublicDeals({ game, act, busy }: { {TERRITORIES.map(territory => )} + {selected.length === 1 && }