Compare commits

...

4 commits

Author SHA1 Message Date
Forrest
624e8e299e updates 2026-09-28 21:40:48 -04:00
Forrest
fa1fcbadf3 Card design updates
Card CSS tweaks (execution, hardware, program, server fronts), a new
card-sheets.pdf, card art renamed from .jpg to .jpeg, and a backup of
the old turn card template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 14:21:45 -04:00
Forrest
25d01ac882 Turn card: rounds of alternating commands
The Turn Sequence card now shows the snake command order (rounds 1-3-5:
P1 P2 P2 P1; rounds 2-4-6: P2 P1 P1 P2), the draw and refresh at your
first command each round, the five steps of a command, and the limits
(one advance or attack per command, each Avatar once per round).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 14:18:14 -04:00
Forrest
a3eb6850ee 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>
2026-09-28 14:07:45 -04:00
45 changed files with 2332 additions and 198 deletions

View file

@ -0,0 +1,192 @@
/* ======================================================
Turn Order card — turn-sequence reference
Signature accent: cyan (distinct from all other cards).
====================================================== */
.card {
position: relative;
width: 750px;
height: 1050px;
box-sizing: border-box;
padding: 0;
overflow: hidden;
font-family: "Consolas", "Courier New", monospace;
background: #05080a;
--accent: #22d3ee;
--accent-dk: #0e6b78;
--screen: #e6fbff;
--chamfer: 22px;
}
/* ----- Neon HUD outline (shared across card types) ----- */
.neon {
position: absolute;
inset: 13px;
z-index: 40;
pointer-events: none;
border: 3px solid var(--accent);
clip-path: polygon(
var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer),
100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%,
var(--chamfer) 100%, 0 calc(100% - var(--chamfer)), 0 var(--chamfer)
);
box-shadow: 0 0 16px var(--accent), 0 0 6px var(--accent), inset 0 0 16px rgba(0,0,0,0.4);
}
/* ----- Terminal screen shell ----- */
.terminal {
position: absolute;
inset: 20px;
box-sizing: border-box;
border-radius: 16px;
padding: 0 0 24px;
color: var(--screen);
background: radial-gradient(120% 90% at 50% 0%, #0a1c20 0%, #06090c 60%, #04070a 100%);
box-shadow:
inset 0 0 70px rgba(0,0,0,0.7),
inset 0 0 0 2px rgba(34,211,238,0.08),
0 0 0 2px rgba(0,0,0,0.6),
0 10px 24px rgba(0,0,0,0.6);
overflow: hidden;
}
/* CRT scanline + phosphor glow overlay */
.scanlines {
position: absolute;
inset: 0;
z-index: 4;
pointer-events: none;
border-radius: 16px;
background:
repeating-linear-gradient(0deg, rgba(0,0,0,0.20) 0 2px, transparent 2px 4px),
radial-gradient(120% 80% at 50% 30%, rgba(34,211,238,0.06) 0%, transparent 70%);
}
/* ----- Header bar ----- */
.term-bar {
position: relative;
z-index: 2;
display: flex;
align-items: center;
gap: 14px;
height: 90px;
padding: 0 24px;
background: linear-gradient(180deg, rgba(34,211,238,0.10) 0%, rgba(0,0,0,0) 100%);
border-bottom: 2px solid var(--accent-dk);
}
.title {
flex: 1;
font-size: 44px;
font-weight: 800;
letter-spacing: 1px;
text-transform: uppercase;
color: #f2feff;
text-shadow: 0 0 12px rgba(34,211,238,0.5), 0 2px 4px #000;
line-height: 1.02;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.badge {
flex: none;
padding: 8px 14px;
border-radius: 8px;
font-size: 22px;
font-weight: 800;
letter-spacing: 2px;
color: #05080a;
background: var(--accent);
box-shadow: 0 0 14px var(--accent);
}
/* ----- Command line ----- */
.cmdline {
position: relative;
z-index: 2;
margin: 20px 24px 0;
font-size: 24px;
font-weight: 700;
letter-spacing: 1px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cmdline .user { color: var(--accent); }
.cmdline .punc { color: #6f8a90; margin: 0 2px; }
.cmdline .cwd { color: #a9d9e0; }
.cmdline .cmd { color: #f2feff; margin-left: 10px; }
/* ----- Phase list ----- */
.phases {
position: relative;
z-index: 2;
list-style: none;
margin: 26px 26px 0;
padding: 0;
}
.phases li {
position: relative;
display: flex;
align-items: center;
gap: 22px;
padding: 14px 18px;
min-height: 78px;
box-sizing: border-box;
}
.phases li + li { margin-top: 12px; }
/* flow connector between step badges */
.phases li:not(:last-child)::before {
content: "";
position: absolute;
left: 45px; /* center of the 54px badge (18px pad + 27) */
top: 78px;
height: 24px;
width: 3px;
background: var(--accent-dk);
box-shadow: 0 0 6px rgba(34,211,238,0.4);
}
.num {
flex: none;
width: 54px;
height: 54px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
font-size: 30px;
font-weight: 800;
color: #05080a;
background: var(--accent);
border: 3px solid #05080a;
box-shadow: 0 0 14px rgba(34,211,238,0.55);
}
.step {
flex: 1;
font-size: 30px;
font-weight: 700;
line-height: 1.15;
color: #eafcff;
text-shadow: 0 1px 2px #000;
}
/* ----- Status bar footer ----- */
.statusbar {
position: absolute;
left: 24px;
right: 24px;
bottom: 18px;
z-index: 2;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 20px;
font-weight: 700;
letter-spacing: 2px;
color: #6f8a90;
}
.statusbar .loop {
display: inline-flex;
align-items: center;
gap: 8px;
color: var(--accent);
}

View file

@ -0,0 +1,42 @@
<!--
Turn-Order-Front template — turn-sequence reference card
Card size: 750 x 1050 px (2.5in x 3.5in @ 300 DPI)
Static rules card: the 7 phases are fixed; only the title is data-driven ({{card.name}}).
Signature accent: cyan.
-->
<div class="card">
<div class="neon"></div>
<div class="terminal">
<div class="scanlines"></div>
<!-- Header bar -->
<div class="term-bar">
<span class="title">{{card.name}}</span>
<span class="badge">SYS</span>
</div>
<!-- Command line -->
<div class="cmdline">
<span class="user">turn</span><span class="punc">@</span><span class="cwd">files</span><span class="punc">:</span>
<span class="cmd">run --phases 1..7</span>
</div>
<!-- Phase list -->
<ol class="phases">
<li><span class="num">1</span><span class="step">Draw Card</span></li>
<li><span class="num">2</span><span class="step">Place Avatars</span></li>
<li><span class="num">3</span><span class="step">Play Cards from Hand</span></li>
<li><span class="num">4</span><span class="step">Attack</span></li>
<li><span class="num">5</span><span class="step">Resolve Attack, Movement &amp; Server Placement</span></li>
<li><span class="num">6</span><span class="step">Play Additional Cards from Hand</span></li>
<li><span class="num">7</span><span class="step">Pass Turn</span></li>
</ol>
<!-- Status bar footer -->
<div class="statusbar">
<span class="loop">↺ REPEAT EACH TURN</span>
<span class="model">FILES-TCG · TURN ORDER</span>
</div>
</div>
</div>

200
QUICKSTART.md Normal file
View file

@ -0,0 +1,200 @@
# Files TCG Quick Start
*For rules v0.8.* This page gets you through your first game. The full rules, with every card
ruling, are in [rules.md](rules.md).
## The Idea
You and your opponent are hackers fighting over a network. Your **Avatars** move out from your
starting Server and capture **Server locations** on a shared grid. Every capture earns **RAM**, which
you spend on cards that upgrade your Avatars, trap your locations and disrupt your opponent.
**Win by controlling 10 Server locations.** Your starting Server doesn't count.
## What You Need
Each player needs:
- **4 Avatars**
- **20 Servers**, kept as a separate pile
- A **45-card deck** of Executions, Hardware and Programs, with at most 2 copies of any card
- A few **d6**, and something to track RAM
You'll also need the **playmat**, which has 13 locations plus the two starting Servers.
## The Cards
| Card | What it is | Where it goes | When you play it |
|---|---|---|---|
| **Avatar** | Your units. **Cores** = dice in combat. **Expansion Slots** = how much Hardware it can hold. Its **Ability** can be used once per round by paying its RAM cost. | Your Avatar slots, then onto locations you control | Free, at the start of your command |
| **Server** | The locations you capture. Each has an ability that helps whoever holds it. | Onto a location when you capture it | Automatically |
| **Program** | Buffs and traps for a location | A location you control, 2 at most | During your command |
| **Hardware** | Upgrades for an Avatar | An Avatar in play, up to its Expansion Slots | During your command |
| **Execution** | One-shot tricks, then discarded | Wherever the card says | **Any time**, even in your opponent's command |
Every card except Avatars and Servers costs the **RAM** printed on it.
## Setup
1. Shuffle your 4 Avatars and put them **face down** in your Avatar slots 1–4. Flip **Avatar 1**
face up.
2. Shuffle your Servers into a face-down pile. Put the top one face down on your starting Server, and
reveal it when the game starts.
3. Shuffle your deck and draw **7 cards**.
4. Start with **4 RAM**.
5. Pick a first player at random. They **skip their draw in round 1**.
## The Board
```
S2 North start
|
E1 -----o------ E2 -----o----- E3
\ / \ /
o o o o
\ / \ /
D1 D2
/ \ / \
o o o o
/ \ / \
C1 C2 C3
\ / \ /
o o o o
\ / \ /
B1 B2
/ \ / \
o o o o
/ \ / \
A1 -----o------ A2 -----o----- A3
|
S1 South start
```
- Lines connect the locations. Each `o` is a **gateway**, where Firewalls go.
- Each row is a **level**, counted from your side: your first row is Lv 1, the middle row (C) is
Lv 3, and the enemy's first row is Lv 5.
- **Unlocking Avatars:** the first time you capture a location of level N, flip Avatar N face up.
Take your second row for Avatar 2, the middle row for Avatar 3, and the enemy's second row for
Avatar 4. A new Avatar can enter play from the next round.
More Avatars means more actions each round, so pushing forward early matters.
## How a Round Works
Each round, each player gets **2 commands**, and the order snakes:
| Round | Commands |
|---|---|
| 1, 3, 5… | P1, P2, P2, P1 |
| 2, 4, 6… | P2, P1, P1, P2 |
**At your first command of each round:** draw a card, then **refresh** your Avatars so they can
act again.
**Each command has five steps:**
1. **Place and advance.** Put any of your face-up Avatars on any locations you control, for free.
Then you may **advance** one Avatar into an **empty or undefended** location next to your
territory.
2. **Play cards** from your hand.
3. **Attack.** If you didn't advance, one Avatar may attack a **defended** enemy location next to
the location it's standing on.
4. **Resolve** the capture or combat right away.
5. **Play more cards**, including with the RAM you just earned.
**The key limits:**
- Each command gets **one advance or one attack**, not both.
- Each Avatar can advance or attack **once per round**.
- Each location holds 1 of your Avatars.
Your Avatars don't have to walk. Each round you can place them on any location you hold, then
step out from your territory.
## Capturing and Combat
**Taking an empty or undefended location** needs no fight. Move in, flip the top Server from your
pile onto it, and **gain 4 RAM**, plus any RAM bonus the Server card gives. If the location was the
enemy's, their Server goes to the bottom of their pile and their Programs there are discarded.
**Attacking a defended location** means a fight:
1. Each side rolls **1d6 per Core**. Count the Avatar, its Hardware, Programs, effects, and the
Server it's on.
2. **The higher total wins.** On a tie, both sides reroll.
3. **The loser** goes back to its Avatar slot and discards its Hardware.
4. **A winning attacker** captures the location.
Starting Servers can never be attacked.
| Your Cores vs theirs | You win about |
|---|---|
| Even | 50% |
| +1 Core | 75–90% |
| +2 Cores | 90–99% |
## RAM
- **Earn it** by capturing, which pays 4 RAM every time, including recaptures.
- **Salvage:** discard any card from your hand to gain its printed RAM. You can do this whenever you
need to pay for something.
- **Spend it** on cards, Avatar Abilities and Firewalls.
- It carries over between rounds, and there's no cap.
## Firewalls
Firewalls aren't cards. You buy them with RAM and put them on a gateway (`o`) on a line touching one
of your locations. A Firewall **blocks all movement and attacks** along its line, for both players.
| Level | Cost to place or clear |
|---|---|
| Lv 1 | 2 RAM |
| Lv 2 | 4 RAM |
| Lv 3 | 8 RAM |
- **Place** Firewalls in steps 2 and 5. Upgrading one costs the full price of the new level.
- **Clear** a Firewall before you advance or attack, by paying its current level. The player who
placed it pays too.
- A Firewall belongs to no one once it's placed.
## Your First Round, Step by Step
Say you're the first player, starting at S1:
1. **Your first command.** You don't draw, because you're first in round 1. Place Avatar 1 on S1 and
advance it to **A2**, the only way out. Flip a Server onto A2 and gain 4 RAM, which gives you 8.
Play a card if you like.
2. **Their two commands.** They draw, place their Avatar on S2, and advance it to E2. Their second
command can play cards, but their only Avatar has already acted this round.
3. **Your second command.** Your Avatar has also acted, so you can only play cards or Firewalls.
Or pass, and save your RAM.
4. **Round 2.** Your opponent leads. When your turn comes, you draw, refresh, and advance into A1,
A3, B1 or B2. **B1 and B2 unlock Avatar 2.**
## Tips for New Players
- **Grab empty locations early.** They cost nothing to take and pay 4 RAM each.
- **Head for your second row.** Avatar 2 doubles what you can do each round, and it's the biggest
early swing.
- **Plan both commands.** With one Avatar, your second command can only play cards. Use it to buy
Hardware or set Programs and Firewalls.
- **Don't leave fronts empty.** An undefended enemy location can be taken without a fight. Stand
your Avatars where the opponent can reach.
- **Attack with an edge.** One extra Core wins most fights, and Hardware is the easiest way to get it.
- **Salvage freely.** A card you won't use soon is RAM in your hand.
- **Keep an Execution back.** They work in your opponent's command too, often during a fight.
## Reading "Turn" on Cards
Cards say "turn," but the game is played in rounds of commands. Read the card text like this:
- **"Your turn"** means your commands this round.
- **"Once per turn"** means once per round.
- **"This turn"** lasts until the end of the current command.
- **"Until your next turn"** lasts until your next command.
## Where to Go Next
- [rules.md](rules.md) has the full rules: timing windows, card terms, rulings for individual cards,
and the full combat odds table.
- The **Turn Order** card has the round order and command steps for quick reference at the table.

View file

Before

Width:  |  Height:  |  Size: 883 KiB

After

Width:  |  Height:  |  Size: 883 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 274 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 183 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 824 KiB

After

Width:  |  Height:  |  Size: 824 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 858 KiB

After

Width:  |  Height:  |  Size: 858 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 450 KiB

After

Width:  |  Height:  |  Size: 450 KiB

Before After
Before After

25
assets/of5pgujpnh-art.svg Normal file
View file

@ -0,0 +1,25 @@
<svg width="640" height="480" viewBox="0 0 640 480" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="symbol-uj3xoygkn-pattern" viewBox="0 0 640 480">
<path d="M 320.00,24.00 C 331.74,25.24 341.74,37.60 353.88,40.91 C 366.02,44.22 380.50,41.12 392.85,43.86 C 405.20,46.59 416.55,52.07 427.98,57.34 C 439.41,62.61 452.06,67.39 461.42,75.47 C 470.77,83.55 477.19,95.33 484.12,105.81 C 491.05,116.29 498.11,126.69 503.00,138.35 C 507.88,150.01 507.80,164.54 513.41,175.78 C 519.02,187.02 534.35,194.71 536.66,205.80 C 538.97,216.90 529.29,229.97 527.28,242.35 C 525.27,254.73 526.26,267.64 524.59,280.08 C 522.91,292.52 519.55,304.66 517.21,316.98 C 514.87,329.30 516.61,344.00 510.53,354.01 C 504.44,364.01 490.02,368.58 480.71,376.99 C 471.39,385.41 464.02,396.13 454.66,404.49 C 445.31,412.85 434.46,419.44 424.56,427.15 C 414.66,434.85 406.40,447.53 395.25,450.74 C 384.09,453.95 370.16,445.54 357.62,446.42 C 345.08,447.29 332.54,454.54 320.00,456.00 C 307.46,457.46 294.92,456.04 282.38,455.16 C 269.84,454.29 256.17,455.10 244.75,450.74 C 233.34,446.38 222.81,437.87 213.88,429.00 C 204.94,420.14 200.15,406.34 191.15,397.57 C 182.14,388.79 170.11,383.62 159.83,376.36 C 149.55,369.10 134.66,364.08 129.47,354.01 C 124.28,343.94 131.58,328.16 128.67,315.94 C 125.76,303.72 114.91,292.90 112.02,280.68 C 109.12,268.45 112.73,255.08 111.28,242.60 C 109.83,230.12 101.24,217.20 103.34,205.80 C 105.43,194.40 117.05,184.75 123.84,174.20 C 130.64,163.64 138.16,153.50 144.12,142.46 C 150.08,131.42 153.84,119.11 159.58,107.95 C 165.33,96.78 169.36,82.57 178.58,75.47 C 187.81,68.37 202.81,68.71 214.93,65.34 C 227.05,61.97 239.88,60.56 251.30,55.25 C 262.71,49.94 271.97,38.70 283.42,33.49 C 294.87,28.29 308.26,22.76 320.00,24.00" fill="#a69179" stroke="#000000" stroke-width="2" transform="translate(0, 0)" />
</symbol>
<symbol id="symbol-i5befphwa-pattern" viewBox="0 0 640 480">
<path d="M33.60,35.68 C37.48,15.59 142.52,54.92 205.98,99.03 C269.45,143.14 412.26,276.06 414.40,300.32 C416.54,324.58 257.45,258.02 218.83,244.57 C180.22,231.11 213.60,254.40 182.72,219.59 C151.85,184.77 29.72,55.77 33.60,35.68Z" fill="#ccbdab" stroke="#000000" stroke-width="2" transform="translate(96, 72)" />
</symbol>
</defs>
<rect width="640" height="480" fill="#ae997e" />
<use href="#symbol-uj3xoygkn-pattern" x="0" y="0" width="640" height="480" />
<use href="#symbol-uj3xoygkn-pattern" x="0" y="0" width="640" height="480" transform="translate(640, 0) scale(-1, 1)" />
<use href="#symbol-uj3xoygkn-pattern" x="0" y="0" width="640" height="480" transform="translate(0, 480) scale(1, -1)" />
<use href="#symbol-uj3xoygkn-pattern" x="0" y="0" width="640" height="480" transform="translate(640, 480) scale(-1, -1)" />
<use href="#symbol-i5befphwa-pattern" x="0" y="0" width="640" height="480" />
<use href="#symbol-i5befphwa-pattern" x="0" y="0" width="640" height="480" transform="translate(640, 0) scale(-1, 1)" />
<use href="#symbol-i5befphwa-pattern" x="0" y="0" width="640" height="480" transform="translate(0, 480) scale(1, -1)" />
<use href="#symbol-i5befphwa-pattern" x="0" y="0" width="640" height="480" transform="translate(640, 480) scale(-1, -1)" />
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

View file

@ -1,56 +1,56 @@
"Name","Count","Front Template","Back Template","RAM","Cores","Description","Type","Image","Expansion Slots","Ability Cost","Ability Name","Ability Description"
"Carbon NanoBots","1","Avatar Front","Card Back",,"2","Nasty little bugs...","B","nano-bots","4","5","Replicate","Avatar may create a copy of itself. Only one copy is allowed at a time. If the copy is defeated the original does not lose any hardware upgrades. If the original is defeated the replicate is as well."
"Corrupt Driver","1","Avatar Front","Card Back",,"3",,"V","driver-ascii-art","3","4","Driver Fault","Choose one Hardware on an enemy Avatar in combat with this Avatar. It is disabled until the end of your next turn."
"Corrupt Driver","1","Avatar Front","Card Back",,"3",,"V","driver-ascii-art","3","4","Driver Fault","Choose one Hardware on an enemy Avatar in combat with this Avatar. It is disabled until the end of your next command."
"Pixelated Picture","1","Avatar Front","Card Back",,"3",,"G","pix","3","3","Low Resolution","Attacking Avatars have -1 cores against this Avatar."
"Beta Version 1.0","1","Avatar Front","Card Back",,"4",,"P","beta-version","2","4","Push Update","While in combat an additional piece of hardware can be placed on this avatar until the end of your turn. If there no ports available this can still be attached."
"Code Zero","1","Avatar Front","Card Back",,"2",,"V","code-zero","4","4","Patient Zero","Place an Infection counter on every enemy Avatar in combat at this Server. While this Avatar is in play, an Avatar with 2+ Infection counters has -1 Core."
"Data Leaker","1","Avatar Front","Card Back",,"3",,"G","data-leaker","3","3","Exfiltrate","Look at your opponent's hand and choose one card in it. They must discard that card without gaining RAM. If this Avatar breached a Server this turn, draw a card."
"Beta Version 1.0","1","Avatar Front","Card Back",,"4",,"P","broken-bits","2","4","Push Update","While in combat an additional piece of hardware can be placed on this avatar until the end of your command. If there no ports available this can still be attached."
"Code Zero","1","Avatar Front","Card Back",,"3",,"V","code-zero","4","4","Patient Zero","Place an Infection counter on every enemy Avatar in combat at this Server. While this Avatar is in play, an Avatar with 1+ Infection counters has -1 Core."
"Data Leaker","1","Avatar Front","Card Back",,"3",,"G","data-leaker","3","3","Exfiltrate","Look at your opponent's hand and choose one card in it. They must discard that card without gaining RAM. If this Avatar breached a Server this command, draw a card."
"Backup Machine","1","Avatar Front","Card Back",,"3",,"P","backup","3","5","Restore Point","Return one Hardware or Program from your discard pile to your hand. If it is a Hardware and this Avatar has an open port, you may install it immediately for 2 less RAM."
"Broken Bits","1","Avatar Front","Card Back",,"4",,"B","broken-bits","2","4","Bit Flip","During a combat at this Server, reroll any number of this Avatar's Core dice."
"Recursive Infection","1","Program Front","Card Back","6",,"Whenever an enemy Avatar attacks or breaches this Server, place an Infection counter on it. An Avatar with 3+ Infection counters has -1 Core.","V",,,,,
"Memory Parasite","1","Program Front","Card Back","5",,"Enemy Avatars attacking this Server have -1 RAM available for Executions.","V",,,,,
"Replication Routine","1","Program Front","Card Back","6",,"When you install a Virus Program on this Server, you may install a second Virus Program from your hand here for 1 less RAM.","V",,,,,
"Resource Leech","1","Program Front","Card Back","5",,"Whenever an enemy Avatar is destroyed while attacking this Server, gain 2 RAM.","V",,,,,
"Broken Bits","1","Avatar Front","Card Back",,"4",,"B","broken-bits-2","2","4","Bit Flip","During a combat at this Server, reroll any number of this Avatar's Core dice."
"Recursive Infection","1","Program Front","Card Back","6",,"Whenever an enemy Avatar attacks or breaches this Server, place an Infection counter on it. An Avatar with 3+ Infection counters has -2 Core.","V",,,,,
"Memory Parasite","1","Program Front","Card Back","5",,"Enemy Avatars attacking this Server have 1 hardware component disabled of the owners choosing.","V",,,,,
"Replication Routine","1","Program Front","Card Back","6",,"When you install a Virus Program on this Server, you may install a second Virus Program from your hand here for no RAM cost.","V",,,,,
"Resource Leech","1","Program Front","Card Back","5",,"Whenever an enemy Avatar is destroyed while attacking this Server, gain 5 RAM.","V",,,,,
"Worm Protocol","1","Program Front","Card Back","4",,"The localized effects of your other Programs on this Server also apply at one adjacent Server you choose when this is installed.","V",,,,,
"Payload Injector","1","Program Front","Card Back","6",,"The first Execution you play targeting this Server each turn costs 1 less RAM.","V",,,,,
"Persistent Infection","1","Program Front","Card Back","6",,"If this Server stops being under your control, keep this Program installed here; its effect now applies to every Avatar at that Server regardless of controller.","V",,,,,
"Infinite Loop","1","Program Front","Card Back","5",,"The first enemy Avatar to attack this Server each turn is caught in a loop: if it survives the battle, it must immediately repeat its attack once. Gain 1 RAM.","B",,,,,
"Payload Injector","1","Program Front","Card Back","6",,"The first Execution you play targeting this Server each round costs 2 less RAM.","V",,,,,
"Persistent Infection","1","Program Front","Card Back","6",,"If an Avatar is defeated at this Server, place an Infection Counter on it permanently.","V",,,,,
"Infinite Loop","1","Program Front","Card Back","5",,"If the attacking Avatar is controlled by the owner of this Program, it may attack a second adjacent Server in the same command.","B",,,,,
"Stack Overflow","1","Program Front","Card Back","7",,"Avatars you control defending this Server gain +1 Core for each Program installed on this Server (including this one).","B",,,,,
"Race Condition","1","Program Front","Card Back","4",,"During any combat at this Server, both players secretly choose Attack or Defend. If the choices differ, the defender gains a combat bonus.","B",,,,,
"Memory Leak","1","Program Front","Card Back","6",,"At the start of any combat at this Server, the attacking Avatar loses 1 RAM for each Hardware installed on it.","B",,,,,
"Null Pointer","1","Program Front","Card Back","5",,"Once per turn, when an enemy Execution would resolve at this Server, resolve the game's uncertainty mechanic. On success, it does nothing.","B",,,,,
"Deadlock","1","Program Front","Card Back","4",,"Neither Avatar in a combat that takes place at this Server may retreat until that combat resolves.","B",,,,,
"Overflow Error","1","Program Front","Card Back","5",,"When an enemy Avatar is destroyed while attacking this Server, destroy or disable one Hardware or Program that Avatar's controller has in play.","B",,,,,
"Undefined Behavior","1","Program Front","Card Back","8",,"Once per turn, copy the localized effect of another Program on this Server. Then disable this Program until your next turn.","B",,,,,
"Race Condition","1","Program Front","Card Back","4",,"During any combat at this Server, both players secretly choose Attack or Defend. If the choices differ, the defender gains a combat bonus of +2 Cores.","B",,,,,
"Memory Leak","1","Program Front","Card Back","6",,"At the start of any combat at this Server, the attacking Avatar loses 1 Core for each Hardware installed on it.","B",,,,,
"Null Pointer","1","Program Front","Card Back","5",,"Once per round, when an enemy Execution would resolve at this Server, it's effect does not occur.","B",,,,,
"Stock Rice","1","Program Front","Card Back","4",,"Neither Avatar in a combat that takes place at this Server may use any Hardware bonuses.","B",,,,,
"Overflow Error","1","Program Front","Card Back","5",,"When an enemy Avatar is destroyed while attacking this Server, destroy or disable one Program that Avatar's controller has in play.","B",,,,,
"Undefined Behavior","1","Program Front","Card Back","8",,"Once per round, copy the localized effect of another Program on another Server. Then disable this Program until your next command.","B",,,,,
"Packet Loss","1","Program Front","Card Back","6",,"When an enemy successfully breaches this Server, its controller discards a card at random.","G",,,,,
"Desynchronization","1","Program Front","Card Back","5",,"Enemy Avatars attacking this Server cannot use their Hardware's ""once per turn"" abilities during that combat.","G",,,,,
"Visual Artifact","1","Program Front","Card Back","5",,"The first attack made against an Avatar you control at this Server each turn suffers -1 Core.","G",,,,,
"Desynchronization","1","Program Front","Card Back","5",,"Enemy Avatars attacking this Server cannot use their Hardware's ""once per round"" abilities during that combat.","G",,,,,
"Visual Artifact","1","Program Front","Card Back","5",,"The first attack made against an Avatar you control at this Server suffers -1 Core.","G",,,,,
"Ghost Process","1","Program Front","Card Back","6",,"Your Executions played targeting this Server may also affect Avatars, Programs, and Hardware at one adjacent Server.","G",,,,,
"False Positive","1","Program Front","Card Back","7",,"When an enemy Execution targets an Avatar you control at this Server, you may redirect it to another legal Avatar at this Server.","G",,,,,
"Fragmentation","1","Program Front","Card Back","6",,"Executions your opponents play targeting this Server cost +1 RAM.","G",,,,,
"False Positive","1","Program Front","Card Back","7",,"When an enemy Execution targets an Avatar you control at this Server, you may redirect it to another legal Avatar at another Server.","G",,,,,
"Fragmentation","1","Program Front","Card Back","6",,"Executions your opponents play targeting this Server cost +2 RAM.","G",,,,,
"Latency Spike","1","Program Front","Card Back","5",,"The attacking player cannot play Executions during the first step of any combat at this Server.","G",,,,,
"Hotfix","1","Program Front","Card Back","7",,"The first Program on this Server that would be destroyed each turn is instead disabled until your next turn.","P",,,,,
"Error Correction","1","Program Front","Card Back","5",,"At the beginning of your turn, remove one negative counter or status from each Avatar you control at this Server.","P",,,,,
"Garbage Collection","1","Program Front","Card Back","6",,"Once per turn, sacrifice one Program installed on this Server to recover its printed RAM value.","P",,,,,
"Hotfix","1","Program Front","Card Back","7",,"The first Program on this Server that would be destroyed each round is instead disabled until your next command.","P",,,,,
"Error Correction","1","Program Front","Card Back","5",,"At the beginning of your first command each round, remove one negative counter or status from each Avatar you control at this Server.","P",,,,,
"Garbage Collection","1","Program Front","Card Back","6",,"Once per round, sacrifice one Program installed on this Server to recover its printed RAM value.","P",,,,,
"Version Control","1","Program Front","Card Back","5",,"When a Program on this Server would be destroyed, or when this Server is captured, return one Program from this Server to your hand instead of discarding it.","P",,,,,
"Rollback Routine","1","Program Front","Card Back","4",,"Once per turn, undo the most recent temporary stat reduction applied to an Avatar you control at this Server.","P",,,,,
"Compatibility Layer","1","Program Front","Card Back","6",,"This Server may hold one additional Program beyond the normal limit, and Patch Programs installed here cost 1 less RAM.","P",,,,,
"RAM Expansion","1","Hardware Front","Card Back","5",,"Avatar gains +2 RAM capacity.",,,,,,
"Rollback Routine","1","Program Front","Card Back","4",,"Once per round, undo the most recent temporary stat reduction applied to an Avatar you control at this Server.","P",,,,,
"Compatibility Layer","1","Program Front","Card Back","6",,"This Server may hold one additional Program beyond the normal limit, and Patch Programs installed here cost 2 less RAM.","P",,,,,
"RAM Expansion","1","Hardware Front","Card Back","5",,"Avatar gains +2 Core capacity.",,,,,,
"Additional Core","1","Hardware Front","Card Back","5",,"Avatar gains +1 Core.",,,,,,
"Overclocked CPU","1","Hardware Front","Card Back","6",,"Avatar gains +2 Cores during combat, but one installed Program becomes disabled afterward.",,,,,,
"Solid-State Cache","1","Hardware Front","Card Back","6",,"The first Program installed on this Avatar each turn costs 1 less RAM.",,,,,,
"Redundant Power Supply","1","Hardware Front","Card Back","8",,"The first time this Avatar would be destroyed, destroy this Hardware instead and leave the Avatar active.",,,,,,
"Network Interface Upgrade","1","Hardware Front","Card Back","4",,"Moving between adjacent Servers costs 1 less resource or may occur once per turn for free.",,,,,,
"Overclocked CPU","1","Hardware Front","Card Back","6",,"Avatar gains +2 Cores during combat, but one installed Program at the current server becomes disabled afterward for 2 commands.",,,,,,
"Solid-State Cache","1","Hardware Front","Card Back","6",,"The first Program installed on the occupied Server each round costs 3 less RAM.",,,,,,
"Redundant Power Supply","1","Hardware Front","Card Back","8",,"The first time this Avatar would be destroyed, do not destroy the Hardware.",,,,,,
"Network Interface Upgrade","1","Hardware Front","Card Back","4",,"This Hardware can be played without taking an upgrade port on the Avatar.",,,,,,
"Dedicated GPU","1","Hardware Front","Card Back","6",,"Executions performed by this Avatar receive +1 effectiveness or combat strength.",,,,,,
"ECC Memory","1","Hardware Front","Card Back","5",,"Opponents cannot place Bug counters or Bug status effects on this Avatar.",,,,,,
"Cooling System","1","Hardware Front","Card Back","6",,"Prevent penalties caused by Overclocking Hardware or allow one Hardware to activate twice per turn.",,,,,,
"RAID Array","1","Hardware Front","Card Back","5",,"When a Program on this Avatar is destroyed, resolve the game's uncertainty mechanic. On success, return it to your hand.",,,,,,
"Packet Accelerator","1","Hardware Front","Card Back","4",,"This Avatar acts first when it initiates combat.",,,,,,
"Firewall Appliance","1","Hardware Front","Card Back","6",,"The first hostile Program or Execution targeting this Avatar each turn costs the opponent +1 RAM.",,,,,,
"Hardware Sandbox","1","Hardware Front","Card Back","7",,"Choose one Program installed on this Avatar. It cannot be targeted by opponents.",,,,,,
"Diagnostic Module","1","Hardware Front","Card Back","4",,"Look at one facedown or hidden card associated with an opposing Avatar or Server once per turn.",,,,,,
"Hot-Swap Bay","1","Hardware Front","Card Back","6",,"Once per turn, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost.",,,,,,
"Quantum Coprocessor","1","Hardware Front","Card Back","9",,"Once per turn when this Avatar uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware until your next turn.",,,,,,
"Cooling System","1","Hardware Front","Card Back","6",,"Allow one Hardware to activate twice per round.",,,,,,
"RAID Array","1","Hardware Front","Card Back","5",,"When this Avatar is destroyed, all hardware can be kept by paying half the RAM cost.",,,,,,
"Packet Accelerator","1","Hardware Front","Card Back","4",,"This Avatar gains +1 Core hen attacking.",,,,,,
"Firewall Appliance","1","Hardware Front","Card Back","6",,"The first hostile Program or Execution targeting this Avatar each round costs the opponent +3 RAM.",,,,,,
"Hardware Sandbox","1","Hardware Front","Card Back","7",,"Choose one Program installed on the occupied Server. It cannot be targeted by opponents.",,,,,,
"Diagnostic Module","1","Hardware Front","Card Back","4",,"Look at one face down card in your draw pile. You may place it at the bottom and draw another to start your first command each round.",,,,,,
"Hot-Swap Bay","1","Hardware Front","Card Back","6",,"Once per round, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost.",,,,,,
"Quantum Coprocessor","1","Hardware Front","Card Back","9",,"Once per round when this Avatar uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware.",,,,,,
"High Efficiency RAM Server","1","Server Front","Card Back",,,"Add additional 4 RAM to resource total",,,,,,
"MultiCore Server","1","Server Front","Card Back",,,"Add 2 Cores to any Avatars",,,,,,
"Cluster Server","1","Server Front","Card Back",,,"Up to 2 Avatars can defend this Server",,,,,,
@ -66,20 +66,20 @@
"Callable Server","1","Server Front","Card Back",,,"When drawing a card, you may choose to place it on the bottom of the deck and draw another",,,,,,
"Execute: Disconnect","1","Execution Front","Card Back","4",,"Move one Avatar you control at the target Server to an adjacent Server, removing it from any combat there.",,,,,,
"Execute: Sabotage","1","Execution Front","Card Back","7",,"Destroy or disable one Hardware on an enemy Avatar in combat at the target Server.",,,,,,
"Execute: Kill Process","1","Execution Front","Card Back","5",,"Disable one Program installed on the target Server until its controller's next turn.",,,,,,
"Execute: Force Reboot","1","Execution Front","Card Back","5",,"Remove all temporary bonuses and penalties from one Avatar you control at the target Server, or one Avatar attacking it. That Avatar cannot play another Execution this turn.",,,,,,
"Execute: Fork","1","Execution Front","Card Back","7",,"Copy the localized effect of one Program installed on the target Server until end of turn.",,,,,,
"Execute: Ping Sweep","1","Execution Front","Card Back","4",,"Look at all Programs and Hardware attached to the target Server and to every Avatar based at or attacking it, then draw a card.",,,,,,
"Execute: Kill Process","1","Execution Front","Card Back","5",,"Disable one Program installed on the target Server until its controller's next command.",,,,,,
"Execute: Force Reboot","1","Execution Front","Card Back","5",,"Remove all temporary bonuses and penalties from one Avatar you control at the target Server, or one Avatar attacking it. That Avatar cannot play another Execution until end of current command.",,,,,,
"Execute: Fork","1","Execution Front","Card Back","7",,"Copy the localized effect of one Program installed on the target Server until end of current command.",,,,,,
"Execute: Ping Sweep","1","Execution Front","Card Back","4",,"You may draw 2 cards from the top of your deck.",,,,,,
"Execute: Trace Route","1","Execution Front","Card Back","5",,"Move one Avatar you control from an adjacent Server to the target Server. If the target Server is enemy-controlled, your Avatar attacks it with +1 Core for the resulting combat.",,,,,,
"Execute: Override","1","Execution Front","Card Back","5",,"Choose one enemy Program installed on the target Server. Ignore its text until the end of turn.",,,,,,
"Execute: Override","1","Execution Front","Card Back","5",,"Choose one enemy Program installed on the target Server. Ignore its text until end of current command.",,,,,,
"Execute: Memory Dump","1","Execution Front","Card Back","4",,"Draw 2 cards, then discard 1. If you control the target Server, draw 1 extra card instead of discarding.",,,,,,
"Execute: Rollback","1","Execution Front","Card Back","4",,"Return one Program or Hardware installed at the target Server this turn to its owner's hand.",,,,,,
"Execute: Root Access","1","Execution Front","Card Back","4",,"Until end of turn, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected.",,,,,,
"Execute: Packet Flood","1","Execution Front","Card Back","5",,"Avatars based at the target Server cannot move or retreat until the start of their controller's next turn.",,,,,,
"Execute: Emergency Shutdown","1","Execution Front","Card Back","6",,"End any combat at the target Server immediately. All Avatars there remain and become Disabled until end of turn.",,,,,,
"Execute: Process Clone","1","Execution Front","Card Back","7",,"Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of turn.",,,,,,
"Execute: Rollback","1","Execution Front","Card Back","4",,"Return one Program or Hardware installed at the target Server this command to its owner's hand.",,,,,,
"Execute: Root Access","1","Execution Front","Card Back","4",,"Until end of current command, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected.",,,,,,
"Execute: Packet Flood","1","Execution Front","Card Back","5",,"Avatars based at the target Server cannot move or retreat until the start of their controller's next command.",,,,,,
"Execute: Emergency Shutdown","1","Execution Front","Card Back","6",,"End any combat at the target Server immediately. All Avatars there remain and become Disabled until end of current command.",,,,,,
"Execute: Process Clone","1","Execution Front","Card Back","7",,"Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of current command.",,,,,,
"Execute: Defragment","1","Execution Front","Card Back","4",,"Re-enable one Disabled Program on the target Server, or one Disabled Hardware on an Avatar there.",,,,,,
"Execute: Remote Access","1","Execution Front","Card Back","6",,"Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of turn.",,,,,,
"Execute: Remote Access","1","Execution Front","Card Back","6",,"Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of current command.",,,,,,
"Execute: Purge","1","Execution Front","Card Back","4",,"Remove all Virus/Infection counters and hostile persistent effects from every Avatar you control at the target Server.",,,,,,
"Execute: Hard Reset","1","Execution Front","Card Back","6",,"Uninstall any number of Programs from the target Server you control. For each card returned to your hand this way, recover 1 RAM.",,,,,,
"Turn Sequence","1","Turn Order Front","Card Back",,,"The phases of a single player's turn, in order. Repeat each turn.",,,,,,
1 Name Count Front Template Back Template RAM Cores Description Type Image Expansion Slots Ability Cost Ability Name Ability Description
2 Carbon NanoBots 1 Avatar Front Card Back 2 Nasty little bugs... B nano-bots 4 5 Replicate Avatar may create a copy of itself. Only one copy is allowed at a time. If the copy is defeated the original does not lose any hardware upgrades. If the original is defeated the replicate is as well.
3 Corrupt Driver 1 Avatar Front Card Back 3 V driver-ascii-art 3 4 Driver Fault Choose one Hardware on an enemy Avatar in combat with this Avatar. It is disabled until the end of your next turn. Choose one Hardware on an enemy Avatar in combat with this Avatar. It is disabled until the end of your next command.
4 Pixelated Picture 1 Avatar Front Card Back 3 G pix 3 3 Low Resolution Attacking Avatars have -1 cores against this Avatar.
5 Beta Version 1.0 1 Avatar Front Card Back 4 P beta-version broken-bits 2 4 Push Update While in combat an additional piece of hardware can be placed on this avatar until the end of your turn. If there no ports available this can still be attached. While in combat an additional piece of hardware can be placed on this avatar until the end of your command. If there no ports available this can still be attached.
6 Code Zero 1 Avatar Front Card Back 2 3 V code-zero 4 4 Patient Zero Place an Infection counter on every enemy Avatar in combat at this Server. While this Avatar is in play, an Avatar with 2+ Infection counters has -1 Core. Place an Infection counter on every enemy Avatar in combat at this Server. While this Avatar is in play, an Avatar with 1+ Infection counters has -1 Core.
7 Data Leaker 1 Avatar Front Card Back 3 G data-leaker 3 3 Exfiltrate Look at your opponent's hand and choose one card in it. They must discard that card without gaining RAM. If this Avatar breached a Server this turn, draw a card. Look at your opponent's hand and choose one card in it. They must discard that card without gaining RAM. If this Avatar breached a Server this command, draw a card.
8 Backup Machine 1 Avatar Front Card Back 3 P backup 3 5 Restore Point Return one Hardware or Program from your discard pile to your hand. If it is a Hardware and this Avatar has an open port, you may install it immediately for 2 less RAM.
9 Broken Bits 1 Avatar Front Card Back 4 B broken-bits broken-bits-2 2 4 Bit Flip During a combat at this Server, reroll any number of this Avatar's Core dice.
10 Recursive Infection 1 Program Front Card Back 6 Whenever an enemy Avatar attacks or breaches this Server, place an Infection counter on it. An Avatar with 3+ Infection counters has -1 Core. Whenever an enemy Avatar attacks or breaches this Server, place an Infection counter on it. An Avatar with 3+ Infection counters has -2 Core. V
11 Memory Parasite 1 Program Front Card Back 5 Enemy Avatars attacking this Server have -1 RAM available for Executions. Enemy Avatars attacking this Server have 1 hardware component disabled of the owners choosing. V
12 Replication Routine 1 Program Front Card Back 6 When you install a Virus Program on this Server, you may install a second Virus Program from your hand here for 1 less RAM. When you install a Virus Program on this Server, you may install a second Virus Program from your hand here for no RAM cost. V
13 Resource Leech 1 Program Front Card Back 5 Whenever an enemy Avatar is destroyed while attacking this Server, gain 2 RAM. Whenever an enemy Avatar is destroyed while attacking this Server, gain 5 RAM. V
14 Worm Protocol 1 Program Front Card Back 4 The localized effects of your other Programs on this Server also apply at one adjacent Server you choose when this is installed. V
15 Payload Injector 1 Program Front Card Back 6 The first Execution you play targeting this Server each turn costs 1 less RAM. The first Execution you play targeting this Server each round costs 2 less RAM. V
16 Persistent Infection 1 Program Front Card Back 6 If this Server stops being under your control, keep this Program installed here; its effect now applies to every Avatar at that Server regardless of controller. If an Avatar is defeated at this Server, place an Infection Counter on it permanently. V
17 Infinite Loop 1 Program Front Card Back 5 The first enemy Avatar to attack this Server each turn is caught in a loop: if it survives the battle, it must immediately repeat its attack once. Gain 1 RAM. If the attacking Avatar is controlled by the owner of this Program, it may attack a second adjacent Server in the same command. B
18 Stack Overflow 1 Program Front Card Back 7 Avatars you control defending this Server gain +1 Core for each Program installed on this Server (including this one). B
19 Race Condition 1 Program Front Card Back 4 During any combat at this Server, both players secretly choose Attack or Defend. If the choices differ, the defender gains a combat bonus. During any combat at this Server, both players secretly choose Attack or Defend. If the choices differ, the defender gains a combat bonus of +2 Cores. B
20 Memory Leak 1 Program Front Card Back 6 At the start of any combat at this Server, the attacking Avatar loses 1 RAM for each Hardware installed on it. At the start of any combat at this Server, the attacking Avatar loses 1 Core for each Hardware installed on it. B
21 Null Pointer 1 Program Front Card Back 5 Once per turn, when an enemy Execution would resolve at this Server, resolve the game's uncertainty mechanic. On success, it does nothing. Once per round, when an enemy Execution would resolve at this Server, it's effect does not occur. B
22 Deadlock Stock Rice 1 Program Front Card Back 4 Neither Avatar in a combat that takes place at this Server may retreat until that combat resolves. Neither Avatar in a combat that takes place at this Server may use any Hardware bonuses. B
23 Overflow Error 1 Program Front Card Back 5 When an enemy Avatar is destroyed while attacking this Server, destroy or disable one Hardware or Program that Avatar's controller has in play. When an enemy Avatar is destroyed while attacking this Server, destroy or disable one Program that Avatar's controller has in play. B
24 Undefined Behavior 1 Program Front Card Back 8 Once per turn, copy the localized effect of another Program on this Server. Then disable this Program until your next turn. Once per round, copy the localized effect of another Program on another Server. Then disable this Program until your next command. B
25 Packet Loss 1 Program Front Card Back 6 When an enemy successfully breaches this Server, its controller discards a card at random. G
26 Desynchronization 1 Program Front Card Back 5 Enemy Avatars attacking this Server cannot use their Hardware's "once per turn" abilities during that combat. Enemy Avatars attacking this Server cannot use their Hardware's "once per round" abilities during that combat. G
27 Visual Artifact 1 Program Front Card Back 5 The first attack made against an Avatar you control at this Server each turn suffers -1 Core. The first attack made against an Avatar you control at this Server suffers -1 Core. G
28 Ghost Process 1 Program Front Card Back 6 Your Executions played targeting this Server may also affect Avatars, Programs, and Hardware at one adjacent Server. G
29 False Positive 1 Program Front Card Back 7 When an enemy Execution targets an Avatar you control at this Server, you may redirect it to another legal Avatar at this Server. When an enemy Execution targets an Avatar you control at this Server, you may redirect it to another legal Avatar at another Server. G
30 Fragmentation 1 Program Front Card Back 6 Executions your opponents play targeting this Server cost +1 RAM. Executions your opponents play targeting this Server cost +2 RAM. G
31 Latency Spike 1 Program Front Card Back 5 The attacking player cannot play Executions during the first step of any combat at this Server. G
32 Hotfix 1 Program Front Card Back 7 The first Program on this Server that would be destroyed each turn is instead disabled until your next turn. The first Program on this Server that would be destroyed each round is instead disabled until your next command. P
33 Error Correction 1 Program Front Card Back 5 At the beginning of your turn, remove one negative counter or status from each Avatar you control at this Server. At the beginning of your first command each round, remove one negative counter or status from each Avatar you control at this Server. P
34 Garbage Collection 1 Program Front Card Back 6 Once per turn, sacrifice one Program installed on this Server to recover its printed RAM value. Once per round, sacrifice one Program installed on this Server to recover its printed RAM value. P
35 Version Control 1 Program Front Card Back 5 When a Program on this Server would be destroyed, or when this Server is captured, return one Program from this Server to your hand instead of discarding it. P
36 Rollback Routine 1 Program Front Card Back 4 Once per turn, undo the most recent temporary stat reduction applied to an Avatar you control at this Server. Once per round, undo the most recent temporary stat reduction applied to an Avatar you control at this Server. P
37 Compatibility Layer 1 Program Front Card Back 6 This Server may hold one additional Program beyond the normal limit, and Patch Programs installed here cost 1 less RAM. This Server may hold one additional Program beyond the normal limit, and Patch Programs installed here cost 2 less RAM. P
38 RAM Expansion 1 Hardware Front Card Back 5 Avatar gains +2 RAM capacity. Avatar gains +2 Core capacity.
39 Additional Core 1 Hardware Front Card Back 5 Avatar gains +1 Core.
40 Overclocked CPU 1 Hardware Front Card Back 6 Avatar gains +2 Cores during combat, but one installed Program becomes disabled afterward. Avatar gains +2 Cores during combat, but one installed Program at the current server becomes disabled afterward for 2 commands.
41 Solid-State Cache 1 Hardware Front Card Back 6 The first Program installed on this Avatar each turn costs 1 less RAM. The first Program installed on the occupied Server each round costs 3 less RAM.
42 Redundant Power Supply 1 Hardware Front Card Back 8 The first time this Avatar would be destroyed, destroy this Hardware instead and leave the Avatar active. The first time this Avatar would be destroyed, do not destroy the Hardware.
43 Network Interface Upgrade 1 Hardware Front Card Back 4 Moving between adjacent Servers costs 1 less resource or may occur once per turn for free. This Hardware can be played without taking an upgrade port on the Avatar.
44 Dedicated GPU 1 Hardware Front Card Back 6 Executions performed by this Avatar receive +1 effectiveness or combat strength.
45 ECC Memory 1 Hardware Front Card Back 5 Opponents cannot place Bug counters or Bug status effects on this Avatar.
46 Cooling System 1 Hardware Front Card Back 6 Prevent penalties caused by Overclocking Hardware or allow one Hardware to activate twice per turn. Allow one Hardware to activate twice per round.
47 RAID Array 1 Hardware Front Card Back 5 When a Program on this Avatar is destroyed, resolve the game's uncertainty mechanic. On success, return it to your hand. When this Avatar is destroyed, all hardware can be kept by paying half the RAM cost.
48 Packet Accelerator 1 Hardware Front Card Back 4 This Avatar acts first when it initiates combat. This Avatar gains +1 Core hen attacking.
49 Firewall Appliance 1 Hardware Front Card Back 6 The first hostile Program or Execution targeting this Avatar each turn costs the opponent +1 RAM. The first hostile Program or Execution targeting this Avatar each round costs the opponent +3 RAM.
50 Hardware Sandbox 1 Hardware Front Card Back 7 Choose one Program installed on this Avatar. It cannot be targeted by opponents. Choose one Program installed on the occupied Server. It cannot be targeted by opponents.
51 Diagnostic Module 1 Hardware Front Card Back 4 Look at one facedown or hidden card associated with an opposing Avatar or Server once per turn. Look at one face down card in your draw pile. You may place it at the bottom and draw another to start your first command each round.
52 Hot-Swap Bay 1 Hardware Front Card Back 6 Once per turn, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost. Once per round, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost.
53 Quantum Coprocessor 1 Hardware Front Card Back 9 Once per turn when this Avatar uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware until your next turn. Once per round when this Avatar uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware.
54 High Efficiency RAM Server 1 Server Front Card Back Add additional 4 RAM to resource total
55 MultiCore Server 1 Server Front Card Back Add 2 Cores to any Avatars
56 Cluster Server 1 Server Front Card Back Up to 2 Avatars can defend this Server
66 Callable Server 1 Server Front Card Back When drawing a card, you may choose to place it on the bottom of the deck and draw another
67 Execute: Disconnect 1 Execution Front Card Back 4 Move one Avatar you control at the target Server to an adjacent Server, removing it from any combat there.
68 Execute: Sabotage 1 Execution Front Card Back 7 Destroy or disable one Hardware on an enemy Avatar in combat at the target Server.
69 Execute: Kill Process 1 Execution Front Card Back 5 Disable one Program installed on the target Server until its controller's next turn. Disable one Program installed on the target Server until its controller's next command.
70 Execute: Force Reboot 1 Execution Front Card Back 5 Remove all temporary bonuses and penalties from one Avatar you control at the target Server, or one Avatar attacking it. That Avatar cannot play another Execution this turn. Remove all temporary bonuses and penalties from one Avatar you control at the target Server, or one Avatar attacking it. That Avatar cannot play another Execution until end of current command.
71 Execute: Fork 1 Execution Front Card Back 7 Copy the localized effect of one Program installed on the target Server until end of turn. Copy the localized effect of one Program installed on the target Server until end of current command.
72 Execute: Ping Sweep 1 Execution Front Card Back 4 Look at all Programs and Hardware attached to the target Server and to every Avatar based at or attacking it, then draw a card. You may draw 2 cards from the top of your deck.
73 Execute: Trace Route 1 Execution Front Card Back 5 Move one Avatar you control from an adjacent Server to the target Server. If the target Server is enemy-controlled, your Avatar attacks it with +1 Core for the resulting combat.
74 Execute: Override 1 Execution Front Card Back 5 Choose one enemy Program installed on the target Server. Ignore its text until the end of turn. Choose one enemy Program installed on the target Server. Ignore its text until end of current command.
75 Execute: Memory Dump 1 Execution Front Card Back 4 Draw 2 cards, then discard 1. If you control the target Server, draw 1 extra card instead of discarding.
76 Execute: Rollback 1 Execution Front Card Back 4 Return one Program or Hardware installed at the target Server this turn to its owner's hand. Return one Program or Hardware installed at the target Server this command to its owner's hand.
77 Execute: Root Access 1 Execution Front Card Back 4 Until end of turn, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected. Until end of current command, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected.
78 Execute: Packet Flood 1 Execution Front Card Back 5 Avatars based at the target Server cannot move or retreat until the start of their controller's next turn. Avatars based at the target Server cannot move or retreat until the start of their controller's next command.
79 Execute: Emergency Shutdown 1 Execution Front Card Back 6 End any combat at the target Server immediately. All Avatars there remain and become Disabled until end of turn. End any combat at the target Server immediately. All Avatars there remain and become Disabled until end of current command.
80 Execute: Process Clone 1 Execution Front Card Back 7 Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of turn. Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of current command.
81 Execute: Defragment 1 Execution Front Card Back 4 Re-enable one Disabled Program on the target Server, or one Disabled Hardware on an Avatar there.
82 Execute: Remote Access 1 Execution Front Card Back 6 Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of turn. Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of current command.
83 Execute: Purge 1 Execution Front Card Back 4 Remove all Virus/Infection counters and hostile persistent effects from every Avatar you control at the target Server.
84 Execute: Hard Reset 1 Execution Front Card Back 6 Uninstall any number of Programs from the target Server you control. For each card returned to your hand this way, recover 1 RAM.
85 Turn Sequence 1 Turn Order Front Card Back The phases of a single player's turn, in order. Repeat each turn.

View file

@ -0,0 +1,250 @@
/* ======================================================
Server card — full-bleed cyber HUD node
Matches the Avatar frame: full-bleed art, neon HUD, corner
badges. Server identity = green accent + rack-glyph badge.
====================================================== */
.card {
position: relative;
width: 750px;
height: 1050px;
box-sizing: border-box;
padding: 0;
overflow: hidden;
font-family: "Consolas", "Courier New", monospace;
background: #060a0f;
--accent: #39d353;
--accent-dk: #157f31;
--chamfer: 22px;
}
/* ----- Full-bleed art ----- */
.art {
position: absolute;
inset: 0;
z-index: 0;
image-rendering: pixelated;
background-color: #ffffff;
background-image: url({{index assets card.image}});
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
/* cinematic tint: accent top-corner light, cool counter-light, dark bottom for text */
.tint {
position: absolute;
inset: 0;
z-index: 1;
pointer-events: none;
background:
radial-gradient(70% 45% at 100% 0%, var(--accent) 0%, transparent 55%),
radial-gradient(60% 40% at 0% 8%, rgba(40,150,255,0.22) 0%, transparent 60%),
linear-gradient(180deg, rgba(3,6,9,0.55) 0%, rgba(3,6,9,0) 22%, rgba(3,6,9,0) 40%, rgba(3,6,9,0.78) 72%, rgba(3,6,9,0.96) 100%);
opacity: 0.9;
}
/* ----- Angular neon HUD frame (open chamfered corners) ----- */
.neon {
position: absolute;
inset: 13px;
z-index: 40;
pointer-events: none;
border: 3px solid var(--accent);
clip-path: polygon(
var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer),
100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%,
var(--chamfer) 100%, 0 calc(100% - var(--chamfer)), 0 var(--chamfer)
);
box-shadow: 0 0 16px var(--accent), 0 0 6px var(--accent), inset 0 0 16px rgba(0,0,0,0.4);
}
.tick {
position: absolute;
z-index: 41;
width: 30px;
height: 3px;
background: var(--accent);
box-shadow: 0 0 8px var(--accent);
}
.tick.tl { top: 27px; left: 5px; transform: rotate(45deg); }
.tick.tr { top: 27px; right: 5px; transform: rotate(-45deg); }
/* ----- Top-left: server-rack badge ----- */
.rack-badge {
position: absolute;
z-index: 5;
top: 28px;
left: 28px;
width: 116px;
height: 116px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 9px;
border-radius: 12px;
background: linear-gradient(160deg, #2a2f36 0%, #14181d 100%);
border: 2px solid var(--accent-dk);
box-shadow: 0 0 16px var(--accent), inset 0 0 10px rgba(0,0,0,0.75), 0 3px 6px rgba(0,0,0,0.6);
}
.rack-badge .u {
width: 80px;
height: 20px;
border-radius: 3px;
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 7px;
background: linear-gradient(180deg, #20242b 0%, #14171c 100%);
border: 1px solid #0a0b0e;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.rack-badge .u::after {
content: "";
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--accent);
box-shadow: 0 0 6px var(--accent);
}
/* SRV glyph under the rack badge (mirrors avatar type glyph) */
.srvchip {
position: absolute;
z-index: 5;
top: 152px;
left: 40px;
width: 92px;
height: 46px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-weight: 800;
letter-spacing: 3px;
color: #05070a;
clip-path: polygon(10% 0, 100% 0, 100% 78%, 90% 100%, 0 100%, 0 22%);
background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dk) 100%);
box-shadow: 0 0 14px var(--accent);
}
/* ----- Top-right: unit tab ----- */
.unit-tab {
position: absolute;
z-index: 5;
top: 34px;
right: 30px;
padding: 10px 22px 10px 30px;
font-size: 24px;
font-weight: 800;
letter-spacing: 4px;
color: #05070a;
clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dk) 100%);
box-shadow: 0 0 14px var(--accent);
}
/* status badge (mirrors avatar ports slot) */
.status {
position: absolute;
z-index: 5;
top: 34px;
left: 40px;
width: 140px;
height: 72px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
clip-path: polygon(10% 0, 100% 0, 100% 76%, 90% 100%, 0 100%, 0 24%);
background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dk) 100%);
box-shadow: 0 0 16px var(--accent);
}
.status::before {
content: "";
position: absolute;
inset: 3px;
clip-path: polygon(10% 0, 100% 0, 100% 76%, 90% 100%, 0 100%, 0 24%);
background: linear-gradient(160deg, #12181f 0%, #0a0e13 100%);
}
.status .leds { position: relative; z-index: 1; display: flex; gap: 12px; }
.status .led {
width: 14px;
height: 14px;
border-radius: 50%;
box-shadow: 0 0 8px currentColor, inset 0 0 3px rgba(0,0,0,0.4);
}
.status .led.green { background: #39d353; color: #39d353; }
.status .led.amber { background: #f0a92b; color: #f0a92b; }
.status i {
position: relative;
z-index: 1;
font-style: normal;
font-size: 15px;
font-weight: 800;
letter-spacing: 3px;
color: var(--accent);
}
/* ----- Edge micro-text ----- */
.vcode {
position: absolute;
z-index: 5;
left: 22px;
bottom: 300px;
writing-mode: vertical-rl;
transform: rotate(180deg);
font-size: 15px;
font-weight: 700;
letter-spacing: 3px;
color: rgba(230,240,235,0.55);
}
.vcredit {
position: absolute;
z-index: 5;
right: 22px;
top: 190px;
writing-mode: vertical-rl;
font-size: 15px;
font-weight: 700;
letter-spacing: 3px;
color: rgba(230,240,235,0.5);
}
/* ----- Lower content panel ----- */
.lower {
position: absolute;
z-index: 5;
left: 50px;
right: 30px;
bottom: 44px;
}
.name {
margin: 0 0 16px;
padding-bottom: 14px;
border-bottom: 2px solid var(--accent);
box-shadow: 0 2px 12px -6px var(--accent);
font-size: 44px;
font-weight: 800;
letter-spacing: 1px;
line-height: 1.04;
text-transform: uppercase;
color: #ffffff;
text-shadow: 0 0 16px rgba(0,0,0,0.9), 0 3px 6px #000;
}
.desc {
padding: 16px 18px;
min-height: 96px;
font-size: 23px;
line-height: 1.4;
color: #e8f6ec;
background: linear-gradient(180deg, rgba(4,9,7,0.86) 0%, rgba(4,9,7,0.92) 100%);
border-left: 3px solid var(--accent);
box-shadow: inset 0 0 26px rgba(0,0,0,0.5);
}
.desc .sys {
color: var(--accent);
font-weight: 800;
margin-right: 6px;
}

View file

@ -0,0 +1,37 @@
<!--
Server-Front template — full-bleed cyber HUD node (matches the Avatar family)
Card size: 750 x 1050 px (2.5in x 3.5in @ 300 DPI)
Attributes: {{card.name}} {{card.image}} {{card.description}} (Servers have no RAM/Cores)
Green signature accent. Server identity: rack-glyph badge + status LEDs.
-->
<div class="card">
<!-- Full-bleed art + cinematic tint -->
<div class="art"></div>
<div class="tint"></div>
<div class="scan"></div>
<!-- Angular neon HUD frame -->
<div class="neon"></div>
<span class="tick tl"></span>
<span class="tick tr"></span>
<!-- Top-right: unit tab + status badge -->
<div class="unit-tab">SERVER</div>
<div class="status">
<span class="leds"><i class="led green"></i><i class="led amber"></i></span>
<i>ONLINE</i>
</div>
<!-- Edge micro-text -->
<div class="vcode">FILES-TCG · SD01</div>
<div class="vcredit">SERVER NODE</div>
<!-- Lower content panel -->
<div class="lower">
<h1 class="name">{{card.name}}</h1>
<div class="desc"><span class="sys">SYS &gt;</span> {{card.description}}</div>
</div>
</div>

View file

@ -50,17 +50,7 @@
overflow: hidden;
}
/* CRT scanline + phosphor glow overlay */
.scanlines {
position: absolute;
inset: 0;
z-index: 4;
pointer-events: none;
border-radius: 16px;
background:
repeating-linear-gradient(0deg, rgba(0,0,0,0.20) 0 2px, transparent 2px 4px),
radial-gradient(120% 80% at 50% 40%, rgba(255,176,46,0.06) 0%, transparent 70%);
}
/* ----- Terminal top bar ----- */
.term-bar {
@ -149,7 +139,7 @@
height: 100%;
display: block;
image-rendering: pixelated;
background-color: #020202;
background-color: #ffffff;
background-image: url({{index assets card.image}});
background-position: center;
background-size: cover;

View file

@ -222,6 +222,7 @@
position: absolute;
inset: 0;
image-rendering: pixelated;
background-color: #ffffff;
background-image: url({{index assets card.image}});
background-position: center;
background-size: cover;

View file

@ -173,18 +173,13 @@
height: 100%;
display: block;
image-rendering: pixelated;
background-color: #020405;
background-color: #ffffff;
background-image: url({{index assets card.image}});
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.scan {
position: absolute;
inset: 0;
pointer-events: none;
background: repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 2px, transparent 2px 4px);
}
/* ----- Console output / description ----- */
.console {

View file

@ -0,0 +1,250 @@
/* ======================================================
Server card — full-bleed cyber HUD node
Matches the Avatar frame: full-bleed art, neon HUD, corner
badges. Server identity = green accent + rack-glyph badge.
====================================================== */
.card {
position: relative;
height: 750px;
width: 1050px;
box-sizing: border-box;
padding: 0;
overflow: hidden;
font-family: "Consolas", "Courier New", monospace;
background: #060a0f;
--accent: #39d353;
--accent-dk: #157f31;
--chamfer: 22px;
}
/* ----- Full-bleed art ----- */
.art {
position: absolute;
inset: 0;
z-index: 0;
image-rendering: pixelated;
background-color: #ffffff;
background-image: url({{index assets card.image}});
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
/* cinematic tint: accent top-corner light, cool counter-light, dark bottom for text */
.tint {
position: absolute;
inset: 0;
z-index: 1;
pointer-events: none;
background:
radial-gradient(70% 45% at 100% 0%, var(--accent) 0%, transparent 55%),
radial-gradient(60% 40% at 0% 8%, rgba(40,150,255,0.22) 0%, transparent 60%),
linear-gradient(180deg, rgba(3,6,9,0.55) 0%, rgba(3,6,9,0) 22%, rgba(3,6,9,0) 40%, rgba(3,6,9,0.78) 72%, rgba(3,6,9,0.96) 100%);
opacity: 0.9;
}
/* ----- Angular neon HUD frame (open chamfered corners) ----- */
.neon {
position: absolute;
inset: 13px;
z-index: 40;
pointer-events: none;
border: 3px solid var(--accent);
clip-path: polygon(
var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer),
100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%,
var(--chamfer) 100%, 0 calc(100% - var(--chamfer)), 0 var(--chamfer)
);
box-shadow: 0 0 16px var(--accent), 0 0 6px var(--accent), inset 0 0 16px rgba(0,0,0,0.4);
}
.tick {
position: absolute;
z-index: 41;
width: 30px;
height: 3px;
background: var(--accent);
box-shadow: 0 0 8px var(--accent);
}
.tick.tl { top: 27px; left: 5px; transform: rotate(45deg); }
.tick.tr { top: 27px; right: 5px; transform: rotate(-45deg); }
/* ----- Top-left: server-rack badge ----- */
.rack-badge {
position: absolute;
z-index: 5;
top: 28px;
left: 28px;
width: 116px;
height: 116px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 9px;
border-radius: 12px;
background: linear-gradient(160deg, #2a2f36 0%, #14181d 100%);
border: 2px solid var(--accent-dk);
box-shadow: 0 0 16px var(--accent), inset 0 0 10px rgba(0,0,0,0.75), 0 3px 6px rgba(0,0,0,0.6);
}
.rack-badge .u {
width: 80px;
height: 20px;
border-radius: 3px;
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 7px;
background: linear-gradient(180deg, #20242b 0%, #14171c 100%);
border: 1px solid #0a0b0e;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.rack-badge .u::after {
content: "";
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--accent);
box-shadow: 0 0 6px var(--accent);
}
/* SRV glyph under the rack badge (mirrors avatar type glyph) */
.srvchip {
position: absolute;
z-index: 5;
top: 152px;
left: 40px;
width: 92px;
height: 46px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-weight: 800;
letter-spacing: 3px;
color: #05070a;
clip-path: polygon(10% 0, 100% 0, 100% 78%, 90% 100%, 0 100%, 0 22%);
background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dk) 100%);
box-shadow: 0 0 14px var(--accent);
}
/* ----- Top-right: unit tab ----- */
.unit-tab {
position: absolute;
z-index: 5;
top: 34px;
right: 30px;
padding: 10px 22px 10px 30px;
font-size: 24px;
font-weight: 800;
letter-spacing: 4px;
color: #05070a;
clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dk) 100%);
box-shadow: 0 0 14px var(--accent);
}
/* status badge (mirrors avatar ports slot) */
.status {
position: absolute;
z-index: 5;
top: 34px;
left: 40px;
width: 140px;
height: 72px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
clip-path: polygon(10% 0, 100% 0, 100% 76%, 90% 100%, 0 100%, 0 24%);
background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dk) 100%);
box-shadow: 0 0 16px var(--accent);
}
.status::before {
content: "";
position: absolute;
inset: 3px;
clip-path: polygon(10% 0, 100% 0, 100% 76%, 90% 100%, 0 100%, 0 24%);
background: linear-gradient(160deg, #12181f 0%, #0a0e13 100%);
}
.status .leds { position: relative; z-index: 1; display: flex; gap: 12px; }
.status .led {
width: 14px;
height: 14px;
border-radius: 50%;
box-shadow: 0 0 8px currentColor, inset 0 0 3px rgba(0,0,0,0.4);
}
.status .led.green { background: #39d353; color: #39d353; }
.status .led.amber { background: #f0a92b; color: #f0a92b; }
.status i {
position: relative;
z-index: 1;
font-style: normal;
font-size: 15px;
font-weight: 800;
letter-spacing: 3px;
color: var(--accent);
}
/* ----- Edge micro-text ----- */
.vcode {
position: absolute;
z-index: 5;
left: 22px;
bottom: 300px;
writing-mode: vertical-rl;
transform: rotate(180deg);
font-size: 15px;
font-weight: 700;
letter-spacing: 3px;
color: rgba(230,240,235,0.55);
}
.vcredit {
position: absolute;
z-index: 5;
right: 22px;
top: 190px;
writing-mode: vertical-rl;
font-size: 15px;
font-weight: 700;
letter-spacing: 3px;
color: rgba(230,240,235,0.5);
}
/* ----- Lower content panel ----- */
.lower {
position: absolute;
z-index: 5;
left: 50px;
right: 30px;
bottom: 44px;
}
.name {
margin: 0 0 16px;
padding-bottom: 14px;
border-bottom: 2px solid var(--accent);
box-shadow: 0 2px 12px -6px var(--accent);
font-size: 44px;
font-weight: 800;
letter-spacing: 1px;
line-height: 1.04;
text-transform: uppercase;
color: #ffffff;
text-shadow: 0 0 16px rgba(0,0,0,0.9), 0 3px 6px #000;
}
.desc {
padding: 16px 18px;
min-height: 96px;
font-size: 23px;
line-height: 1.4;
color: #e8f6ec;
background: linear-gradient(180deg, rgba(4,9,7,0.86) 0%, rgba(4,9,7,0.92) 100%);
border-left: 3px solid var(--accent);
box-shadow: inset 0 0 26px rgba(0,0,0,0.5);
}
.desc .sys {
color: var(--accent);
font-weight: 800;
margin-right: 6px;
}

View file

@ -0,0 +1,37 @@
<!--
Server-Front template — full-bleed cyber HUD node (matches the Avatar family)
Card size: 750 x 1050 px (2.5in x 3.5in @ 300 DPI)
Attributes: {{card.name}} {{card.image}} {{card.description}} (Servers have no RAM/Cores)
Green signature accent. Server identity: rack-glyph badge + status LEDs.
-->
<div class="card">
<!-- Full-bleed art + cinematic tint -->
<div class="art"></div>
<div class="tint"></div>
<div class="scan"></div>
<!-- Angular neon HUD frame -->
<div class="neon"></div>
<span class="tick tl"></span>
<span class="tick tr"></span>
<!-- Top-right: unit tab + status badge -->
<div class="unit-tab">SERVER</div>
<div class="status">
<span class="leds"><i class="led green"></i><i class="led amber"></i></span>
<i>ONLINE</i>
</div>
<!-- Edge micro-text -->
<div class="vcode">FILES-TCG · SD01</div>
<div class="vcredit">SERVER NODE</div>
<!-- Lower content panel -->
<div class="lower">
<h1 class="name">{{card.name}}</h1>
<div class="desc"><span class="sys">SYS &gt;</span> {{card.description}}</div>
</div>
</div>

View file

@ -24,7 +24,7 @@
inset: 0;
z-index: 0;
image-rendering: pixelated;
background-color: #060a0f;
background-color: #ffffff;
background-image: url({{index assets card.image}});
background-position: center;
background-size: cover;
@ -42,14 +42,7 @@
linear-gradient(180deg, rgba(3,6,9,0.55) 0%, rgba(3,6,9,0) 22%, rgba(3,6,9,0) 40%, rgba(3,6,9,0.78) 72%, rgba(3,6,9,0.96) 100%);
opacity: 0.9;
}
.scan {
position: absolute;
inset: 0;
z-index: 1;
pointer-events: none;
opacity: 0.5;
background: repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0 2px, transparent 2px 4px);
}
/* ----- Angular neon HUD frame (open chamfered corners) ----- */
.neon {

View file

@ -1,5 +1,5 @@
/* ======================================================
Turn Order card — turn-sequence reference
Turn Order card — round and command reference (rules v0.8)
Signature accent: cyan (distinct from all other cards).
====================================================== */
@ -103,7 +103,7 @@
.cmdline {
position: relative;
z-index: 2;
margin: 20px 24px 0;
margin: 18px 24px 0;
font-size: 24px;
font-weight: 700;
letter-spacing: 1px;
@ -116,12 +116,92 @@
.cmdline .cwd { color: #a9d9e0; }
.cmdline .cmd { color: #f2feff; margin-left: 10px; }
/* ----- Phase list ----- */
/* ----- Section labels ----- */
.label {
font-size: 20px;
font-weight: 700;
letter-spacing: 2px;
text-transform: uppercase;
color: #6f8a90;
}
/* ----- Boxed panels (order, round start) ----- */
.panel {
position: relative;
z-index: 2;
margin: 12px 26px 0;
padding: 12px 18px 14px;
border: 2px dashed var(--accent-dk);
border-radius: 10px;
background: rgba(34,211,238,0.04);
}
.panel .label { margin-bottom: 10px; }
/* Snake order: one row per round parity, one chip per command */
.order {
display: flex;
align-items: center;
gap: 12px;
}
.order + .order { margin-top: 10px; }
.rnd {
flex: none;
width: 190px;
font-size: 24px;
font-weight: 800;
letter-spacing: 1px;
color: #a9d9e0;
}
.chip {
flex: 1;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
font-size: 26px;
font-weight: 800;
letter-spacing: 1px;
}
.chip.p1 {
color: #05080a;
background: var(--accent);
box-shadow: 0 0 10px rgba(34,211,238,0.5);
}
.chip.p2 {
color: var(--accent);
border: 3px solid var(--accent);
box-sizing: border-box;
}
/* Round-start actions */
.tags {
display: flex;
gap: 14px;
}
.tag {
flex: 1;
padding: 8px 10px;
border-radius: 8px;
text-align: center;
font-size: 26px;
font-weight: 700;
color: #eafcff;
background: rgba(34,211,238,0.12);
border: 2px solid var(--accent-dk);
}
/* ----- Phase list (steps of one command) ----- */
.steps-label {
position: relative;
z-index: 2;
margin: 14px 30px 0;
}
.phases {
position: relative;
z-index: 2;
list-style: none;
margin: 26px 26px 0;
margin: 8px 26px 0;
padding: 0;
}
.phases li {
@ -129,31 +209,31 @@
display: flex;
align-items: center;
gap: 22px;
padding: 14px 18px;
min-height: 78px;
padding: 2px 18px;
min-height: 54px;
box-sizing: border-box;
}
.phases li + li { margin-top: 12px; }
.phases li + li { margin-top: 6px; }
/* flow connector between step badges */
.phases li:not(:last-child)::before {
content: "";
position: absolute;
left: 45px; /* center of the 54px badge (18px pad + 27) */
top: 78px;
height: 24px;
left: 43px; /* center of the 50px badge (18px pad + 25) */
top: 52px; /* from one badge's bottom to the next one's top */
height: 10px;
width: 3px;
background: var(--accent-dk);
box-shadow: 0 0 6px rgba(34,211,238,0.4);
}
.num {
flex: none;
width: 54px;
height: 54px;
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
font-size: 30px;
font-size: 28px;
font-weight: 800;
color: #05080a;
background: var(--accent);
@ -162,12 +242,34 @@
}
.step {
flex: 1;
font-size: 30px;
font-size: 28px;
font-weight: 700;
line-height: 1.15;
color: #eafcff;
text-shadow: 0 1px 2px #000;
}
.step em {
font-style: normal;
font-size: 22px;
color: #a9d9e0;
}
/* ----- The limits strip ----- */
.limits {
position: relative;
z-index: 2;
margin: 14px 26px 0;
padding: 10px 18px;
border-left: 5px solid var(--accent);
background: rgba(34,211,238,0.07);
font-size: 24px;
font-weight: 700;
line-height: 1.35;
letter-spacing: 1px;
text-transform: uppercase;
color: #eafcff;
}
.limits b { color: var(--accent); }
/* ----- Status bar footer ----- */
.statusbar {

View file

@ -1,7 +1,7 @@
<!--
Turn-Order-Front template — turn-sequence reference card
Turn-Order-Front template — round and command reference card (rules v0.8)
Card size: 750 x 1050 px (2.5in x 3.5in @ 300 DPI)
Static rules card: the 7 phases are fixed; only the title is data-driven ({{card.name}}).
Static rules card: the order and steps are fixed; only the title is data-driven ({{card.name}}).
Signature accent: cyan.
-->
<div class="card">
@ -17,24 +17,51 @@
<!-- Command line -->
<div class="cmdline">
<span class="user">turn</span><span class="punc">@</span><span class="cwd">files</span><span class="punc">:</span>
<span class="cmd">run --phases 1..7</span>
<span class="user">round</span><span class="punc">@</span><span class="cwd">files</span><span class="punc">:</span>
<span class="cmd">run --commands 2 --each</span>
</div>
<!-- Phase list -->
<!-- Command order: snake -->
<div class="panel">
<div class="label">// command order · P1 goes first</div>
<div class="order">
<span class="rnd">RND 1·3·5</span>
<span class="chip p1">P1</span><span class="chip p2">P2</span><span class="chip p2">P2</span><span class="chip p1">P1</span>
</div>
<div class="order">
<span class="rnd">RND 2·4·6</span>
<span class="chip p2">P2</span><span class="chip p1">P1</span><span class="chip p1">P1</span><span class="chip p2">P2</span>
</div>
</div>
<!-- Round start -->
<div class="panel">
<div class="label">// your first command each round</div>
<div class="tags">
<span class="tag">Draw a Card</span>
<span class="tag">Refresh Avatars</span>
</div>
</div>
<!-- Steps of one command -->
<div class="label steps-label">// each command</div>
<ol class="phases">
<li><span class="num">1</span><span class="step">Draw Card</span></li>
<li><span class="num">2</span><span class="step">Place Avatars</span></li>
<li><span class="num">3</span><span class="step">Play Cards from Hand</span></li>
<li><span class="num">4</span><span class="step">Attack</span></li>
<li><span class="num">5</span><span class="step">Resolve Attack, Movement &amp; Server Placement</span></li>
<li><span class="num">6</span><span class="step">Play Additional Cards from Hand</span></li>
<li><span class="num">7</span><span class="step">Pass Turn</span></li>
<li><span class="num">1</span><span class="step">Place Avatars, then Advance One</span></li>
<li><span class="num">2</span><span class="step">Play Cards from Hand</span></li>
<li><span class="num">3</span><span class="step">Attack with One <em>(if no advance)</em></span></li>
<li><span class="num">4</span><span class="step">Resolve Right Away</span></li>
<li><span class="num">5</span><span class="step">Play Additional Cards</span></li>
</ol>
<!-- The limits -->
<div class="limits">
<div>1 advance <b>or</b> 1 attack per command</div>
<div>each Avatar acts once per round</div>
</div>
<!-- Status bar footer -->
<div class="statusbar">
<span class="loop">↺ REPEAT EACH TURN</span>
<span class="loop">↺ 2 COMMANDS EACH ROUND</span>
<span class="model">FILES-TCG · TURN ORDER</span>
</div>

413
rules.md Normal file
View file

@ -0,0 +1,413 @@
# Files TCG Rules
*Draft v0.8 — 2026-09-28.* The basic game rules are complete. v0.8 replaces whole turns with
[rounds of alternating commands](#rounds-and-commands). Card text and stats come from
`decks/files-deck-1/cards.csv` (`cards.md` is out of date). [Card Rules](#card-rules) says how card
text is read; readings marked ⚠ are the simulator's guesses and are listed in
[Open Questions](#open-questions).
## Winning
The first player to control **10 Server locations** wins. Starting Servers don't count, so that's
10 of the 13 grid locations. The win is checked as soon as a capture resolves.
## Deck Construction
Each player brings:
- **4 Avatars**
- **20 Servers**
- **45 cards**: any mix of Executions, Hardware and Programs
A deck can hold at most **2 copies** of any one card.
## Setup
1. Shuffle your 4 Avatars and place them face down in your 4 Avatar slots (the ✚ icons), numbered 1–4.
2. Shuffle your Servers face down into your Server pile.
3. Shuffle your 45 cards face down into your Deck.
4. Place 1 Server from your pile face down on your starting Server (the ■ icon). Reveal it when the
game starts; its ability applies.
5. Draw 7 cards.
6. Start with **4 RAM**. This is the capture payout for your starting Server, not an extra 4.
7. Flip Avatar 1 face up. It is available from the start.
The first player is chosen at random. They take the first command of round 1 and skip their draw in
round 1.
## The Playmat
Each player's starting Server (`S1` for the South player, `S2` for the North player) connects to a
13-location grid. Two locations are **adjacent** if a single line connects them directly and that
line isn't blocked by a [Firewall](#firewalls).
```
S2 North start
|
E1 -----o------ E2 -----o----- E3
\ / \ /
o o o o
\ / \ /
D1 D2
/ \ / \
o o o o
/ \ / \
C1 C2 C3
\ / \ /
o o o o
\ / \ /
B1 B2
/ \ / \
o o o o
/ \ / \
A1 -----o------ A2 -----o----- A3
|
S1 South start
```
`o` = gateway (20 in total), where Firewalls are placed. The two lines out of the starts (`S1–A2`
and `E2–S2`) have no gateways, so they can never be firewalled. A2 and E2 don't connect to C2.
### Adjacency
| Location | Adjacent to |
|---|---|
| S1 | A2 |
| A1 | A2, B1 |
| A2 | S1, A1, A3, B1, B2 |
| A3 | A2, B2 |
| B1 | A1, A2, C1, C2 |
| B2 | A2, A3, C2, C3 |
| C1 | B1, D1 |
| C2 | B1, B2, D1, D2 |
| C3 | B2, D2 |
| D1 | C1, C2, E1, E2 |
| D2 | C2, C3, E2, E3 |
| E1 | E2, D1 |
| E2 | S2, E1, E3, D1, D2 |
| E3 | E2, D2 |
| S2 | E2 |
### Levels
A location's level depends on **who captures it**: deeper into enemy territory means a higher level.
Your starting Server and your first row are Lv 1, and each row after that is one level higher.
Levels decide which Avatars unlock. Every capture pays the same **4 RAM**, whatever the level.
| Row | South player's level | North player's level |
|---|---|---|
| S1 | Lv 1 (start) | — |
| A1–A3 | Lv 1 | Lv 5 |
| B1–B2 | Lv 2 | Lv 4 |
| C1–C3 | Lv 3 | Lv 3 |
| D1–D2 | Lv 4 | Lv 2 |
| E1–E3 | Lv 5 | Lv 1 |
| S2 | — | Lv 1 (start) |
### Avatar unlocks
The first time you capture a Lv N location, flip Avatar N face up, plus any lower-numbered Avatar
that's still face down. Your first row (Lv 1) unlocks nothing; Avatar 2 unlocks in your second row.
Capturing Lv 3 before Lv 2 unlocks Avatars 2 and 3. Unlocks are permanent, even if you later lose
the location. An Avatar unlocked during a round can enter play from the next round.
## Rounds and Commands
The game is played in **rounds**. In each round, each player gets **2 commands**, taken one at a
time in a snake order:
| Round | Order of commands |
|---|---|
| 1, 3, 5… | first player, second player, second player, first player |
| 2, 4, 6… | second player, first player, first player, second player |
Each player gets one pair of back-to-back commands per round, and the pair swaps sides every round.
Nobody acts twice in a row across the end of a round.
**Your first command of a round** starts with:
1. **Draw** a card. If your Deck is empty, skip this. There's no maximum hand size.
2. **Refresh:** each of your Avatars can act and be placed again this round. Effects that happen
"at the start of your turn" happen now.
**A command:**
1. **Deploy & Move.**
- First, place any of your face-up Avatars onto locations you control. This includes Avatars
entering play from a slot and Avatars repositioning. Placement is free and doesn't count as a
move. Each Avatar can be placed once per round.
- Then you may **advance** one Avatar: move it to an unowned location, or an undefended enemy
location, that is adjacent to any location you control.
- Each location holds 1 of your Avatars. Cluster Server and Pingable Server raise this to 2.
2. **Play cards** from your hand.
3. **Attack.** If you didn't advance, one Avatar may attack one **defended** enemy location adjacent
to **the location it's on**. It gets the Core bonus of the Server it attacks from.
4. **Resolve** the advance or attack right away, with the capture or combat and Server placement.
5. **Play additional cards**, including with RAM gained in step 4.
A command is **one advance or one attack**, or neither (a pass). Each Avatar can advance or attack
only **once per round**, so with one Avatar in play your second command of a round can play cards but
can't act. Copies are Avatars: each can act once per round, but they don't add commands.
There's no limit on how many cards you can play, other than the RAM you have.
### "Turn" on cards
Card text is written for turns. With commands it reads like this:
- **Your turn** is your commands in the current round. "At the start of your turn" happens at your
first command of the round.
- **Limits counted per turn** (once per turn, the first … each turn) count **per round**, for both
players together.
- **"This turn"** and **"until end of turn"** last until the end of the current command.
- **"Until your next turn"** and **"the end of your next turn"** mean your next command.
## Capturing Locations
- **Unowned location:** your Avatar moves in. Draw the top Server from your pile, place it face up
there, and gain RAM.
- **Undefended enemy location:** your Avatar moves in. The enemy puts their Server card on the bottom
of their pile, and Programs there go to their discard pile. Then place your own Server and gain
RAM, as above.
- **Defended enemy location:** combat. If you win, capture it as an undefended location. If you
lose, the location isn't captured.
- **Starting Servers** can't be attacked or captured.
## Combat
1. Both players roll 1d6 per Core, counting Cores from the Avatar, Hardware, Programs, effects, and
the Server each Avatar is on: the attacker's origin, and the location being defended. Each side
always rolls at least 1 die.
2. The higher total wins. **On a tie, both sides reroll all their dice** until one wins.
3. The **loser** returns to its Avatar slot, face up. Its Hardware goes to its owner's discard pile
and all counters and effects on it are removed, debuffs included. It can be placed again from its
owner's next command, if it hasn't been placed yet this round.
4. The **winner** keeps everything. A winning attacker moves into the captured location.
## RAM
- RAM carries over between commands and rounds, and there's no cap.
- Avatars cost 0 RAM. Other cards cost their printed RAM value.
- **Capture:** gain **4 RAM**, paid once when you capture a location, whatever its level. You get
paid again every time you recapture a location. A Server card's RAM bonus (for example "+4 RAM") is
also paid once, when the card is placed, on top of the capture RAM. A Server's Core bonus applies to your Avatar
at that location.
- **Salvage:** discard a card from your hand to gain its printed RAM value. You can salvage any time
you need to pay a cost. Installed cards can't be salvaged.
- **Firewalls:** you spend RAM to place, upgrade and clear them.
## Firewalls
Firewalls are bought with RAM and placed on a gateway (`o`). They aren't cards. A Firewall blocks
**all** movement and attacks along its line: for both players, and for card effects that move
Avatars (such as Trace Route and Disconnect).
| Firewall | Cost |
|---|---|
| Lv 1 | 2 RAM |
| Lv 2 | 4 RAM |
| Lv 3 | 8 RAM |
- **Placing:** in your command (steps 2 and 5), on an empty gateway whose line touches a location you
control. Pay the cost of the level you place. Each gateway holds 1 Firewall, and there's no limit on
how many you can place.
- **Upgrading:** same timing and placement rules as placing. Pay the **full cost** of the new level;
for example, Lv 1 → Lv 2 costs 4 RAM.
- **Clearing:** in your command, in steps 1 and 3, before you advance or attack, on a line touching a
location you control. Pay the Firewall's **current level cost**. This applies to everyone, including
the player who placed it; there's no free removal. Clearing doesn't use an Avatar's action.
- **Permanent:** a Firewall stays until someone pays to clear it, even if the locations at either end
change hands. Once placed, it doesn't belong to either player.
## Playing Cards
- **Programs:** in your command (steps 2 and 5), on a location you control. Maximum 2 per location.
- **Hardware:** in your command (steps 2 and 5), on one of your Avatars that's in play (not in its
slot), up to its Expansion Slots.
- **Executions:** at any time, by either player (see [Timing](#timing)).
- **Avatar abilities:** Execution timing, once per turn (per round), only while the Avatar is in
play.
- **Other activated abilities** (Garbage Collection, Rollback Routine, Undefined Behavior, Hot-Swap
Bay, Backup Server): the same, Execution timing and once per turn (per round). Using one isn't
playing a card.
## Timing
"Any time" means at these response windows:
- **After any declaration:** when a player declares an advance or attack, or plays a card, the other
player may respond.
- **During combat:** there's one window before the dice are rolled, and one after the roll but before
the result.
- **Chains:** an Execution or ability can respond to another one. The most recent one resolves first.
Each time a player adds to the chain, the other player may respond. When a player passes instead,
the whole chain resolves.
- The player whose command it isn't can only act in these windows. The player taking the command
can also play Executions and use abilities during its steps.
## Card Rules
### Terms
- **"This Server"** on a Program or Server is the location it's on. Avatars **"at"** a location are
the ones standing on it, plus an enemy attacking it in the current combat. Enemy Avatars never
stand on your locations.
- **"A combat at this Server"** on an Avatar Ability means any combat that Avatar is fighting in,
attacking or defending.
- **Destroyed / defeated** (Avatars) means losing a combat. A Program or Hardware is destroyed when an
effect sends it to the discard pile (Overflow Error, Sabotage). Programs on a captured location
are discarded, not destroyed.
- **Breach:** capture an enemy-owned location, by advancing into it or winning an attack on it.
- **Disabled Hardware or Program:** its effect stops. With no duration on the card, it stays
disabled until something re-enables it (Execute: Defragment) or it leaves play.
- **Disabled Avatar** (Emergency Shutdown): can't advance, attack, move or use its Ability. It still
defends. ⚠
- **Infection counters** come off when the Avatar is defeated, except the ones Persistent Infection
places. Code Zero (1+ counters: −1 Core) and Recursive Infection (3+: −2 Cores) apply everywhere
while the card is in play, once each no matter how many copies are in play.
- **Bug counters** work like Infection counters, for Bug cards. They come off when the Avatar is
defeated, and Error Correction can remove one. No card places them yet; that needs new cards.
ECC Memory stops opponents from placing them. Purge removes only Virus/Infection counters.
- **Temporary bonuses and penalties** are Core changes from Abilities, Executions and Program
triggers that last one combat or one turn: Memory Leak, Visual Artifact, Race Condition, Low
Resolution, Trace Route. Force Reboot removes them; Rollback Routine undoes the most recent penalty.
- **Copies** (Carbon NanoBots, Backup Server): a copy is an extra Avatar with the original's printed
Cores and the original's Hardware bonuses, but no Hardware or Ability of its own. Each Avatar can
have one copy at a time. It enters play on any location you control with room, can advance, attack
and defend, and is removed if it's defeated or its original is. ⚠
- **Mid-combat:** no Avatar can enter a location while a combat is going on there, whether it's a
new copy or an Avatar moved by Disconnect. It wouldn't be in the combat, and the location could be
captured with it still standing there. ⚠
- **Executions are performed by Servers**, never by Avatars. When you play one, one of your Servers
performs it (you pick which). Three cards were written for Avatars performing Executions, and read
it through the Server the Avatar stands on: Dedicated GPU and Quantum Coprocessor work for
Executions that Server performs, and Force Reboot stops that Server from performing Executions for
the rest of the turn.
- **Protected** (Execute: Root Access) means the Program Hardware Sandbox protects. No card protects
Hardware yet.
- **Two defenders** (Cluster Server, Pingable Server): both roll together as one side. If they lose,
both are defeated.
- **Cores that change after the roll** change the dice: each Core gained rolls one more die, and each
Core lost removes one of that Avatar's rolled dice, the one showing the highest number.
- **Once per turn** means once per round, counting uses in both players' commands (see
["Turn" on cards](#turn-on-cards)).
### Readings
Cards not listed here work exactly as printed.
| Card | How the simulator reads it |
|---|---|
| **Servers** | |
| Cluster Server, Pingable Server | Two of your Avatars fit; both defend together (see Terms). |
| Backup Server | Once per turn, at any time, make a copy of your Avatar standing here (see Copies). |
| Upgraded Hardware | −2 RAM for Hardware installed on your Avatar standing here. |
| Network Throttle | −1 RAM for Firewalls you place or upgrade on a line touching it. Clearing costs full price. |
| Duplicate Server | When placed, pick one adjacent Server (either player's) and gain its ability while this card stays. A copied RAM bonus is paid at once. ⚠ |
| Protected Server | +2 RAM each time a combat starts here with your Avatar defending. ⚠ |
| Callable Server | Every draw after the opening hand, once per card drawn. A second Callable Server doesn't add more. |
| **Programs** | |
| Recursive Infection | One counter per attack declared on this location, or per capture of it without an attack. ⚠ |
| Memory Parasite | "The owner" is the attacking Avatar's owner, who picks which of its Hardware is off for that combat. |
| Replication Routine | Installing this card counts, so it can bring a second Virus with it. Program slots still apply. |
| Worm Protocol | Its other Programs' effects also apply at the adjacent location chosen on install (any owner's). |
| Persistent Infection | Enemy Avatars only; Virus Programs hit attackers. ⚠ |
| Infinite Loop | Your Avatar attacking from here may declare a second attack on another adjacent location. Both attacks come from here, even if the first one moved it. If it loses the first, the second is off. ⚠ |
| Stack Overflow | Counts Programs installed here, including Process Clone and Remote Access copies. |
| Race Condition | The attacker picks first, hidden from the defender. The +2 goes to the defending side. |
| Null Pointer | Automatic: the first enemy Execution targeting this location each turn does nothing. The card is still spent. |
| Stock Rice | "Hardware bonuses" are the Cores Hardware adds. ⚠ |
| Overflow Error | "Disable" lasts until re-enabled. |
| Undefined Behavior | The copy is yours, works on this location, and lasts until your next turn. ⚠ |
| Desynchronization | The once-per-turn Hardware abilities are Hot-Swap Bay and Quantum Coprocessor. |
| Visual Artifact | Once per installation, since "each turn" was removed from the card. ⚠ |
| Ghost Process | An Execution you play on this location may pick its Avatar, Program or Hardware at one adjacent location. |
| False Positive | Redirect to any other Avatar the Execution could legally hit at another location. |
| Latency Spike | "The first step" is the window before the roll. Abilities still work. |
| Hotfix | Only effects destroy Programs (Overflow Error); capture doesn't. |
| Error Correction | Removes one of: an Infection counter, a permanent counter, disabled Hardware, the latest penalty, Packet Flood, Disabled. |
| Garbage Collection | It can sacrifice itself. |
| Version Control | On capture, one Program goes back to your hand; on destruction, the destroyed Program does. |
| Compatibility Layer | +1 Program slot here; −2 RAM for Patch Programs installed here after it. |
| **Hardware** | |
| RAM Expansion | +2 Cores. |
| Overclocked CPU | After each combat, one of your Programs on the location it fought from is disabled through the end of the next turn. ⚠ |
| Solid-State Cache | −3 RAM for the first Program you install each turn on the location the wearer stands on. |
| Redundant Power Supply | The first time the wearer is defeated, all its Hardware stays on it, in its slot. ⚠ |
| Network Interface Upgrade | Takes no port and adds one, so the wearer nets +1 Expansion Slot. The card text should say so. If it leaves (Sabotage, Rollback), the wearer discards Hardware until it fits, newest first. ⚠ |
| Dedicated GPU | +1 to the number an Execution uses (cards drawn, Cores, RAM) when the Server the wearer stands on performs it. |
| ECC Memory | Opponents can't give the wearer Bug counters. "Bug status effects" are opponents' Bug Program effects on it (Memory Leak, Stock Rice). ⚠ |
| Cooling System | One other Hardware on the same Avatar gets two uses a turn of its once-per-turn or first-each-turn effect. |
| RAID Array | Half the combined printed RAM of its Hardware, rounded up. ⚠ |
| Firewall Appliance | Programs never target Avatars, so this taxes the first enemy Execution each turn that targets the wearer or its Hardware. |
| Hardware Sandbox | Pick the Program on install, and again at the start of your turn if the wearer has moved. It's protected only while the wearer stands with it. ⚠ |
| Diagnostic Module | At the start of your turn, look at your top card and you may put it on the bottom; then draw normally. ⚠ |
| Hot-Swap Bay | Swap Hardware on this Avatar, at any time, paying the difference in printed RAM (no refund). The result must fit the ports. ⚠ |
| Quantum Coprocessor | Works for Executions performed by the Server the wearer stands on. "Disable this Hardware" lasts until your next turn, as the card used to say. |
| **Executions** | |
| Execute: Disconnect | Moves to a location you control with room. An attacker can retreat to where it stands. If the last defender leaves, the attacker takes the location. ⚠ |
| Execute: Sabotage | "Disable" lasts until re-enabled. |
| Execute: Force Reboot | Clears every temporary effect on the Avatar. The Server it stands on can't perform Executions for the rest of the turn. |
| Execute: Fork | The copy is yours, works on the target location until end of turn, and doesn't count as installed. |
| Execute: Trace Route | Resolves right away, only while no combat is going on. Into your own location it's a move, into an unowned or undefended one a capture, into a defended one an attack with +1 Core from the location it left. It works in either player's command. |
| Execute: Rollback | Programs installed on the target this turn, or Hardware installed this turn on an Avatar there. |
| Execute: Packet Flood | Affected Avatars can't advance, attack, reposition or be moved, and moves they already declared fail. ⚠ |
| Execute: Emergency Shutdown | Nobody moves; Disabled Avatars still defend (see Terms). ⚠ |
| Execute: Process Clone | The second copy counts as installed. |
| Execute: Remote Access | The Program keeps its owner and works at both locations until end of turn. ⚠ |
| Execute: Purge | Removes Infection (permanent too), opponents' penalties, Packet Flood, Disabled, and disabled Hardware. |
| **Avatar Abilities** | |
| Carbon NanoBots (Replicate) | See Copies. Two NanoBots in a deck can have two copies. ⚠ |
| Pixelated Picture (Low Resolution) | Only while it defends: −1 Core for the attacker, that combat. ⚠ |
| Beta Version 1.0 (Push Update) | During a combat it's in, install a Hardware from hand (paying for it), ignoring ports. That Hardware is discarded at the end of your turn. |
| Data Leaker (Exfiltrate) | "Breached a Server this turn" = captured an enemy location this turn. |
| Broken Bits (Bit Flip) | Rerolls its dice showing a chosen number or less, which is always the best set to reroll. |
---
## Open Questions
None for the basic game. For the cards:
1. **Bug counters** need cards that place them, and cards that punish having them (like Code Zero
and Recursive Infection do for Infection).
2. Card text to update for rulings already made: Network Interface Upgrade (+1 port), and the
typos Packet Accelerator "hen attacking" (when), Null Pointer "it's effect" (its), Push Update "If
there no ports" (there are), Memory Parasite "owners choosing" (owner's).
3. The other ⚠ readings above are smaller guesses. Say if any look wrong.
## Simulation Watch List
Things the first sim runs should measure:
- **Salvage efficiency.** Salvage pays full printed value, so any card can pay for another card of
equal or lower cost. Does capture RAM matter?
- **Fight rate.** Undefended locations are free to take. With at most 4 Avatars and 10 locations
needed, is the game a land race with few fights?
- **Recapture farming.** Can players profit by trading the same location back and forth?
- **Firewall stalling.** Can a leading player wall off their side with Lv 3 Firewalls and stall the
game? Firewalls block everyone, and every line between the B and C rows (and C and D) has a
gateway, so four Lv 3 Firewalls can seal one half off.
- **Game length.** Deck is 45 cards, 7 of them in the opening hand, so 38 draws. Do games end before
decks run out?
- **First-player advantage.** With whole turns the first player won about 70% of sim games (with
bots that rush Avatar unlocks). Rounds of alternating commands in the snake order bring it to about
50%. A plain alternating lead gave 49%, the first player always leading 51%.
- **Game length.** Commands make games longer: a median of 13 rounds (26 commands each), 90% within
35 rounds.
## Appendix: Combat Odds
Exact chance that the attacker wins, by Core count, with ties rerolled. Rows are the attacker's
Cores, columns the defender's.
| Atk \ Def | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| **1** | 50% | 10% | 1% | 0% | 0% | 0% | 0% | 0% |
| **2** | 90% | 50% | 16% | 4% | 1% | 0% | 0% | 0% |
| **3** | 99% | 84% | 50% | 21% | 6% | 2% | 0% | 0% |
| **4** | 100% | 96% | 79% | 50% | 23% | 9% | 3% | 1% |
| **5** | 100% | 99% | 94% | 77% | 50% | 26% | 11% | 4% |
| **6** | 100% | 100% | 98% | 91% | 74% | 50% | 28% | 13% |
| **7** | 100% | 100% | 100% | 97% | 89% | 72% | 50% | 29% |
| **8** | 100% | 100% | 100% | 99% | 96% | 87% | 71% | 50% |

View file

@ -26,7 +26,8 @@ of how much a card helps.
## What's simulated
- **Rules:** everything in `rules.md`: setup, the turn steps, placement and advancing, attacks,
- **Rules:** everything in `rules.md`: setup, rounds of alternating commands (or whole turns, with
`--rule commands.on=false`), placement and advancing, attacks,
combat with tie rerolls, captures, levels and RAM, Avatar unlocks, Firewalls, Salvage, response
windows and chains, and the win condition.
- **Every card:** all 83 cards in `../decks/files-deck-1/cards.csv` have a script, including Avatar
@ -60,9 +61,10 @@ fixed hooks: Core totals, costs, combat start, defeat, capture, draws, installs,
## Bots
- **greedy** plans each turn: grabs open locations, attacks at 60%+ odds, guards threatened
locations, installs Hardware and Programs where they help, walls off undefended locations, and
keeps RAM for tricks. On the opponent's turn it answers after the dice are rolled with whichever
- **greedy** plans each command: takes the best single advance or attack (open locations first,
rushing the ones that unlock Avatars; attacks at 60%+ odds), guards threatened locations, installs
Hardware and Programs where they help, walls off undefended locations, and keeps RAM for tricks.
With whole turns it plans every Avatar's move at once. On the opponent's commands it answers after the dice are rolled with whichever
Execution or Ability most improves the combat, and tries to stop advances into its locations.
- **nocards** is greedy but only uses Core Hardware, like the first version of the sim.
- **bold / cautious / nowall / wall3** change one greedy setting each; **random** picks any legal

View file

@ -20,6 +20,14 @@ export function locationValue(v: GameState, p: PlayerId, loc: LocId): number {
return LOCATION_POINTS + taken + v.rules.levelRam[levelFor(p, loc)] * RAM_POINTS;
}
/** How many Avatars capturing `loc` would unlock for `p` (level unlocks only). */
export function unlocksAt(v: GameState, p: PlayerId, loc: LocId): number {
if (v.rules.recruit.on || v.rules.buyAvatars.on || isStart(loc)) return 0;
const level = levelFor(p, loc);
if (level <= v.players[p].unlockedLevel) return 0;
return v.players[p].avatars.slice(0, Math.min(level, 4)).filter((a) => !a.faceUp).length;
}
/** What losing an Avatar costs: the tempo, plus its Hardware. */
export function avatarStake(v: GameState, r: AvatarRef): number {
return LOSS_POINTS + hardwareOf(v, r).reduce((t, h) => t + (h < 0 ? 0 : defOf(v, h).ram), 0) * RAM_POINTS;

View file

@ -8,10 +8,12 @@ import {
firewallCost,
hardwareCost,
openWindow,
avatarForSale,
programCost,
recruitSlots,
} from '../engine.ts';
import { GRID, LINES_AT, LOCATIONS, otherEnd, type LocId } from '../map.ts';
import { coresOf, hardwareActive, hasRoom, portsFree, programSlots, sources } from '../query.ts';
import { avatarRoom, coresOf, hardwareActive, hasRoom, portsFree, programSlots, sources } from '../query.ts';
import { scriptOf } from '../scripts.ts';
import {
avatar,
@ -19,6 +21,7 @@ import {
controls,
defendersAt,
defOf,
freshCopy,
hardwareOf,
isCopy,
isOpen,
@ -41,6 +44,7 @@ import {
locationValue,
printedRam,
stakes,
unlocksAt,
} from './eval.ts';
export interface GreedyParams {
@ -53,6 +57,8 @@ export interface GreedyParams {
ramReserve: number;
/** Play Programs, Executions and Abilities. Off plays like the Phase 2 bot: Core Hardware only. */
useCards: boolean;
/** Extra value of a capture per Avatar it unlocks (a location is worth about 12). 0 ignores unlocks. */
unlockPoints: number;
}
export const DEFAULT_GREEDY: GreedyParams = {
@ -61,6 +67,7 @@ export const DEFAULT_GREEDY: GreedyParams = {
maxFirewallsPerTurn: 2,
ramReserve: 6,
useCards: true,
unlockPoints: 15,
};
/**
@ -108,6 +115,7 @@ const COMBAT_TRICKS = new Set([
/** How much the bot wants to keep a card rather than salvage it. Below 3 is fodder. */
function keepScore(v: GameState, id: number): number {
const def = defOf(v, id);
if (def.kind === 'avatar') return recruitSlot(v, v.cards[id].owner, id) === null ? 1 : 7;
if (def.kind === 'hardware') {
if (hardwareCores(v, id) > 0) return 6;
return (UTILITY_HARDWARE[def.name] ?? 0) * 2;
@ -139,7 +147,47 @@ function salvageFor(v: GameState, me: PlayerId, cost: number, except: number | n
/** The card an action spends from hand, so Salvage doesn't use it. */
const spentCard = (a: Action): number | null =>
a.type === 'play' || a.type === 'installHardware' || a.type === 'installProgram' ? a.card : null;
a.type === 'play' || a.type === 'installHardware' || a.type === 'installProgram' || a.type === 'recruit' ? a.card : null;
// ---------------------------------------------------------------------------------------------
// Recruiting (recruit rule)
/**
* Where the bot would recruit Avatar `id`: an empty slot while there's room, otherwise over a
* weaker Avatar (fewer Cores) that carries no Hardware, preferring one sitting in its slot.
* `taken` are slots already planned this step.
*/
function recruitSlot(v: GameState, me: PlayerId, id: number, taken: number[] = []): number | null {
if (!v.rules.recruit.on) return null;
const avs = v.players[me].avatars;
const cores = (card: number) => defOf(v, card).cores;
const empty = avs.findIndex((a, i) => i < 4 && a.card < 0 && !taken.includes(i + 1));
const planned = taken.filter((slot) => avs[slot - 1].card < 0).length;
const inUse = avs.filter((a, i) => (i < 4 ? a.card >= 0 : a.at !== null)).length;
if (empty >= 0 && avatarRoom(v, me) && inUse + planned < 4) return empty + 1;
const weaker = recruitSlots(v, me)
.filter((slot) => !taken.includes(slot) && avs[slot - 1].card >= 0 && avs[slot - 1].hardware.length === 0)
.filter((slot) => cores(avs[slot - 1].card) < cores(id))
.sort((a, b) => Number(avs[a - 1].at !== null) - Number(avs[b - 1].at !== null) || cores(avs[a - 1].card) - cores(avs[b - 1].card));
return weaker[0] ?? null;
}
/** Recruit the strongest Avatars in hand that fit, within `budget`. */
function recruitPlan(v: GameState, me: PlayerId, budget: number): Action[] {
if (!v.rules.recruit.on) return [];
const hand = v.players[me].hand
.filter((id) => id >= 0 && defOf(v, id).kind === 'avatar')
.sort((a, b) => defOf(v, b).cores - defOf(v, a).cores);
const out: Extract<Action, { type: 'recruit' }>[] = [];
for (const card of hand) {
const price = printedRam(v, card);
const slot = price <= budget ? recruitSlot(v, me, card, out.map((a) => a.slot)) : null;
if (slot === null) continue;
out.push({ type: 'recruit', card, slot });
budget -= price;
}
return out;
}
const reach = (v: GameState, me: PlayerId) =>
v.players[me].ram + v.players[me].hand.reduce((t, id) => t + printedRam(v, id), 0);
@ -210,7 +258,7 @@ function planTurn(v: GameState, me: PlayerId, params: GreedyParams): TurnPlan {
for (const to of gridFrom(me)) {
if (controls(v, me, to)) continue;
const defended = defendersAt(v, to).length > 0;
const value = locationValue(v, me, to);
const value = locationValue(v, me, to) + params.unlockPoints * unlocksAt(v, me, to);
for (const line of LINES_AT.get(to)!) {
const from = otherEnd(line, to);
if (!controls(v, me, from)) continue;
@ -220,6 +268,7 @@ function planTurn(v: GameState, me: PlayerId, params: GreedyParams): TurnPlan {
const clear = level ? line.id : undefined;
for (const { slot } of ready) {
const ref = { player: me, slot };
if (freshCopy(v, ref)) continue;
if (!defended) {
// Advancing needs no dice, so prefer weak Avatars and save strong ones for attacks.
const weakness = 0.01 * coresOf(v, { ref, role: 'attack', at: null, loc: null, combat: null });
@ -244,6 +293,7 @@ function planTurn(v: GameState, me: PlayerId, params: GreedyParams): TurnPlan {
const clears = new Set<string>();
for (const o of options) {
if (o.score <= 0) break;
if (v.rules.commands.on && chosen.length > 0) break; // one advance or attack per command
if (usedTargets.has(o.to)) continue;
const n = uses.get(o.slot) ?? 0;
if (n > 0) {
@ -606,19 +656,21 @@ const totalCost = (v: GameState, list: Action[]) => list.reduce((t, a) => t + ac
function planPlay(v: GameState, me: PlayerId, params: GreedyParams, plan: TurnPlan | null): Action[] {
const budget = spendable(v, me);
const attackers = v.step === 'play' && plan?.turn === v.turn ? plan.attackers : new Set<number>();
const sale = avatarForSale(v, me);
const recruits = [...recruitPlan(v, me, budget), ...(sale && sale.price <= budget ? [{ type: 'buyAvatar', slot: sale.slot } as const] : [])];
if (v.step === 'play') {
const early = params.useCards ? [...clearTheWay(v, me, plan), ...preAttackPlays(v, me, plan)] : [];
return [...early, ...hardwarePlan(v, me, attackers, budget - totalCost(v, early), params.useCards)];
return [...recruits, ...early, ...hardwarePlan(v, me, attackers, budget - totalCost(v, [...recruits, ...early]), params.useCards)];
}
const keep = heldReserve(v, me, params);
const hw = hardwarePlan(v, me, attackers, budget - keep, params.useCards);
let left = budget - keep - totalCost(v, hw);
const hw = hardwarePlan(v, me, attackers, budget - keep - totalCost(v, recruits), params.useCards);
let left = budget - keep - totalCost(v, [...recruits, ...hw]);
const progs = params.useCards ? programPlan(v, me, left - params.ramReserve) : [];
left -= totalCost(v, progs);
const walls = firewallPlan(v, me, params, left);
left -= totalCost(v, walls);
const extra = params.useCards ? utilityPlays(v, me, left - params.ramReserve) : [];
return [...hw, ...progs, ...walls, ...extra];
return [...recruits, ...hw, ...progs, ...walls, ...extra];
}
// ---------------------------------------------------------------------------------------------

View file

@ -5,7 +5,7 @@
*/
import { createCopy, drawCards } from '../flow.ts';
import { LOCATIONS } from '../map.ts';
import { costOf, hardwareActive, hasRoom, portsFree } from '../query.ts';
import { canCopy, costOf, hardwareActive, hasRoom, portsFree } from '../query.ts';
import type { Script } from '../scripts.ts';
import {
addMod,
@ -46,12 +46,12 @@ export const AVATARS: Record<string, Script> = {
text: 'Avatar may create a copy of itself. Only one copy is allowed at a time. If the copy is defeated the original does not lose any hardware upgrades. If the original is defeated the replicate is as well.',
ability: {
uses(s, src) {
if (avatar(s, copyOf(src.ref!)).at !== null) return [];
if (avatar(s, copyOf(src.ref!)).at !== null || !canCopy(s, src.controller)) return [];
return LOCATIONS.filter((l) => hasRoom(s, src.controller, l)).map((to) => ({ to }));
},
resolve(s, item, src) {
const to = item.args.to!;
if (avatar(s, copyOf(src.ref!)).at !== null || !hasRoom(s, src.controller, to)) return;
if (avatar(s, copyOf(src.ref!)).at !== null || !canCopy(s, src.controller) || !hasRoom(s, src.controller, to)) return;
fired(s, 'Carbon NanoBots', src.controller);
createCopy(s, src.ref!, to);
},
@ -59,7 +59,7 @@ export const AVATARS: Record<string, Script> = {
},
'Corrupt Driver': {
text: 'Choose one Hardware on an enemy Avatar in combat with this Avatar. It is disabled until the end of your next turn.',
text: 'Choose one Hardware on an enemy Avatar in combat with this Avatar. It is disabled until the end of your next command.',
ability: {
uses: (s, src) =>
[...new Set(opponentsInCombat(s, src.ref!).flatMap((r) => hardwareOf(s, r)))]
@ -91,7 +91,7 @@ export const AVATARS: Record<string, Script> = {
// Reading: during a combat it's in, install one Hardware from hand on it (paying its cost),
// ignoring ports. That Hardware is discarded at the end of your turn.
'Beta Version 1.0': {
text: 'While in combat an additional piece of hardware can be placed on this avatar until the end of your turn. If there no ports available this can still be attached.',
text: 'While in combat an additional piece of hardware can be placed on this avatar until the end of your command. If there no ports available this can still be attached.',
ability: {
uses: (s, src) =>
inCombat(s, src.ref!)
@ -111,8 +111,8 @@ export const AVATARS: Record<string, Script> = {
},
'Code Zero': {
text: 'Place an Infection counter on every enemy Avatar in combat at this Server. While this Avatar is in play, an Avatar with 2+ Infection counters has -1 Core.',
globalCores: (s, f) => (infectionOf(avatar(s, f.ref)) >= 2 ? -1 : 0),
text: 'Place an Infection counter on every enemy Avatar in combat at this Server. While this Avatar is in play, an Avatar with 1+ Infection counters has -1 Core.',
globalCores: (s, f) => (infectionOf(avatar(s, f.ref)) >= 1 ? -1 : 0),
ability: {
uses: (s, src) => (opponentsInCombat(s, src.ref!).length ? [{}] : []),
resolve(s, _item, src) {
@ -126,7 +126,7 @@ export const AVATARS: Record<string, Script> = {
// "Breached a Server" = captured an enemy location this turn.
'Data Leaker': {
text: "Look at your opponent's hand and choose one card in it. They must discard that card without gaining RAM. If this Avatar breached a Server this turn, draw a card.",
text: "Look at your opponent's hand and choose one card in it. They must discard that card without gaining RAM. If this Avatar breached a Server this command, draw a card.",
ability: {
uses: (s, src) => (s.players[other(src.controller)].hand.length ? [{}] : []),
resolve(s, _item, src) {

View file

@ -141,7 +141,7 @@ export const EXECUTIONS: Record<string, Script> = {
},
'Execute: Kill Process': {
text: "Disable one Program installed on the target Server until its controller's next turn.",
text: "Disable one Program installed on the target Server until its controller's next command.",
execution: {
plays: (s, p) =>
acrossScope(s, p, (loc) => programsOn(s, loc).filter((id) => canTargetProgram(s, id, p)).map((card) => ({ card }))),
@ -159,7 +159,7 @@ export const EXECUTIONS: Record<string, Script> = {
// Ruling: Servers perform Executions, so "that Avatar cannot play another Execution" stops the
// Server it stands on from performing Executions for the rest of the turn.
'Execute: Force Reboot': {
text: 'Remove all temporary bonuses and penalties from one Avatar you control at the target Server, or one Avatar attacking it. That Avatar cannot play another Execution this turn.',
text: 'Remove all temporary bonuses and penalties from one Avatar you control at the target Server, or one Avatar attacking it. That Avatar cannot play another Execution until end of current command.',
execution: {
plays: (s, p) =>
acrossScope(s, p, (loc) => {
@ -183,7 +183,7 @@ export const EXECUTIONS: Record<string, Script> = {
},
'Execute: Fork': {
text: 'Copy the localized effect of one Program installed on the target Server until end of turn.',
text: 'Copy the localized effect of one Program installed on the target Server until end of current command.',
execution: {
plays: (s, p) =>
acrossScope(s, p, (loc) => programsOn(s, loc).filter((id) => canTargetProgram(s, id, p)).map((card) => ({ card }))),
@ -253,7 +253,7 @@ export const EXECUTIONS: Record<string, Script> = {
},
'Execute: Override': {
text: 'Choose one enemy Program installed on the target Server. Ignore its text until the end of turn.',
text: 'Choose one enemy Program installed on the target Server. Ignore its text until end of current command.',
execution: {
plays: (s, p) =>
acrossScope(s, p, (loc) =>
@ -302,7 +302,7 @@ export const EXECUTIONS: Record<string, Script> = {
},
'Execute: Rollback': {
text: "Return one Program or Hardware installed at the target Server this turn to its owner's hand.",
text: "Return one Program or Hardware installed at the target Server this command to its owner's hand.",
execution: {
plays: (s, p) =>
acrossScope(s, p, (loc) => {
@ -325,7 +325,7 @@ export const EXECUTIONS: Record<string, Script> = {
// Protected = Hardware Sandbox's Program. No card protects Hardware yet.
'Execute: Root Access': {
text: 'Until end of turn, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected.',
text: 'Until end of current command, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected.',
execution: {
plays: () => LOCATIONS.map((target) => ({ target, args: {} })),
resolve(s, item) {
@ -337,7 +337,7 @@ export const EXECUTIONS: Record<string, Script> = {
// Rooted Avatars can't advance, attack, reposition, or be moved; their declared moves fail.
'Execute: Packet Flood': {
text: "Avatars based at the target Server cannot move or retreat until the start of their controller's next turn.",
text: "Avatars based at the target Server cannot move or retreat until the start of their controller's next command.",
execution: {
plays: (s, p) => acrossScope(s, p, (loc) => (avatarsAt(s, loc).length ? [{ to: loc }] : [])),
resolve(s, item) {
@ -356,7 +356,7 @@ export const EXECUTIONS: Record<string, Script> = {
// Reading: Disabled Avatars still defend, but can't advance, attack, move or use Abilities.
'Execute: Emergency Shutdown': {
text: 'End any combat at the target Server immediately. All Avatars there remain and become Disabled until end of turn.',
text: 'End any combat at the target Server immediately. All Avatars there remain and become Disabled until end of current command.',
execution: {
plays(s, p) {
const c = liveCombat(s);
@ -374,7 +374,7 @@ export const EXECUTIONS: Record<string, Script> = {
},
'Execute: Process Clone': {
text: 'Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of turn.',
text: 'Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of current command.',
execution: {
plays: (s, p) =>
LOCATIONS.filter((t) => controls(s, p, t)).flatMap((target) =>
@ -412,7 +412,7 @@ export const EXECUTIONS: Record<string, Script> = {
// Reading: the Program keeps its owner, and runs at both locations until end of turn.
'Execute: Remote Access': {
text: 'Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of turn.',
text: 'Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of current command.',
execution: {
plays: (s, p) =>
LOCATIONS.flatMap((target) =>

View file

@ -103,7 +103,7 @@ export const HARDWARE: Record<string, Script> = {
// Reading: the Program is one on the location the wearer fought from, the owner picks it, and it
// stays disabled through the end of the next turn.
'Overclocked CPU': {
text: 'Avatar gains +2 Cores during combat, but one installed Program at the current server becomes disabled afterward for 2 turns.',
text: 'Avatar gains +2 Cores during combat, but one installed Program at the current server becomes disabled afterward for 2 commands.',
cores: (_s, _src, f) => (f.role !== null ? 2 : 0),
onCombatEnd(s, src) {
const c = s.combat!;
@ -132,7 +132,7 @@ export const HARDWARE: Record<string, Script> = {
},
'Solid-State Cache': {
text: 'The first Program installed on the occupied Server each turn costs 3 less RAM.',
text: 'The first Program installed on the occupied Server each round costs 3 less RAM.',
costMod: (s, src, pay) =>
pay.kind === 'program' && pay.player === src.controller && pay.at === src.at && hardwareUsesLeft(s, src.id) > 0 ? -3 : 0,
onPaid(s, src) {
@ -179,7 +179,7 @@ export const HARDWARE: Record<string, Script> = {
// Works through hardwareUsesLeft() above.
'Cooling System': {
text: 'Allow one Hardware to activate twice per turn.',
text: 'Allow one Hardware to activate twice per round.',
},
// Reading: half the combined printed RAM of its Hardware, rounded up.
@ -220,7 +220,7 @@ export const HARDWARE: Record<string, Script> = {
// Programs never target Avatars, so this taxes Executions (and Hardware they hit).
'Firewall Appliance': {
text: 'The first hostile Program or Execution targeting this Avatar each turn costs the opponent +3 RAM.',
text: 'The first hostile Program or Execution targeting this Avatar each round costs the opponent +3 RAM.',
costMod: (s, src, pay) =>
pay.kind === 'execution' && pay.player !== src.controller && hardwareUsesLeft(s, src.id) > 0 &&
(pay.hostile ?? []).some((r) => wearing(src.ref, { ref: r })) ? 3 : 0,
@ -252,7 +252,7 @@ export const HARDWARE: Record<string, Script> = {
// Reading: at the start of your turn, look at the top card and you may put it on the bottom.
'Diagnostic Module': {
text: 'Look at one face down card in your draw pile. You may place it at the bottom and draw another to start your turn.',
text: 'Look at one face down card in your draw pile. You may place it at the bottom and draw another to start your first command each round.',
onTurnStart(s, src) {
if (s.active !== src.controller || hardwareUsesLeft(s, src.id) <= 0) return;
const deck = s.players[src.controller].deck;
@ -280,7 +280,7 @@ export const HARDWARE: Record<string, Script> = {
// Reading: swap Hardware on this Avatar, paying the difference in printed RAM (no refund).
'Hot-Swap Bay': {
text: 'Once per turn, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost.',
text: 'Once per round, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost.',
ability: {
hardwareOncePerTurn: true,
uses(s, src) {
@ -309,7 +309,7 @@ export const HARDWARE: Record<string, Script> = {
// Ruling: Servers perform Executions, so "this Avatar uses an Execution" means one performed by
// the Server the wearer stands on. "Disable this Hardware" lasts until your next turn.
'Quantum Coprocessor': {
text: "Once per turn when this Avatar uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware.",
text: "Once per round when this Avatar uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware.",
copiesExecutions: true,
resume: {
offer(s, data: { item: StackItem }) {

View file

@ -236,7 +236,7 @@ export const PROGRAMS: Record<string, Script> = {
},
'Payload Injector': {
text: 'The first Execution you play targeting this Server each turn costs 2 less RAM.',
text: 'The first Execution you play targeting this Server each round costs 2 less RAM.',
costMod: (s, src, pay) =>
pay.kind === 'execution' && pay.player === src.controller && pay.at === src.at &&
usedThisTurn(s, `payload:${src.id}`) === 0 ? -2 : 0,
@ -258,7 +258,7 @@ export const PROGRAMS: Record<string, Script> = {
// Reading: your Avatar attacking from this Server may declare a second attack on another
// adjacent location. Both come from this Server, even if the first one moved it.
'Infinite Loop': {
text: 'If the attacking Avatar is controlled by the owner of this Program, it may attack a second adjacent Server in the same turn.',
text: 'If the attacking Avatar is controlled by the owner of this Program, it may attack a second adjacent Server in the same command.',
extraAttacks: 1,
},
@ -311,7 +311,7 @@ export const PROGRAMS: Record<string, Script> = {
},
'Null Pointer': {
text: "Once per turn, when an enemy Execution would resolve at this Server, it's effect does not occur.",
text: "Once per round, when an enemy Execution would resolve at this Server, it's effect does not occur.",
negates(s, src, item) {
if (item.player === src.controller || item.target !== src.at || usedThisTurn(s, `null:${src.id}`) > 0) return false;
markUsed(s, `null:${src.id}`);
@ -361,7 +361,7 @@ export const PROGRAMS: Record<string, Script> = {
// Reading: the copy lasts until your next turn, while this Program is disabled.
'Undefined Behavior': {
text: 'Once per turn, copy the localized effect of another Program on another Server. Then disable this Program until your next turn.',
text: 'Once per round, copy the localized effect of another Program on another Server. Then disable this Program until your next command.',
ability: {
uses(s, src) {
if (src.kind !== 'program' || src.virtual !== undefined) return [];
@ -398,7 +398,7 @@ export const PROGRAMS: Record<string, Script> = {
// The once-per-turn Hardware abilities are Hot-Swap Bay's and Quantum Coprocessor's.
Desynchronization: {
text: 'Enemy Avatars attacking this Server cannot use their Hardware\'s "once per turn" abilities during that combat.',
text: 'Enemy Avatars attacking this Server cannot use their Hardware\'s "once per round" abilities during that combat.',
blocksHardwareAbilities: true,
},
@ -480,11 +480,11 @@ export const PROGRAMS: Record<string, Script> = {
// Destroyed means destroyed by an effect (Overflow Error). A captured location's Programs aren't
// destroyed; they're discarded (see Version Control).
Hotfix: {
text: 'The first Program on this Server that would be destroyed each turn is instead disabled until your next turn.',
text: 'The first Program on this Server that would be destroyed each round is instead disabled until your next command.',
},
'Error Correction': {
text: 'At the beginning of your turn, remove one negative counter or status from each Avatar you control at this Server.',
text: 'At the beginning of your first command each round, remove one negative counter or status from each Avatar you control at this Server.',
onTurnStart(s, src) {
if (s.active !== src.controller) return;
const tasks: Task[] = refsInPlay(s, src.controller)
@ -518,7 +518,7 @@ export const PROGRAMS: Record<string, Script> = {
// Reading: it can sacrifice itself.
'Garbage Collection': {
text: 'Once per turn, sacrifice one Program installed on this Server to recover its printed RAM value.',
text: 'Once per round, sacrifice one Program installed on this Server to recover its printed RAM value.',
ability: {
uses: (s, src) => (src.kind === 'program' ? s.locations[src.at!].programs.map((card) => ({ card })) : []),
resolve(s, item, src) {
@ -559,7 +559,7 @@ export const PROGRAMS: Record<string, Script> = {
},
'Rollback Routine': {
text: 'Once per turn, undo the most recent temporary stat reduction applied to an Avatar you control at this Server.',
text: 'Once per round, undo the most recent temporary stat reduction applied to an Avatar you control at this Server.',
ability: {
uses(s, src) {
if (src.kind !== 'program') return [];

View file

@ -4,7 +4,7 @@
*/
import { createCopy, drawNow } from '../flow.ts';
import { LINE_BY_ID } from '../map.ts';
import { hasRoom, sameSource, sourcesNamed } from '../query.ts';
import { canCopy, hasRoom, sameSource, sourcesNamed } from '../query.ts';
import type { Fighter, Script } from '../scripts.ts';
import {
ask,
@ -48,6 +48,7 @@ export const SERVERS: Record<string, Script> = {
ability: {
uses(s, src) {
const p = src.controller;
if (!canCopy(s, p)) return [];
const spots = LOCATIONS.filter((l) => hasRoom(s, p, l));
return refsInPlay(s, p)
.filter((r) => !isCopy(r) && avatar(s, r).at === src.at && avatar(s, copyOf(r)).at === null)
@ -56,7 +57,7 @@ export const SERVERS: Record<string, Script> = {
resolve(s, item) {
const r = item.args.ref!;
const to = item.args.to!;
if (avatar(s, r).at === null || avatar(s, copyOf(r)).at !== null || !hasRoom(s, r.player, to)) return;
if (avatar(s, r).at === null || avatar(s, copyOf(r)).at !== null || !canCopy(s, r.player) || !hasRoom(s, r.player, to)) return;
fired(s, 'Backup Server', r.player);
createCopy(s, r, to);
},

View file

@ -29,12 +29,17 @@ const USAGE = `Files TCG simulator
--seed N first game's seed; game i uses seed + i (default 1)
--south BOT South's bot (default greedy)
--north BOT North's bot (default greedy)
--max-turns N player turns before a draw (default ${DEFAULT_RULES.maxTurns})
--max-turns N rounds × 2 before a draw (default ${DEFAULT_RULES.maxTurns}, i.e. ${DEFAULT_RULES.maxTurns / 2} rounds)
--rule K=V change a rule in src/rules.ts; repeatable. Examples: winLocations=9,
levelRam=4,4,6,8,10, startingAvatars=4, firstTurn.advance=false,
levelRam=4,4,6,8,10, startingAvatars=4, firstTurn.draw=true, firstTurn.advance=false,
firstTurn.captureRam=false, firstTurn.unlock=false, firstTurn.cards=false,
secondPlayer.ram=4, secondPlayer.avatars=1, secondPlayer.cards=2,
secondPlayer.locations=1
secondPlayer.ram=4, secondPlayer.avatars=1, secondPlayer.cards=2, secondPlayer.firstDraw=1,
secondPlayer.locations=1, drawPerTurn=2, deck.main=60,
recruit.on=true (Avatars in the deck; also recruit.avatarsInDeck=5, recruit.price=8),
buyAvatars.on=true (buy Avatars 2-4 instead of unlocking; buyAvatars.prices=8,12,16),
copies.waitATurn=true, copies.needAvatar2=true, copies.allowed=false,
commands.on=false (whole turns instead of rounds of commands),
commands.perPlayer=3, commands.leads=F|FS|FFSS|thue, commands.snake=false
--log play one game and print the play-by-play
--check check rule invariants after every action (slow)
--json FILE also write the summary and every game's result as JSON

View file

@ -1,11 +1,11 @@
import type { CardDef, CardKind, CardPool } from './cards.ts';
import { shuffle, type Rng } from './rng.ts';
import type { RulesConfig } from './rules.ts';
import { avatarsOutside, type RulesConfig } from './rules.ts';
export interface DeckList {
avatars: string[];
servers: string[];
/** Executions, Hardware and Programs. */
/** Executions, Hardware and Programs (and Avatars, when recruiting). */
main: string[];
}
@ -22,9 +22,9 @@ export function validateDeck(pool: CardPool, deck: DeckList, rules: RulesConfig)
else if (!kinds.includes(card.kind)) errors.push(`${label}: "${name}" is a ${card.kind}`);
}
};
part('Avatars', deck.avatars, ['avatar'], rules.deck.avatars);
part('Avatars', deck.avatars, ['avatar'], avatarsOutside(rules));
part('Servers', deck.servers, ['server'], rules.deck.servers);
part('Deck', deck.main, MAIN_KINDS, rules.deck.main);
part('Deck', deck.main, rules.recruit.on ? [...MAIN_KINDS, 'avatar'] : MAIN_KINDS, rules.deck.main);
const copies = new Map<string, number>();
for (const name of [...deck.avatars, ...deck.servers, ...deck.main]) {
copies.set(name, (copies.get(name) ?? 0) + 1);
@ -49,6 +49,12 @@ export function randomDeck(
if (names.length < size) throw new Error(`Not enough ${kinds.join('/')} cards for a deck`);
return shuffle(rng, names).slice(0, size);
};
if (rules.recruit.on) {
const k = rules.recruit.avatarsInDeck;
const avatars = sample(['avatar'], 1 + k);
const servers = sample(['server'], rules.deck.servers);
return { avatars: avatars.slice(0, 1), servers, main: shuffle(rng, [...avatars.slice(1), ...sample(MAIN_KINDS, rules.deck.main - k)]) };
}
return {
avatars: sample(['avatar'], rules.deck.avatars),
servers: sample(['server'], rules.deck.servers),

View file

@ -6,6 +6,7 @@
*/
import type { CardPool } from './cards.ts';
import { validateDeck, type DeckList } from './deck.ts';
import type { CardDef } from './cards.ts';
import {
captureHooks,
captureMain,
@ -14,9 +15,11 @@ import {
drawNow,
drawTask,
resolveDeclaration,
retireAvatar,
} from './flow.ts';
import { GRID, LINES, LINES_AT, LINE_BY_ID, LOCATIONS, START_LOC, isStart, otherEnd, type LocId } from './map.ts';
import {
avatarRoom,
costOf,
coresOf,
desynced,
@ -44,10 +47,14 @@ import {
endOf,
firewallCost,
gridCount,
commanderOf,
firstCommand,
freshCopy,
isCopy,
isOpen,
markUsed,
nameOf,
originalOf,
other,
fired,
played,
@ -55,6 +62,7 @@ import {
pushTasks,
refsInPlay,
removeFrom,
roundOf,
running,
say,
startOf,
@ -114,6 +122,32 @@ function newStats(): GameStats {
return Object.fromEntries(STAT_KEYS.map((k) => [k, [0, 0]])) as GameStats;
}
/** Recruit rule: an Avatar's printed RAM is its price, which is also what it salvages for. */
function withPrice(def: CardDef, rules: RulesConfig): CardDef {
if (!rules.recruit.on || def.kind !== 'avatar') return def;
return { ...def, ram: rules.recruit.price + rules.recruit.pricePerCore * def.cores };
}
/** Recruit rule: slots `p` can recruit into. The first empty one while there's room, or any Avatar to retire. */
export function recruitSlots(s: GameState, p: PlayerId): number[] {
const avs = s.players[p].avatars.slice(0, 4);
const out: number[] = [];
const empty = avs.findIndex((a) => a.card < 0);
if (empty >= 0 && avatarRoom(s, p)) out.push(empty + 1);
avs.forEach((a, i) => {
const declared = s.declarations.some((d) => d.ref.player === p && originalOf(d.ref).slot === i + 1);
if (a.card >= 0 && !declared) out.push(i + 1);
});
return out;
}
/** Buy-Avatars rule: the next Avatar `p` can buy (its slot) and its price, or null. */
export function avatarForSale(s: GameState, p: PlayerId): { slot: number; price: number } | null {
if (!s.rules.buyAvatars.on) return null;
const i = s.players[p].avatars.slice(0, 4).findIndex((a) => !a.faceUp);
return i < 1 ? null : { slot: i + 1, price: s.rules.buyAvatars.prices[i - 1] };
}
function newAvatar(card: number, faceUp: boolean, copyOf: number | null): AvatarState {
return {
card,
@ -131,6 +165,8 @@ function newAvatar(card: number, faceUp: boolean, copyOf: number | null): Avatar
rootedUntil: 0,
breachedTurn: 0,
copyOf,
createdTurn: 0,
unlockedTurn: 0,
};
}
@ -171,13 +207,15 @@ export function createGame({ pool, decks, seed, rules = DEFAULT_RULES, log = fal
log: log ? [] : null,
};
const add = (name: string, owner: PlayerId): number => {
s.defs[name] = pool.byName.get(name)!;
s.defs[name] = withPrice(pool.byName.get(name)!, rules);
s.cards.push({ id: s.cards.length, name, owner, disabledUntil: 0, ignoredUntil: 0, installedTurn: 0 });
return s.cards.length - 1;
};
for (const p of [0, 1] as const) {
const deck = decks[p];
// Recruit rule: slots after the starting Avatar begin empty (-1).
const avatars = shuffle(rng, deck.avatars.map((n) => add(n, p)));
const slots = [0, 1, 2, 3].map((i) => avatars[i] ?? -1);
s.players.push({
ram: 0,
hand: [],
@ -185,8 +223,8 @@ export function createGame({ pool, decks, seed, rules = DEFAULT_RULES, log = fal
discard: [],
serverPile: shuffle(rng, deck.servers.map((n) => add(n, p))),
avatars: [
...avatars.map((card, i) => newAvatar(card, i < rules.startingAvatars, null)),
...avatars.map((card, i) => newAvatar(card, false, i + 1)),
...slots.map((card, i) => newAvatar(card, card >= 0 && i < rules.startingAvatars, null)),
...slots.map((card, i) => newAvatar(card, false, i + 1)),
],
unlockedLevel: 1,
});
@ -207,7 +245,7 @@ export function createGame({ pool, decks, seed, rules = DEFAULT_RULES, log = fal
const p2 = other(s.firstPlayer);
const second = s.players[p2];
second.ram += rules.secondPlayer.ram;
second.avatars.slice(0, rules.startingAvatars + rules.secondPlayer.avatars).forEach((av) => (av.faceUp = true));
second.avatars.slice(0, rules.startingAvatars + rules.secondPlayer.avatars).forEach((av) => (av.faceUp = av.card >= 0));
for (let i = 0; i < rules.secondPlayer.cards; i++) drawNow(s, p2);
if (rules.secondPlayer.locations > 0) {
// The location next to the starting Server, with a Server from the pile: no RAM, no unlock.
@ -219,13 +257,14 @@ export function createGame({ pool, decks, seed, rules = DEFAULT_RULES, log = fal
}
s.stats.cardsDrawn = [0, 0];
say(s, `${playerName(s.firstPlayer)} goes first.`);
beginTurn(s, true);
beginTurn(s, !rules.firstTurn.draw);
run(s);
return s;
}
function beginTurn(s: GameState, skipDraw: boolean): void {
if (s.turn >= s.rules.maxTurns) {
const cmd = s.rules.commands.on;
if (s.turn >= s.rules.maxTurns * (cmd ? s.rules.commands.perPlayer : 1)) {
s.over = true;
s.endReason = 'turnLimit';
say(s, `Turn limit reached: draw (South ${gridCount(s, 0)}, North ${gridCount(s, 1)} locations).`);
@ -233,21 +272,34 @@ function beginTurn(s: GameState, skipDraw: boolean): void {
}
s.turn++;
s.clock = startOf(s.turn);
s.used = {};
// Command rule: a player's turn is their commands in a round, so its refreshes come at the first.
const fresh = !cmd || firstCommand(s, s.turn);
if (!cmd || roundOf(s, s.turn) !== roundOf(s, s.turn - 1)) s.used = {};
tidy(s);
const me = s.players[s.active];
for (const av of me.avatars) {
av.placed = false;
av.advanced = false;
av.attacks = 0;
if (fresh) {
for (const av of me.avatars) {
av.placed = false;
av.advanced = false;
av.attacks = 0;
}
}
s.declarations = [];
s.step = 'deploy';
say(s, `\n— Turn ${s.turn}: ${playerName(s.active)} (${me.ram} RAM, ${me.hand.length} cards, ${gridCount(s, s.active)} locations) —`);
if (!skipDraw) pushTasks(s, { t: 'draw', player: s.active });
emit(s, 'onTurnStart', null);
const title = cmd ? `Round ${roundOf(s, s.turn)}, command ${s.turn}` : `Turn ${s.turn}`;
say(s, `\n— ${title}: ${playerName(s.active)} (${me.ram} RAM, ${me.hand.length} cards, ${gridCount(s, s.active)} locations) —`);
const draws = s.rules.drawPerTurn + (s.turn === 2 ? s.rules.secondPlayer.firstDraw : 0);
if (fresh && !skipDraw) pushTasks(s, ...Array.from({ length: draws }, (): Task => ({ t: 'draw', player: s.active })));
if (fresh) emit(s, 'onTurnStart', null);
}
/** Command rule: this game turn's command is spent (an advance or attack is declared). */
const commandSpent = (s: GameState): boolean => s.rules.commands.on && s.declarations.length > 0;
/** Command rule: an Avatar unlocked this round waits in its slot until the next round. */
const waitsForRound = (s: GameState, av: AvatarState): boolean =>
s.rules.commands.on && av.at === null && av.unlockedTurn > 0 && roundOf(s, av.unlockedTurn) === roundOf(s, s.turn);
function endTurn(s: GameState): void {
s.clock = endOf(s.turn);
// Push Update: the extra Hardware leaves at the end of its controller's turn.
@ -264,7 +316,7 @@ function endTurn(s: GameState): void {
}
}
tidy(s);
s.active = other(s.active);
s.active = s.rules.commands.on ? commanderOf(s, s.turn + 1) : other(s.active);
beginTurn(s, false);
}
@ -321,7 +373,7 @@ export function maxAttacks(s: GameState, ref: AvatarRef): number {
export function attackTargets(s: GameState, ref: AvatarRef): LocId[] {
const av = avatar(s, ref);
if (!av.faceUp || av.at === null || av.advanced || av.attacks >= maxAttacks(s, ref) || !canAct(s, ref)) return [];
if (!av.faceUp || av.at === null || av.advanced || av.attacks >= maxAttacks(s, ref) || !canAct(s, ref) || freshCopy(s, ref)) return [];
const opp = other(ref.player);
return LINES_AT.get(av.at)!
.filter((line) => isOpen(s, line))
@ -507,14 +559,15 @@ export function legalActions(s: GameState): Action[] {
const ref = { player: p, slot: i + 1 };
if (!av.faceUp || av.advanced || av.attacks > 0) return;
if (av.at !== null && !canAct(s, ref)) return;
if (placementOpen && !av.placed) {
if (placementOpen && !av.placed && !waitsForRound(s, av)) {
for (const to of LOCATIONS) if (to !== av.at && hasRoom(s, p, to)) out.push({ type: 'place', slot: i + 1, to });
}
if (av.at !== null) for (const to of targets) out.push({ type: 'advance', slot: i + 1, to });
if (av.at !== null && !freshCopy(s, ref) && !commandSpent(s)) for (const to of targets) out.push({ type: 'advance', slot: i + 1, to });
});
pushClears(s, p, out);
} else if (s.step === 'attack') {
me.avatars.forEach((_, i) => {
if (commandSpent(s)) return;
for (const to of attackTargets(s, { player: p, slot: i + 1 })) out.push({ type: 'attack', slot: i + 1, to });
});
pushClears(s, p, out);
@ -531,6 +584,8 @@ export function legalActions(s: GameState): Action[] {
out.push({ type: 'installHardware', card, slot: ref.slot });
}
}
} else if (def.kind === 'avatar' && s.rules.recruit.on) {
if (def.ram <= me.ram) for (const slot of recruitSlots(s, p)) out.push({ type: 'recruit', card, slot });
} else if (def.kind === 'program') {
for (const at of LOCATIONS) {
if (controls(s, p, at) && s.locations[at].programs.length < programSlots(s, at) && programCost(s, p, card, at, all) <= me.ram) {
@ -539,6 +594,8 @@ export function legalActions(s: GameState): Action[] {
}
}
}
const sale = avatarForSale(s, p);
if (sale && sale.price <= me.ram) out.push({ type: 'buyAvatar', slot: sale.slot });
for (const line of LINES) {
if (!line.gateway || !(controls(s, p, line.a) || controls(s, p, line.b))) continue;
for (let level = (s.firewalls[line.id] ?? 0) + 1; level <= s.rules.firewallCost.length; level++) {
@ -560,6 +617,10 @@ export function actionCost(s: GameState, a: Action): number {
return firewallCost(s, s.firewalls[a.line] ?? 0);
case 'installHardware':
return hardwareCost(s, a.card, { player: p, slot: a.slot });
case 'recruit':
return defOf(s, a.card).ram;
case 'buyAvatar':
return avatarForSale(s, p)?.price ?? 0;
case 'installProgram':
return programCost(s, p, a.card, a.at);
case 'play':
@ -598,6 +659,10 @@ export function actionKey(a: Action): string {
return `salvage:${a.card}`;
case 'installHardware':
return `hw:${a.card}:${a.slot}`;
case 'recruit':
return `recruit:${a.card}:${a.slot}`;
case 'buyAvatar':
return `buy:${a.slot}`;
case 'installProgram':
return `prog:${a.card}:${a.at}`;
case 'play':
@ -653,6 +718,30 @@ export function applyAction(s: GameState, a: Action, legal: Action[] = legalActi
fn(s, ch.resume.data, option.value);
break;
}
case 'buyAvatar': {
const { price } = avatarForSale(s, p)!;
const av = me.avatars[a.slot - 1];
me.ram -= price;
stat(s, 'ramOnAvatars', p, price);
stat(s, 'avatarsBought', p);
av.faceUp = true;
say(s, `${who} buys Avatar ${a.slot}: ${nameOf(s, av.card)} (-${price} RAM, now ${me.ram}).`);
break;
}
case 'recruit': {
const cost = defOf(s, a.card).ram;
const av = me.avatars[a.slot - 1];
if (av.card >= 0) retireAvatar(s, ref(a.slot));
removeFrom(me.hand, a.card);
me.ram -= cost;
stat(s, 'ramOnCards', p, cost);
stat(s, 'avatarsRecruited', p);
played(s, nameOf(s, a.card), p);
Object.assign(av, newAvatar(a.card, true, null));
me.avatars[a.slot + 3].card = a.card;
say(s, `${who} recruits ${nameOf(s, a.card)} as Avatar ${a.slot} (-${cost} RAM, now ${me.ram}).`);
break;
}
case 'salvage': {
const gain = defOf(s, a.card).ram;
removeFrom(me.hand, a.card);

View file

@ -82,6 +82,18 @@ export function removeCopy(s: GameState, ref: AvatarRef): void {
dropFromCombat(s, ref);
}
/** Recruit rule: an Avatar recruited over leaves for the discard pile with its Hardware, and its copy leaves play. */
export function retireAvatar(s: GameState, ref: AvatarRef): void {
const av = avatar(s, ref);
removeCopy(s, copyOf(ref));
if (av.hardware.length) stat(s, 'hardwareLost', ref.player, av.hardware.length);
for (const hw of av.hardware) toDiscard(s, hw);
say(s, `${playerName(ref.player)} retires ${avatarName(s, ref)}${av.at ? ` from ${av.at}` : ''}.`);
dropFromCombat(s, ref);
toDiscard(s, av.card);
stat(s, 'avatarsRetired', ref.player);
}
/**
* The loser of a combat goes back to its slot. Its Hardware is discarded unless `keepHardware`,
* and its counters and effects are removed (Persistent Infection's counters stay).
@ -125,6 +137,7 @@ export function createCopy(s: GameState, original: AvatarRef, to: LocId): void {
disabledUntil: 0,
rootedUntil: 0,
breachedTurn: 0,
createdTurn: s.turn,
} satisfies Partial<AvatarState>);
say(s, `${playerName(ref.player)} creates ${avatarName(s, ref)} on ${to}.`);
}
@ -382,11 +395,13 @@ export function captureMain(s: GameState, ref: AvatarRef, loc: LocId, how: Captu
const from = previous === null ? '' : ` from ${playerName(previous)}`;
say(s, `${playerName(p)} captures ${loc}${from} (Lv ${level}) with ${L.server === null ? 'no Server' : nameOf(s, L.server)}: +${ram} RAM (now ${me.ram}).`);
if (level > me.unlockedLevel && turn1?.unlock !== false) {
const unlocks = !s.rules.recruit.on && !s.rules.buyAvatars.on;
if (unlocks && level > me.unlockedLevel && turn1?.unlock !== false) {
me.unlockedLevel = level;
me.avatars.slice(0, 4).forEach((av, i) => {
if (i < level && !av.faceUp) {
av.faceUp = true;
av.unlockedTurn = s.turn;
say(s, `${playerName(p)} unlocks Avatar ${i + 1}: ${nameOf(s, av.card)}.`);
}
});

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) {

View file

@ -24,6 +24,19 @@ export const programActive = (s: GameState, id: number): boolean =>
!running(s, s.cards[id].disabledUntil) && !running(s, s.cards[id].ignoredUntil);
export const hardwareActive = (s: GameState, id: number): boolean => !running(s, s.cards[id].disabledUntil);
/** Recruit rule: `p` has fewer than 4 Avatars, counting copies. Always true without the rule. */
export function avatarRoom(s: GameState, p: PlayerId): boolean {
if (!s.rules.recruit.on) return true;
const avs = s.players[p].avatars;
return avs.slice(0, 4).filter((a) => a.card >= 0).length + avs.slice(4).filter((a) => a.at !== null).length < 4;
}
/** Whether `p` may make a copy now: the copy-rule switches, and room under the recruit rule. */
export function canCopy(s: GameState, p: PlayerId): boolean {
const c = s.rules.copies;
return c.allowed && (!c.needAvatar2 || s.players[p].avatars[1].faceUp) && avatarRoom(s, p);
}
/** Everything with an effect in play right now. */
export function sources(s: GameState): Source[] {
const out: Source[] = [];

View file

@ -5,6 +5,8 @@
export interface RulesConfig {
startingRam: number;
openingHand: number;
/** Cards drawn in each turn's draw step. */
drawPerTurn: number;
/** Grid locations needed to win (starting Servers don't count). */
winLocations: number;
/** Player turns before the game is called a draw. */
@ -17,8 +19,9 @@ export interface RulesConfig {
deck: { avatars: number; servers: number; main: number; maxCopies: number };
/** Avatars face up at the start (rules: Avatar 1 only). */
startingAvatars: number;
/** What the first player may do on turn 1 (the rules allow everything). */
/** What the first player may do on turn 1 (the rules skip the draw and allow the rest). */
firstTurn: {
draw: boolean;
advance: boolean;
/** Captures pay capture RAM. A Server card's own RAM bonus is still paid. */
captureRam: boolean;
@ -29,25 +32,65 @@ export interface RulesConfig {
};
/**
* Catch-up for whoever goes second: extra starting RAM, extra Avatars face up, extra cards in the
* opening hand, and (0 or 1) owning the location next to their starting Server at the start.
* opening hand, extra cards in their first draw step, and (0 or 1) owning the location next to
* their starting Server at the start.
*/
secondPlayer: { ram: number; avatars: number; cards: number; locations: number };
secondPlayer: { ram: number; avatars: number; cards: number; firstDraw: number; locations: number };
/**
* Prototype: Avatars in the deck instead of level unlocks. You start with one Avatar; another
* `avatarsInDeck` are shuffled into the main deck (inside its size). On your turn (steps 3 and 6)
* pay an Avatar's price to recruit it from hand into an empty slot, or retire one of yours
* (discarding it and its Hardware) to recruit into its slot. At most 4 Avatars, copies included.
* Price = `price` + `pricePerCore` × Cores; it's also the card's salvage value.
*/
recruit: { on: boolean; avatarsInDeck: number; price: number; pricePerCore: number };
/**
* Prototype: buy Avatars instead of level unlocks. On your turn (steps 3 and 6) pay RAM to flip
* your next face-down Avatar; `prices` are for Avatars 2, 3 and 4.
*/
buyAvatars: { on: boolean; prices: number[] };
/**
* Copies (Carbon NanoBots' Replicate, Backup Server), for testing: whether they can be made at
* all; whether a new copy must wait for its owner's next turn to advance or attack (it can
* defend); whether making one needs Avatar 2 unlocked.
*/
copies: { allowed: boolean; waitATurn: boolean; needAvatar2: boolean };
/**
* Rounds of alternating commands (the rules since v0.8; off = the old one-turn-each structure).
* Each round both players get `perPlayer` commands, taken in turn. A command is one advance or one attack (or a pass),
* with placement and cards before it and cards after it. A player's "turn" is their commands in
* a round: the draw, turn-start effects and each Avatar's one action a round refresh at their
* first command; once-per-turn effects become once per round. Avatars unlocked during a round
* enter play from the next round.
* `leads` says who takes a round's first command, round after round (F = first player, S =
* second; the pattern repeats; "thue" is the Thue–Morse order F S S F S F F S…). `snake` orders
* a round's commands A B B A instead of A B A B.
*/
commands: { on: boolean; perPlayer: number; leads: string; snake: boolean };
}
export const DEFAULT_RULES: RulesConfig = {
startingRam: 4,
openingHand: 7,
drawPerTurn: 1,
winLocations: 10,
maxTurns: 200,
levelRam: { 1: 4, 2: 4, 3: 4, 4: 4, 5: 4 },
firewallCost: [2, 4, 8],
maxProgramsPerLocation: 2,
deck: { avatars: 4, servers: 20, main: 30, maxCopies: 2 },
deck: { avatars: 4, servers: 20, main: 45, maxCopies: 2 },
startingAvatars: 1,
firstTurn: { advance: true, captureRam: true, unlock: true, cards: true },
secondPlayer: { ram: 0, avatars: 0, cards: 0, locations: 0 },
firstTurn: { draw: false, advance: true, captureRam: true, unlock: true, cards: true },
secondPlayer: { ram: 0, avatars: 0, cards: 0, firstDraw: 0, locations: 0 },
recruit: { on: false, avatarsInDeck: 3, price: 6, pricePerCore: 0 },
buyAvatars: { on: false, prices: [8, 12, 16] },
copies: { allowed: true, waitATurn: false, needAvatar2: false },
commands: { on: true, perPlayer: 2, leads: 'FS', snake: true },
};
/** Avatars kept outside the main deck: all of them, or just the starting one when recruiting. */
export const avatarsOutside = (rules: RulesConfig): number => (rules.recruit.on ? 1 : rules.deck.avatars);
/**
* A copy of `rules` with one setting changed, from text like "winLocations=9",
* "secondPlayer.ram=4", "firstTurn.advance=false" or "levelRam=4,4,4,4,4" (Lv 1 to 5).
@ -71,6 +114,7 @@ export function withRule(rules: RulesConfig, spec: string): RulesConfig {
return n;
};
if (typeof old === 'number') obj[last] = num(raw);
else if (typeof old === 'string') obj[last] = raw;
else if (typeof old === 'boolean') {
if (raw !== 'true' && raw !== 'false') throw new Error(`Rule "${key}" needs true or false`);
obj[last] = raw === 'true';

View file

@ -56,8 +56,39 @@ export const fired = (s: GameState, name: string, p: PlayerId): void => void use
export const endOfTurn = (s: GameState): Clock => 2 * s.turn + 1;
export const startOf = (turn: number): Clock => 2 * turn;
export const endOf = (turn: number): Clock => 2 * turn + 1;
/** The turn number of `p`'s next turn (not the current one). */
export const nextTurnOf = (s: GameState, p: PlayerId): number => (s.active === p ? s.turn + 2 : s.turn + 1);
/** The turn number of `p`'s next turn (not the current one). Under the command rule, their next command. */
export function nextTurnOf(s: GameState, p: PlayerId): number {
if (!s.rules.commands.on) return s.active === p ? s.turn + 2 : s.turn + 1;
let t = s.turn + 1;
while (commanderOf(s, t) !== p) t++;
return t;
}
// Command rule: game turns are commands. A round is 2 × perPlayer of them, alternating players,
// and the lead alternates by round.
const commandsPerRound = (s: GameState): number => 2 * s.rules.commands.perPlayer;
/** Command rule: who takes game turn `turn`. */
export function commanderOf(s: GameState, turn: number): PlayerId {
const { leads, snake } = s.rules.commands;
const round = Math.floor((turn - 1) / commandsPerRound(s));
const i = (turn - 1) % commandsPerRound(s);
const ones = round.toString(2).split('1').length - 1;
const mark = leads === 'thue' ? 'FS'[ones % 2] : leads[round % leads.length];
if (mark !== 'F' && mark !== 'S') throw new Error(`commands.leads should use F and S, or be "thue": "${leads}"`);
const lead = mark === 'F' ? s.firstPlayer : other(s.firstPlayer);
const leadsThis = snake ? i % 4 === 0 || i % 4 === 3 : i % 2 === 0;
return leadsThis ? lead : other(lead);
}
/** Command rule: the round game turn `turn` belongs to, from 1. */
export const roundOf = (s: GameState, turn: number): number => Math.floor((turn - 1) / commandsPerRound(s)) + 1;
/** Command rule: whether `turn` is its commander's first command of the round. */
export const firstCommand = (s: GameState, turn: number): boolean => (turn - 1) % commandsPerRound(s) < 2;
/** Rounds played so far: both players taking a turn (or all their commands). */
export const roundsPlayed = (s: GameState): number => (s.rules.commands.on ? roundOf(s, s.turn) : Math.ceil(s.turn / 2));
export const running = (s: GameState, until: Clock): boolean => until > s.clock;
/** Once-per-turn bookkeeping. Returns how many times `key` was used this turn. */
@ -116,6 +147,10 @@ export function wearerOf(s: GameState, hw: number): AvatarRef | null {
export const isRooted = (s: GameState, r: AvatarRef): boolean => running(s, avatar(s, r).rootedUntil);
export const isDisabledAvatar = (s: GameState, r: AvatarRef): boolean => running(s, avatar(s, r).disabledUntil);
/** Can act: advance, attack, move, use its Ability. */
/** Copy-rule variant: a copy made this player-turn can't advance or attack yet. It can still defend. */
export const freshCopy = (s: GameState, r: AvatarRef): boolean =>
isCopy(r) && s.rules.copies.waitATurn && avatar(s, r).createdTurn === s.turn;
export const canAct = (s: GameState, r: AvatarRef): boolean =>
inPlay(s, r) && !isRooted(s, r) && !isDisabledAvatar(s, r);

View file

@ -1,5 +1,6 @@
import type { CardPool } from './cards.ts';
import { gridCount } from './engine.ts';
import { roundsPlayed } from './state.ts';
import { STAT_KEYS, type CardUse, type GameState, type StatKey } from './types.ts';
export interface GameRecord {
@ -7,6 +8,7 @@ export interface GameRecord {
winner: 0 | 1 | null;
firstPlayer: 0 | 1;
turns: number;
rounds: number;
locations: [number, number];
stats: Record<StatKey, [number, number]>;
cardUse: Record<string, CardUse>;
@ -31,6 +33,7 @@ export function recordOf(seed: number, s: GameState): GameRecord {
winner: s.winner,
firstPlayer: s.firstPlayer,
turns: s.turn,
rounds: roundsPlayed(s),
locations: [gridCount(s, 0), gridCount(s, 1)],
stats: s.stats,
cardUse: s.cardUse,
@ -38,8 +41,7 @@ export function recordOf(seed: number, s: GameState): GameRecord {
};
}
/** Rounds: both players taking one turn each. */
const roundsOf = (r: GameRecord) => Math.ceil(r.turns / 2);
const roundsOf = (r: GameRecord) => r.rounds;
export function summarize(records: GameRecord[]): BatchSummary {
const n = records.length;
@ -79,7 +81,7 @@ export function formatSummary(sum: BatchSummary, labels: [string, string]): stri
' Draws (turn limit)'.padEnd(36) + pct(sum.draws, sum.games),
' First player wins'.padEnd(36) + `${pct(sum.firstPlayerWins, decided)} of decided games`,
'',
'Game length, in rounds (both players take a turn)',
'Game length, in rounds (every player takes all their commands, or a turn)',
` mean ${fmt(sum.rounds.mean)} · median ${sum.rounds.median} · 10% of games ≤ ${sum.rounds.p10} · 90% ≤ ${sum.rounds.p90}`,
'',
row('Average per player, per game', labels[0], labels[1]),

View file

@ -83,6 +83,10 @@ export interface AvatarState {
breachedTurn: number;
/** For copies: the original's slot. */
copyOf: number | null;
/** For copies: the player-turn it was made. */
createdTurn: number;
/** The game turn its level unlock happened (0 if it started face up). */
unlockedTurn: number;
}
export interface PlayerState {
@ -252,6 +256,10 @@ export type Action =
| { type: 'firewall'; line: string; level: number }
| { type: 'salvage'; card: number }
| { type: 'installHardware'; card: number; slot: number }
/** Recruit rule: an Avatar from hand into `slot`, retiring the Avatar there if there is one. */
| { type: 'recruit'; card: number; slot: number }
/** Buy-Avatars rule: flip Avatar `slot`, the next face-down one, for its price. */
| { type: 'buyAvatar'; slot: number }
| { type: 'installProgram'; card: number; at: LocId }
| { type: 'play'; card: number; target: LocId | null; args: Args; from: LocId | null }
| { type: 'activate'; card: number; name: string; args: Args };
@ -280,6 +288,10 @@ export const STAT_KEYS = [
'programsLost',
'executionsPlayed',
'abilitiesUsed',
'avatarsRecruited',
'avatarsRetired',
'avatarsBought',
'ramOnAvatars',
] as const;
export type StatKey = (typeof STAT_KEYS)[number];

View file

@ -2,6 +2,7 @@ import assert from 'node:assert/strict';
import { test } from 'node:test';
import { avatarCores, openWindow } from '../src/engine.ts';
import { hasRoom } from '../src/query.ts';
import { withRule } from '../src/rules.ts';
import { card } from './card.ts';
import { Table, type Side } from './table.ts';
@ -39,6 +40,35 @@ card('Carbon NanoBots', () => {
assert.equal(t.avatar(0, 1).hardware.length, 1);
});
test('copy rule variants: a new copy defends but only advances or attacks from its next turn', () => {
const t = scene('Carbon NanoBots', 'Broken Bits');
t.s.rules = withRule(t.s.rules, 'copies.waitATurn=true');
t.own(0, 'A2');
t.ram(0, 5).use(avatarCard(t, 0, 1), { to: 'A2' }).settle();
assert.equal(t.avatar(0, 5).at, 'A2', 'the copy is in play, defending A2');
const acts = () => t.legal().filter((a) => (a.type === 'advance' || a.type === 'attack') && a.slot === 5);
assert.deepEqual(acts(), []);
assert.ok(t.legal().some((a) => a.type === 'advance' && a.slot === 1), 'the original still can');
t.to('attack');
assert.deepEqual(acts(), []);
t.to('playAgain').end().to('playAgain').end();
assert.ok(acts().length > 0, 'next turn it can advance');
});
test('copy rule variants: copies can need Avatar 2 unlocked, or be off', () => {
const t = scene('Carbon NanoBots', 'Broken Bits');
t.own(0, 'A2');
t.ram(0, 5);
const replicate = () => t.legal().some((a) => a.type === 'activate' && a.name === 'Carbon NanoBots');
assert.ok(replicate());
t.s.rules = withRule(t.s.rules, 'copies.needAvatar2=true');
assert.ok(!replicate(), 'Avatar 2 is still face down');
t.avatar(0, 2).faceUp = true;
assert.ok(replicate());
t.s.rules = withRule(t.s.rules, 'copies.allowed=false');
assert.ok(!replicate());
});
test('no copy can enter a location while a combat is going on there', () => {
const t = scene('Broken Bits', 'Carbon NanoBots', { north: { servers: ['Cluster Server'] } });
t.own(1, 'C1', 'Cluster Server');
@ -86,14 +116,14 @@ card('Beta Version 1.0', () => {
card('Code Zero', () => {
const t = scene('Broken Bits', 'Code Zero');
t.avatar(0, 1).infection = 1;
t.ram(1, 4);
fight(t);
assert.equal(t.decider, 1);
t.rig(6, 6, 6, 1, 1);
t.rig(6, 6, 6, 1, 1, 1);
t.use(avatarCard(t, 1, 1)).settle();
assert.equal(t.avatar(0, 1).infection >= 2 || t.avatar(0, 1).at === null, true);
assert.equal(dice(t, 'atk'), 3, '2 Infection counters: -1 Core while Code Zero is in play');
assert.equal(t.avatar(0, 1).infection >= 1 || t.avatar(0, 1).at === null, true);
assert.equal(dice(t, 'atk'), 3, '1 Infection counter: -1 Core while Code Zero is in play');
assert.equal(dice(t, 'def'), 3, 'Code Zero has 3 Cores');
});
card('Data Leaker', () => {

View file

@ -5,7 +5,8 @@ import { randomDeck } from '../src/deck.ts';
import { advanceTargets, avatarCores, createGame, legalActions, viewFor } from '../src/engine.ts';
import { checkInvariants } from '../src/invariants.ts';
import { makeRng } from '../src/rng.ts';
import { DEFAULT_RULES, withRule } from '../src/rules.ts';
import { DEFAULT_RULES, withRule, type RulesConfig } from '../src/rules.ts';
import { commanderOf, roundOf } from '../src/state.ts';
import { Table } from './table.ts';
const pool = loadCards();
@ -36,6 +37,31 @@ test('the first player skips the draw; the second player draws', () => {
assert.equal(t.s.players[1].hand.length, 1);
});
test('rule variants: the first player draws on turn 1', () => {
const pool = loadCards();
const hand = (rules: RulesConfig) => {
const s = createGame({ pool, decks: [randomDeck(pool, makeRng(1), rules), randomDeck(pool, makeRng(2), rules)], seed: 5, rules });
return s.players[s.firstPlayer].hand.length;
};
assert.equal(hand(withRule(DEFAULT_RULES, 'firstTurn.draw=true')), hand(DEFAULT_RULES) + 1);
});
test('rule variants: the second player draws extra in their first draw step only', () => {
const t = new Table({ north: { main: ['Additional Core', 'Additional Core', 'Additional Core', 'Additional Core'] } });
t.s.rules = withRule(t.s.rules, 'secondPlayer.firstDraw=1');
t.to('playAgain').end();
assert.equal(t.s.players[1].hand.length, 2);
t.to('playAgain').end().to('playAgain').end();
assert.equal(t.s.players[1].hand.length, 3);
});
test('rule variants: more cards per draw step', () => {
const t = new Table({ north: { main: ['Additional Core', 'Additional Core'] } });
t.s.rules = withRule(t.s.rules, 'drawPerTurn=2');
t.to('playAgain').end();
assert.equal(t.s.players[1].hand.length, 2);
});
test('advancing captures an unowned location in step 5 and pays 4 RAM; Lv 1 unlocks nothing', () => {
const t = new Table();
t.ram(0, 4);
@ -240,3 +266,200 @@ test('an opponent with a response gets a window after a declaration; without one
t.act({ type: 'pass' });
assert.equal(t.decider, 0);
});
// ---------------------------------------------------------------------------------------------
// Recruit rule (prototype): Avatars in the deck, bought with RAM
/** A table under the recruit rule: Avatar 1 stays, Avatars 2–4 move to their owner's hand, priced at 6 RAM. */
function recruitTable(o: ConstructorParameters<typeof Table>[0] = {}): Table {
const t = new Table(o);
t.s.rules = withRule(t.s.rules, 'recruit.on=true');
for (const p of [0, 1] as const) {
const avs = t.s.players[p].avatars;
for (let i = 1; i < 4; i++) {
const name = t.s.cards[avs[i].card].name;
t.s.defs[name] = { ...t.s.defs[name], ram: 6 };
t.s.players[p].hand.push(avs[i].card);
avs[i].card = avs[i + 4].card = -1;
avs[i].faceUp = false;
}
}
return t;
}
const recruits = (t: Table) => t.legal().filter((a) => a.type === 'recruit');
test('recruit rule: buy an Avatar from hand into an empty slot; it enters play on a later turn', () => {
const t = recruitTable();
const card = t.s.players[0].hand[0];
t.ram(0, 5).to('play');
assert.equal(recruits(t).length, 0, "can't afford 6 RAM");
t.ram(0, 6);
assert.deepEqual(recruits(t).map((a) => a.type === 'recruit' && a.slot), [2, 1, 2, 1, 2, 1], 'first empty slot, or over Avatar 1');
t.go({ type: 'recruit', card, slot: 2 });
assert.equal(t.s.players[0].ram, 0);
assert.equal(t.avatar(0, 2).card, card);
assert.equal(t.avatar(0, 2).faceUp, true);
assert.ok(!t.s.players[0].hand.includes(card));
t.to('playAgain').end().to('playAgain').end();
assert.ok(t.can({ type: 'place', slot: 2, to: 'S1' }));
});
test('recruit rule: captures unlock nothing, and a salvaged Avatar pays its price', () => {
const t = recruitTable();
t.own(0, 'B1');
t.place(0, 1, 'B1');
t.go({ type: 'advance', slot: 1, to: 'C2' }).to('attack').end();
assert.equal(t.s.locations.C2.owner, 0);
assert.equal(t.avatar(0, 2).card, -1);
const ram = t.s.players[0].ram;
t.go({ type: 'salvage', card: t.s.players[0].hand[0] });
assert.equal(t.s.players[0].ram, ram + 6);
});
test('recruit rule: copies count toward the 4 Avatars', () => {
const t = recruitTable({ south: { avatars: ['Carbon NanoBots', 'Broken Bits', 'Pixelated Picture', 'Corrupt Driver'] } });
t.own(0, 'A2');
t.place(0, 1, 'A2');
const [a, b] = t.s.players[0].hand;
t.ram(0, 30).to('play');
t.go({ type: 'recruit', card: a, slot: 2 }).go({ type: 'recruit', card: b, slot: 3 });
const replicate = t.legal().find((x) => x.type === 'activate' && x.name === 'Carbon NanoBots' && x.args.to === 'S1');
assert.ok(replicate, '3 Avatars, so a copy fits');
t.go(replicate).settle();
assert.equal(t.avatar(0, 5).at, 'S1');
assert.ok(!recruits(t).some((r) => r.type === 'recruit' && r.slot === 4), 'no room for a fourth with the copy out');
});
test('recruit rule: recruiting over an Avatar retires it and its Hardware', () => {
const t = recruitTable({ south: { main: ['Additional Core'] } });
t.own(0, 'A2');
const ref = t.place(0, 1, 'A2');
const old = t.avatar(0, 1).card;
const hw = t.hardware(ref.player, ref.slot, 'Additional Core');
const card = t.s.players[0].hand.find((id) => t.s.defs[t.s.cards[id].name].kind === 'avatar')!;
t.ram(0, 6).to('play').go({ type: 'recruit', card, slot: 1 });
assert.equal(t.avatar(0, 1).card, card);
assert.equal(t.avatar(0, 1).at, null);
assert.deepEqual(t.avatar(0, 1).hardware, []);
assert.ok(t.s.players[0].discard.includes(old) && t.s.players[0].discard.includes(hw));
assert.equal(t.s.locations.A2.owner, 0, 'the location stays yours');
});
test('recruit rule: decks keep one Avatar outside and shuffle the rest into the main deck', () => {
const pool = loadCards();
const rules = withRule(withRule(DEFAULT_RULES, 'recruit.on=true'), 'recruit.avatarsInDeck=5');
const deck = randomDeck(pool, makeRng(3), rules);
assert.equal(deck.avatars.length, 1);
assert.equal(deck.main.length, 45);
assert.equal(deck.main.filter((n) => pool.byName.get(n)!.kind === 'avatar').length, 5);
const s = createGame({ pool, decks: [deck, randomDeck(pool, makeRng(4), rules)], seed: 1, rules });
assert.deepEqual(s.players[0].avatars.slice(0, 4).map((a) => a.card >= 0), [true, false, false, false]);
assert.equal(checkInvariants(s).length, 0);
});
// ---------------------------------------------------------------------------------------------
// Buy-Avatars rule (prototype): pay RAM to flip the next Avatar instead of unlocking by level
test('buy rule: pay to flip the next face-down Avatar; it enters play on a later turn', () => {
const t = new Table();
t.s.rules = withRule(withRule(t.s.rules, 'buyAvatars.on=true'), 'buyAvatars.prices=8,12,16');
t.ram(0, 7).to('play');
assert.ok(!t.can({ type: 'buyAvatar', slot: 2 }), "can't afford 8 RAM");
t.ram(0, 20).go({ type: 'buyAvatar', slot: 2 });
assert.equal(t.avatar(0, 2).faceUp, true);
assert.equal(t.s.players[0].ram, 12);
assert.ok(t.can({ type: 'buyAvatar', slot: 3 }), 'Avatar 3 is next, at 12');
t.go({ type: 'buyAvatar', slot: 3 });
assert.equal(t.s.players[0].ram, 0);
t.to('playAgain').end().to('playAgain').end();
assert.ok(t.can({ type: 'place', slot: 2, to: 'S1' }));
});
test('buy rule: captures unlock nothing', () => {
const t = new Table();
t.s.rules = withRule(t.s.rules, 'buyAvatars.on=true');
t.own(0, 'B1');
t.place(0, 1, 'B1');
t.go({ type: 'advance', slot: 1, to: 'C2' }).to('attack').end();
assert.equal(t.s.locations.C2.owner, 0);
assert.deepEqual([t.avatar(0, 2).faceUp, t.avatar(0, 3).faceUp], [false, false]);
});
// ---------------------------------------------------------------------------------------------
// Command rule (prototype): alternating commands, 2 per player per round
/** Command rule with plain A B A B rounds, so tests can predict whose command it is. */
function commandTable(): Table {
const t = new Table();
t.s.rules = withRule(withRule(t.s.rules, 'commands.on=true'), 'commands.snake=false');
return t;
}
test('command rule: players alternate commands, and the lead alternates by round', () => {
const t = commandTable();
assert.deepEqual([1, 2, 3, 4, 5, 6, 7, 8, 9].map((turn) => commanderOf(t.s, turn)), [0, 1, 0, 1, 1, 0, 1, 0, 0]);
assert.deepEqual([1, 4, 5, 8, 9].map((turn) => roundOf(t.s, turn)), [1, 1, 2, 2, 3]);
t.to('playAgain').end();
assert.equal(t.s.active, 1);
t.to('playAgain').end().to('playAgain').end().to('playAgain').end();
assert.equal(t.s.turn, 5);
assert.equal(t.s.active, 1, 'North leads round 2');
});
test('command rule: the order of commands can follow a pattern of round leads, or snake', () => {
const order = (...specs: string[]) => {
const t = commandTable();
for (const sp of specs) t.s.rules = withRule(t.s.rules, sp);
return Array.from({ length: 16 }, (_, i) => 'FS'[commanderOf(t.s, i + 1)]).join('');
};
assert.equal(order(), 'FSFS' + 'SFSF' + 'FSFS' + 'SFSF');
assert.equal(order('commands.leads=F'), 'FSFS'.repeat(4));
assert.equal(order('commands.leads=FFSS'), 'FSFS' + 'FSFS' + 'SFSF' + 'SFSF');
assert.equal(order('commands.leads=thue'), 'FSFS' + 'SFSF' + 'SFSF' + 'FSFS');
assert.equal(order('commands.snake=true', 'commands.leads=F'), 'FSSF'.repeat(4));
assert.equal(order('commands.snake=true'), 'FSSF' + 'SFFS' + 'FSSF' + 'SFFS', 'the default order');
assert.equal(DEFAULT_RULES.commands.snake, true);
});
test('command rule: one advance or attack per command, each Avatar once a round', () => {
const t = commandTable();
t.own(0, 'A2');
t.own(0, 'A1');
t.place(0, 1, 'A2');
t.place(0, 2, 'A1');
t.go({ type: 'advance', slot: 1, to: 'A3' });
assert.ok(!t.legal().some((a) => a.type === 'advance'), 'the command is spent');
t.to('attack');
assert.ok(!t.legal().some((a) => a.type === 'attack'));
t.to('playAgain').end().to('playAgain').end();
assert.equal(t.s.turn, 3);
const movers = new Set(t.legal().filter((a) => a.type === 'advance').map((a) => a.type === 'advance' && a.slot));
assert.deepEqual([...movers], [2], 'Avatar 1 already acted this round');
});
test('command rule: an Avatar unlocked this round enters play next round', () => {
const t = commandTable();
t.own(0, 'A2');
t.place(0, 1, 'A2');
t.go({ type: 'advance', slot: 1, to: 'B1' }).to('attack').end();
assert.equal(t.avatar(0, 2).faceUp, true);
t.to('playAgain').end().to('playAgain').end();
assert.equal(t.s.turn, 3);
assert.ok(!t.legal().some((a) => a.type === 'place' && a.slot === 2));
t.to('playAgain').end().to('playAgain').end().to('playAgain').end();
assert.equal(t.s.turn, 6);
assert.ok(t.legal().some((a) => a.type === 'place' && a.slot === 2));
});
test('command rule: each player draws at their first command of a round only', () => {
const t = commandTable();
const hand = () => t.s.players[1].hand.length;
t.to('playAgain').end();
assert.equal(hand(), 1, "North's first command of round 1");
t.to('playAgain').end().to('playAgain').end();
assert.equal(hand(), 1, 'no draw on the second command');
t.to('playAgain').end();
assert.equal(t.s.turn, 5);
assert.equal(hand(), 2, 'round 2');
});

View file

@ -4,6 +4,7 @@ import { DEFAULT_GREEDY, greedyBot } from '../src/bots/greedy.ts';
import { randomBot } from '../src/bots/random.ts';
import { loadCards } from '../src/cards.ts';
import { playGame } from '../src/play.ts';
import { DEFAULT_RULES, withRule } from '../src/rules.ts';
const pool = loadCards();
@ -26,6 +27,42 @@ test('greedy bots play 200 games without breaking a rule', () => {
assert.ok(wins >= 196, `only ${wins}/200 games ended in a win`);
});
test('bots play the recruit rule without breaking a rule', () => {
for (const k of [3, 7]) {
const rules = withRule(withRule(DEFAULT_RULES, 'recruit.on=true'), `recruit.avatarsInDeck=${k}`);
for (let seed = 1; seed <= 25; seed++) {
assert.ok(playGame({ pool, bots: [randomBot, randomBot], seed, rules, check: true }).over);
assert.ok(playGame({ pool, bots: [() => greedyBot(), () => greedyBot()], seed, rules, check: true }).over);
}
}
});
test('bots play the buy-Avatars rule without breaking a rule', () => {
const rules = withRule(DEFAULT_RULES, 'buyAvatars.on=true');
for (let seed = 1; seed <= 25; seed++) {
assert.ok(playGame({ pool, bots: [randomBot, randomBot], seed, rules, check: true }).over);
assert.ok(playGame({ pool, bots: [() => greedyBot(), () => greedyBot()], seed, rules, check: true }).over);
}
});
test('bots play the copy-rule variants without breaking a rule', () => {
for (const spec of ['copies.waitATurn=true', 'copies.needAvatar2=true', 'copies.allowed=false']) {
const rules = withRule(DEFAULT_RULES, spec);
for (let seed = 1; seed <= 15; seed++) {
assert.ok(playGame({ pool, bots: [randomBot, randomBot], seed, rules, check: true }).over);
assert.ok(playGame({ pool, bots: [() => greedyBot(), () => greedyBot()], seed, rules, check: true }).over);
}
}
});
test('bots play the command rule without breaking a rule', () => {
const rules = withRule(DEFAULT_RULES, 'commands.on=true');
for (let seed = 1; seed <= 25; seed++) {
assert.ok(playGame({ pool, bots: [randomBot, randomBot], seed, rules, check: true }).over);
assert.ok(playGame({ pool, bots: [() => greedyBot(), () => greedyBot()], seed, rules, check: true }).over);
}
});
test('greedy beats random', () => {
let wins = 0;
for (let seed = 1; seed <= 100; seed++) {

View file

@ -36,8 +36,11 @@ export class Table {
main: [...(x.main ?? []), ...Array(12).fill(FILLER)],
});
const decks = [side(o.south), side(o.north)] as const;
// Classic turns (one turn each, every Avatar acts), which the card tests are written for. The
// command rule has its own tests in engine.test.ts.
const rules: RulesConfig = {
...DEFAULT_RULES,
commands: { ...DEFAULT_RULES.commands, on: false },
openingHand: 0,
deck: { avatars: 4, servers: decks[0].servers.length, main: decks[0].main.length, maxCopies: 99 },
};