Allow clean active Basic ground-movement questions before or after shipment. Enumerate ordinary reserve amounts, native physical allocations, destinations and pledged payment splits through the actual declaration and shared physical commit. Detached projection stops before income/arrival effects and never counts shipment as ground fulfillment. Joint movement No and shipment Yes retain a legal next action rather than invalid End guidance. Preserve exact pending ordinary reserve and native Guild permission/rate declarations when checking the remaining route. Voluntary wrong destination, force splitting or fee loss cannot release Yes through an opponent response. Guard unsupported sources before full speculative continuation. Existing live payment, cancellation, income and entry paths remain. Persistent busy-safe controls display reinforcement and both obligations; all four existing profiles use the same legal witness without strategy refinement. Verify 19 files165/165, types/lint/build, six original-action gameplay/control/table-rendering programmes and four profiles with16 accepted actions. Genuine sources19/37/24/19 retain classic Arrakeen10 reinforced to11, native zero-board Emperor/CHOAM starts and original Guild5/15/5 reserve/cross transport. Second-card/counter cases explicitly transfer conserved originals. Bounded review repaired source guarding, funding completeness and exact pending-frame behavior. Stop an observed expensive search, reorder complete candidates by useful proximity and conservatively prune dead-end final moves; twelve new engine cases pass in3.2s. Correct a display-template lint issue. Earlier phases/waiting turns, native transport/relocation preparation, No-Field/module sources, broader interactions, full modes, comprehensive assurance and deployed acceptance remain open. No strategic tuning or saved-room/reset/restart/deployment operation.
28 lines
1.7 KiB
TypeScript
28 lines
1.7 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { movementShipmentPreparations } from '../game/movement-shipment-preparation';
|
|
import type { Game } from '../game/engine';
|
|
|
|
/** Structural enumeration fixture only, not a claimed natural gameplay source. */
|
|
function source(): Game {
|
|
return { players: [{ id: 'owner', faction: 'ixians', forces: {}, reserves: 3, shipped: false,
|
|
elites: { reserves: 1 }, ally: 'ally' }], aid: { ally: { recipient: 'owner', amount: 3 } },
|
|
expansions: [], advanced: false } as unknown as Game;
|
|
}
|
|
void test('preparation enumeration retains larger optional pledged shares and distinct physical special-force allocations', () => {
|
|
const game = source(), before = structuredClone(game);
|
|
const choices = [...movementShipmentPreparations(game, 'owner', (state, _actor, action) =>
|
|
action.territory === 'imperial_basin' && action.sector === 9 && action.amount === 2 && action.allyPayment === 3
|
|
? structuredClone(state) : null)];
|
|
assert.equal(choices.length, 2);
|
|
assert.deepEqual(choices.map(choice => choice.actions[0].elite), [0, 1]);
|
|
assert.deepEqual(choices.map(choice => choice.actions[0].allyPayment), [3, 3]);
|
|
assert.deepEqual(game, before);
|
|
});
|
|
void test('spent shipment and paid Box decisions cannot start another preparation enumeration', () => {
|
|
const game = source(); game.players[0].shipped = true;
|
|
assert.deepEqual([...movementShipmentPreparations(game, 'owner', () => assert.fail('Shipment is spent'))], []);
|
|
game.players[0].shipped = false; game.pendingNullentropy = { player: 'owner' } as Game['pendingNullentropy'];
|
|
assert.deepEqual([...movementShipmentPreparations(game, 'owner', () => assert.fail('Finish the paid decision'))], []);
|
|
});
|