Files
card_game/docs/RULES.md
T
chenmoranzhiandCursor 06eb360fbf 把规则、架构与实现路线写成仓库文档。
后续改内容或结算顺序时有冻结依据,不必再翻原始稿才能对齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-09 02:04:20 +08:00

2.1 KiB
Raw Blame History

RULES

Game grammar for the simulation. Aligned with Core Game Rules · v0.1 and the CLI combat slice.

Entities and zones

Long-lived combat entities share one battlefield (Board, capacity 10 including system fields).

Zones: deck, hand, board, graveyard. Card type 场域 is FieldCard.

CardInstance keeps current Cost / stats / HolderId across zone moves. CardDefinition is the template only.

Faction & Holder

A player’s held cards from all factions merge into one shared deck/hand/graveyard for combat. HolderId records which faction owns the instance (for upgrades). Who may draw/play is not limited by Holder.

In-run progression (CLI full run)

RunProgress owns the persistent card list between fights. Combat mutations do not write back; only reward adds and explicit simple upgrades (ReduceCost / +Attack / +Health) change owned copies. RunStats and pack unlock evaluation are live for the current run and reset when the run ends.

Economy

No automatic mana ramp. Energy persists and increases when effects/fields GenerateEnergy (supply).

Guaranteed system field (card.system.base_field): 0C, TurnStart supply 1, countdown 3. Placed on board at match start; not part of the 8+8 held cards; not in the draw pile.

Attack & Activate

Independent once-per-turn resources (AttacksRemaining, ActivatesRemaining).

  • Enter on your turn: attack count 0, activate count 1 (if any).
  • Enter via opponent-turn-end summon: next BeginTurn grants attack count.
  • Attack requires effective attack > 0.
  • Activate does not consume attack and may be used the turn a creature enters.

Damage / Heal

Events record Requested and Applied amounts. Applied may be 0.

Countdown

At end of controller’s turn, countdown > 0 decreases by 1; at 0 the entity is destroyed (including system field).

Triggers (v1)

TurnStart, OnDestroyed, OnEnterBoard (listeners when a creature enters), OpponentTurnEnd, OnSupply.

Core actions

Unchanged 11-action dictionary in docs/DESIGN.md.

Randomness

Only GameRng. Same seed + action log must replay.