Support native Advanced and No-Field movement promises

This commit is contained in:
Quintine committed 2026-10-25 18:54:19 +11:00
1 parent 2ae2b984c0
commit 724eabf99c
20 files changed
+762 -30

No files matched your search

@@ -25,3 +25,14 @@ void test('spent shipment and paid Box decisions cannot start another preparatio
game.players[0].shipped = false; game.pendingNullentropy = { player: 'owner' } as Game['pendingNullentropy'];
assert.deepEqual([...movementShipmentPreparations(game, 'owner', () => assert.fail('Finish the paid decision'))], []);
});
void test('owned No-Field shipment candidates preserve marker identity, one-force tariff shares and last-use restrictions', () => {
const game = source(), owner = game.players[0]; owner.faction = 'richese';
owner.noField = { tokens: [{ id: 'zero', value: 0 }, { id: 'three', value: 3 }, { id: 'five', value: 5 }],
lastShipped: 'three', deployed: null }; owner.noFieldEvent = 'current';
const choices = [...movementShipmentPreparations(game, owner.id, (state, _actor, action) =>
action.noField && action.territory === 'imperial_basin' && action.sector === 9 && action.allyPayment === 2
? structuredClone(state) : null)].map(choice => choice.actions[0]);
assert.deepEqual(choices.map(choice => choice.noField), ['zero', 'five']);
assert.ok(choices.every(choice => choice.amount === 1 && choice.elite === 0 && choice.event === 'current'));
});