Implement Homeworld mechanics through Caladan reinforcement checkpoint

Connect typed Homeworld custody, transport, battle, income, revival and Caladan reinforcement flows with private multiplayer recovery and controls. Preserve the optimized test workflow and keep unfinished rules modes gated. Verified with 3682 offline tests, typecheck, lint, production build and 40 HTTP tests; existing saved games remain unchanged.
This commit is contained in:
Quintine committed 2026-09-10 08:12:26 +10:00
1 parent 3be49512f7
commit 28ba1618ba
266 files changed
+47680 -16851

No files matched your search

+17 -2
View File
@@ -1,4 +1,5 @@
import { validAmbassadorResume } from './ambassador-resume';
import { ambassadorPhaseAllowed } from './ambassador-phase';
import {
validateGuildAmbassadorArrivalContext,
GuildAmbassadorContinuationError,
@@ -14,6 +15,10 @@ import {
} from './board';
import { presenceAt } from './force-presence';
import { validateAmbassadors } from './ecaz-ambassadors';
import {
homeworldMobileStrongholdMovementBlock,
homeworldSpiritualAdvisorLimit,
} from './homeworld-mobility';
export class MovementCancellationError extends Error {
constructor(message: string) {
@@ -148,6 +153,11 @@ export type AmbassadorRelocationContext = Pick<
| 'players'
| 'pendingAmbassador'
| 'ecazAmbassadors'
| 'homeworlds'
| 'homeworldRevivalReturn'
| 'homeworldRevivalProgress'
| 'homeworldVictoryReinforcement'
| 'lastBattleContext'
>;
/** Historical receipt only: a child may already have changed alliances, forces
@@ -163,7 +173,7 @@ export function validateAmbassadorRelocationContext(
g.status === 'playing' &&
integer(g.turn) &&
g.turn > 0 &&
(g.phase === 1 || g.phase === 5) &&
ambassadorPhaseAllowed(g) &&
Array.isArray(g.players) &&
new Set(g.players.map((p) => p.id)).size === g.players.length &&
entry &&
@@ -343,6 +353,8 @@ export function quoteMovementCancellation(
};
}
if (response.kind === 'mobileStronghold') {
const blocked = homeworldMobileStrongholdMovementBlock(g, owner.id);
requireContext(!blocked, blocked ?? 'This stronghold cannot move.');
const pending = g.pendingMobileMove;
requireContext(
g.phase === 0 &&
@@ -458,7 +470,10 @@ export function quoteMovementCancellation(
);
return {
kind: 'advisorFlip',
successor: owner.reserves > 0 ? 'advisor' : 'none',
successor:
homeworldSpiritualAdvisorLimit(g, owner.id, 'polar_sink') > 0
? 'advisor'
: 'none',
};
}
if (response.advisorResume === 'declaration') {