Support sector-specific Truthtrance movement
This commit is contained in:
1 parent
536d334543
commit
1059cc1682
24 files changed
+1016
-100
No files matched your search
@@ -15,7 +15,7 @@ const config: MixedActionConfig<MovementClaim> = {
|
||||
actionLabel: 'ground-movement condition',
|
||||
actionTiming: 'Future ground move · this turn',
|
||||
actionHelp: <>Each movement condition needs one actual future ground move after the answer, before your Movement turn ends this round.
|
||||
Smaller moves never add together. Prior moves and shipments do not count. The claim grants no extra movement opportunity.</>,
|
||||
You may name an exact sector. Smaller moves never add together. Prior moves and shipments do not count. The claim grants no extra movement opportunity.</>,
|
||||
fallbackError: 'Choose a current fact and a future ground-movement condition.',
|
||||
maxLeaves: MOVEMENT_EXPRESSION_MAX_LEAVES,
|
||||
maxDepth: MOVEMENT_EXPRESSION_MAX_DEPTH,
|
||||
@@ -25,10 +25,21 @@ const config: MixedActionConfig<MovementClaim> = {
|
||||
<label htmlFor={`${id}-territory`}>Ground-movement destination</label>
|
||||
<select id={`${id}-territory`} value={TERRITORIES.some(destination => destination.id === value.territory) ? value.territory : ''}
|
||||
disabled={disabled} aria-invalid={!TERRITORIES.some(destination => destination.id === value.territory)}
|
||||
onChange={event => onChange({ ...value, territory: event.currentTarget.value })}>
|
||||
onChange={event => onChange({ territory: event.currentTarget.value, minimum: value.minimum })}>
|
||||
<option value="">Choose a printed Arrakis territory</option>
|
||||
{TERRITORIES.map(destination => <option key={destination.id} value={destination.id}>{destination.name}</option>)}
|
||||
</select>
|
||||
<label htmlFor={`${id}-sector`}>Ground-movement sector</label>
|
||||
<select id={`${id}-sector`} disabled={disabled} value={value.sector === undefined ? '' : String(value.sector)}
|
||||
aria-invalid={value.sector !== undefined && !TERRITORIES.find(row => row.id === value.territory)?.sectors.includes(value.sector)}
|
||||
onChange={event => {
|
||||
const selected = event.currentTarget.value, printed = TERRITORIES.find(row => row.id === value.territory);
|
||||
if (selected === '') onChange({ territory: value.territory, minimum: value.minimum });
|
||||
else { const sector = Number(selected); if (printed?.sectors.includes(sector)) onChange({ ...value, sector }); }
|
||||
}}>
|
||||
<option value="">Any sector in this territory</option>
|
||||
{TERRITORIES.find(row => row.id === value.territory)?.sectors.map(sector => <option key={sector} value={sector}>Sector {sector}</option>)}
|
||||
</select>
|
||||
<label htmlFor={`${id}-minimum`}>Minimum physical forces in one ground move</label>
|
||||
<Input id={`${id}-minimum`} type="number" min={1} max={20} step={1} required disabled={disabled}
|
||||
value={Number.isNaN(value.minimum) ? '' : value.minimum}
|
||||
|
||||
Reference in new issue
Block a user