Fix Grumman stack placement cancellation and inventory validation
This commit is contained in:
1 parent
ba0b5647e1
commit
a6d9235099
9 files changed
+650
-7
No files matched your search
@@ -14484,6 +14484,17 @@ function finishResponse(g: Game, canceled: boolean) {
|
||||
if (response.kind === 'nexusPrescience') validateNexusInspectionResponse(g, response);
|
||||
if (response.kind === 'nexusAdvisorFlip') validateNexusAdvisorResponse(g, response);
|
||||
if (response.kind === 'nexusSardaukar') validateNexusSardaukarResponse(g, response);
|
||||
if (response.kind === 'moritaniPlacement') {
|
||||
// Both outcomes need the same physical inventory and declared source.
|
||||
// This detached denial quote is only validation here; allowance still
|
||||
// executes placeTerror and checks current placement feasibility below.
|
||||
try {
|
||||
quotePlacementCancellation(g, response);
|
||||
} catch (error) {
|
||||
if (error instanceof PlacementCancellationError) throw new RuleError(error.message);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
const ecazCollectionQuote =
|
||||
response.kind === 'ecazCollection'
|
||||
? currentEcazCollectionQuote(g, response, canceled)
|
||||
|
||||
@@ -154,13 +154,9 @@ export function quotePlacementCancellation(
|
||||
TERROR_STRONGHOLDS.includes(pending.territory),
|
||||
'No current physical Terror placement is awaiting cancellation.',
|
||||
);
|
||||
const locations = state.tokens
|
||||
.filter((t) => t.status === 'placed')
|
||||
.map((t) => t.location);
|
||||
requirePlacement(
|
||||
new Set(locations).size === locations.length,
|
||||
'Placed Terror markers need distinct strongholds.',
|
||||
);
|
||||
// Grumman may have created legal stacks earlier. Denial validates physical
|
||||
// custody and the pending source receipt, not whether that placement could
|
||||
// still succeed: no token moves, even if its source or target has changed.
|
||||
return {
|
||||
kind: 'moritaniPlacement',
|
||||
terror: {
|
||||
|
||||
Reference in new issue
Block a user