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:
1 parent
3be49512f7
commit
28ba1618ba
266 files changed
+47680
-16851
No files matched your search
@@ -2,13 +2,15 @@ import type { Game, Player } from './engine';
|
||||
import { retentionReservesCard } from './moritani-retention';
|
||||
/** Only cards not already fixed into a battle may be converted into spice. */
|
||||
export function cashInCards(
|
||||
g: Pick<Game, 'battle' | 'moritaniRetention'>,
|
||||
g: Pick<Game, 'battle' | 'moritaniRetention' | 'pendingWinnerDiscards'>,
|
||||
p: Pick<Player, 'id' | 'hand'>,
|
||||
) {
|
||||
const plan = g.battle?.plans[p.id];
|
||||
const insight = g.battle?.prescience;
|
||||
return p.hand.filter(
|
||||
(c) =>
|
||||
!(g.pendingWinnerDiscards?.player === p.id &&
|
||||
[...g.pendingWinnerDiscards.cards, ...g.pendingWinnerDiscards.optional].includes(c.id)) &&
|
||||
!retentionReservesCard(g, p.id, c.id) &&
|
||||
(!plan || ![plan.weapon, plan.defense, plan.leader].includes(c.id)) &&
|
||||
(!insight || insight.player === p.id || insight.value !== c.id),
|
||||
|
||||
Reference in new issue
Block a user