Files
card/CLAUDE.md
2026-05-24 08:10:22 +08:00

37 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 战国卡牌 - 水墨风云
春秋战国主题卡牌对战游戏,基于 pygame 构建,国风水墨视觉风格。
## 运行方式
```bash
pip install -r requirements.txt
python -m card_game.main
```
## 架构
```
card_game/
config.py — 常量、水墨色板、卡牌数据库(80+张)、阵营定义、预设卡组
card.py — Card 类(单位/指令卡)
deck.py — Deck 类(组牌、洗牌、抽牌)
factions.py — 阵营被动技能系统
utils.py — 工具函数
player.py — Player 类手牌、营地、前线、HP、粮草
ink_style.py — 水墨风格绘制原语(宣纸纹理、毛笔笔触、印章、卷轴等)
effects.py — 视觉特效(浮动文字、攻击线、墨花飞溅)
battlefield.py — 核心游戏逻辑(战斗、指令、回合管理)
ai.py — AI 决策(规则驱动)
ui.py — 所有 UI 渲染(使用 ink_style 水墨风格)
main.py — 主循环、状态机
```
## 游戏规则
- 7 个阵营(战国七雄):秦、齐、楚、燕、韩、赵、魏
- 30 张牌组,起始 4 张手牌,最多 8 张
- 粮草系统:每回合获得 turn+1 粮草(上限 10
- 战场:营地(5槽+都城) → 前线(5槽) → 对手
- 胜利条件:将对方都城 HP 降为 0