Rules v0.8: rounds of alternating commands; sim updates

Rules (rules.md, new file):
- Rounds of 2 commands per player in snake order (A B B A, then B A A B).
  A command is one advance or one attack; each Avatar acts once per round.
- Flat 4 RAM captures, first row Lv 1, A2-C2 and C2-E2 lines cut,
  45-card decks, Code Zero at 3 Cores with Patient Zero at 1+ counters.

Simulator:
- Command rule (default on): commands.perPlayer, commands.leads,
  commands.snake; commands.on=false restores whole turns.
- Greedy bot values Avatar unlocks (unlockPoints) and picks one action
  per command.
- Prototype switches, off by default: Avatars in the deck (recruit.*),
  buying Avatars (buyAvatars.*), copy limits (copies.*), turn-1 draw and
  second-player draw options.
- cards.csv card-text revisions, with scripts and tests to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-09-28 14:07:45 -04:00
parent 6382de19c9
commit a3eb6850ee
21 changed files with 1089 additions and 96 deletions

View file

@ -31,10 +31,11 @@ export function checkInvariants(s: GameState): string[] {
const slot = i + 1;
const copy = slot > 4;
if (!copy) {
own([av.card], `avatar${slot}`);
if (av.card >= 0 || !s.rules.recruit.on) own([av.card], `avatar${slot}`);
else if (av.at !== null || av.hardware.length) errors.push(`p${p} empty slot ${slot} is in use`);
own(av.hardware, `avatar${slot}.hardware`);
const ported = av.hardware.filter((h) => !scriptOf(s.cards[h].name)?.noPort && s.cards[h].pushedUntil === undefined);
if (ported.length > portsTotal(s, { player: p as 0 | 1, slot })) errors.push(`p${p} Avatar ${slot} is over its slots`);
if (av.card >= 0 && ported.length > portsTotal(s, { player: p as 0 | 1, slot })) errors.push(`p${p} Avatar ${slot} is over its slots`);
} else {
if (av.hardware.length) errors.push(`p${p} copy ${slot - 4} has Hardware of its own`);
if (av.at !== null && pl.avatars[i - 4].at === null) errors.push(`p${p} copy ${slot - 4} is in play without its original`);
@ -46,6 +47,8 @@ export function checkInvariants(s: GameState): string[] {
count.set(av.at, (count.get(av.at) ?? 0) + 1);
});
for (const [loc, n] of count) if (n > capacity(s, loc)) errors.push(`p${p} has ${n} Avatars on ${loc}`);
const total = pl.avatars.filter((av, i) => (i < 4 ? av.card >= 0 : av.at !== null)).length;
if (s.rules.recruit.on && total > 4) errors.push(`p${p} has ${total} Avatars, counting copies`);
});
for (const loc of LOCATIONS) {