Implement Guild Nexus Cunning second shipment and recovery

This commit is contained in:
Quintine committed 2026-09-10 13:35:24 +10:00
1 parent 6ba1050a92
commit 90bf699627
27 files changed
+2657 -43

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import type { Game, Player } from './engine';
/** Rule callers validate the saved record before using this allowance. The
* original shipped flag remains history when Cunning grants another shipment. */
export function shipmentAvailable(
g: Pick<Game, 'turn' | 'nexusGuildCunningHistory'>,
p: Pick<Player, 'id' | 'shipped'>,
): boolean {
const last = g.nexusGuildCunningHistory?.at(-1);
const active = last && last.receipt.turn === g.turn && last.receipt.owner === p.id &&
['pending', 'secondShipment', 'extraMove'].includes(last.stage);
return active ? last.stage === 'secondShipment' : !p.shipped;
}