skilluno 1.12.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. skilluno-1.12.1/LICENSE +21 -0
  2. skilluno-1.12.1/PKG-INFO +291 -0
  3. skilluno-1.12.1/README.md +280 -0
  4. skilluno-1.12.1/pyproject.toml +27 -0
  5. skilluno-1.12.1/setup.cfg +4 -0
  6. skilluno-1.12.1/src/skilluno.egg-info/PKG-INFO +291 -0
  7. skilluno-1.12.1/src/skilluno.egg-info/SOURCES.txt +77 -0
  8. skilluno-1.12.1/src/skilluno.egg-info/dependency_links.txt +1 -0
  9. skilluno-1.12.1/src/skilluno.egg-info/entry_points.txt +2 -0
  10. skilluno-1.12.1/src/skilluno.egg-info/requires.txt +1 -0
  11. skilluno-1.12.1/src/skilluno.egg-info/top_level.txt +1 -0
  12. skilluno-1.12.1/src/uno/__init__.py +1 -0
  13. skilluno-1.12.1/src/uno/achievements.py +105 -0
  14. skilluno-1.12.1/src/uno/archive.py +63 -0
  15. skilluno-1.12.1/src/uno/combo_base.py +7 -0
  16. skilluno-1.12.1/src/uno/core.py +912 -0
  17. skilluno-1.12.1/src/uno/enabled.py +61 -0
  18. skilluno-1.12.1/src/uno/main.py +148 -0
  19. skilluno-1.12.1/src/uno/mod_index.py +208 -0
  20. skilluno-1.12.1/src/uno/mod_store/__init__.py +4 -0
  21. skilluno-1.12.1/src/uno/mod_store/cli.py +368 -0
  22. skilluno-1.12.1/src/uno/mod_store/collection_view.py +69 -0
  23. skilluno-1.12.1/src/uno/mod_store/collections.py +52 -0
  24. skilluno-1.12.1/src/uno/mod_store/confirm.py +125 -0
  25. skilluno-1.12.1/src/uno/mod_store/context.py +12 -0
  26. skilluno-1.12.1/src/uno/mod_store/detail.py +147 -0
  27. skilluno-1.12.1/src/uno/mod_store/downloader.py +232 -0
  28. skilluno-1.12.1/src/uno/mod_store/enable.py +55 -0
  29. skilluno-1.12.1/src/uno/mod_store/history.py +98 -0
  30. skilluno-1.12.1/src/uno/mod_store/history_view.py +93 -0
  31. skilluno-1.12.1/src/uno/mod_store/input_handler.py +218 -0
  32. skilluno-1.12.1/src/uno/mod_store/main.py +65 -0
  33. skilluno-1.12.1/src/uno/mod_store/menu.py +236 -0
  34. skilluno-1.12.1/src/uno/mod_store/render.py +158 -0
  35. skilluno-1.12.1/src/uno/mod_store/router.py +389 -0
  36. skilluno-1.12.1/src/uno/mod_store/search.py +131 -0
  37. skilluno-1.12.1/src/uno/mod_store/uninstall_confirm.py +59 -0
  38. skilluno-1.12.1/src/uno/mod_store/uninstaller.py +48 -0
  39. skilluno-1.12.1/src/uno/mod_store/updater.py +113 -0
  40. skilluno-1.12.1/src/uno/mod_store/validator.py +81 -0
  41. skilluno-1.12.1/src/uno/mod_store/web_open.py +22 -0
  42. skilluno-1.12.1/src/uno/paths.py +12 -0
  43. skilluno-1.12.1/src/uno/presets.py +59 -0
  44. skilluno-1.12.1/src/uno/replay.py +145 -0
  45. skilluno-1.12.1/src/uno/season1.py +546 -0
  46. skilluno-1.12.1/src/uno/season2.py +448 -0
  47. skilluno-1.12.1/src/uno/season3.py +3 -0
  48. skilluno-1.12.1/src/uno/season4.py +420 -0
  49. skilluno-1.12.1/src/uno/skills_uno.py +133 -0
  50. skilluno-1.12.1/src/uno/stats.py +289 -0
  51. skilluno-1.12.1/src/uno/ui.py +97 -0
  52. skilluno-1.12.1/tests/test_core.py +3276 -0
  53. skilluno-1.12.1/tests/test_mod_index.py +250 -0
  54. skilluno-1.12.1/tests/test_mod_index_get_by_id.py +49 -0
  55. skilluno-1.12.1/tests/test_mod_store_cli.py +321 -0
  56. skilluno-1.12.1/tests/test_mod_store_collection_view.py +79 -0
  57. skilluno-1.12.1/tests/test_mod_store_collections.py +80 -0
  58. skilluno-1.12.1/tests/test_mod_store_confirm.py +120 -0
  59. skilluno-1.12.1/tests/test_mod_store_coverage.py +486 -0
  60. skilluno-1.12.1/tests/test_mod_store_detail.py +121 -0
  61. skilluno-1.12.1/tests/test_mod_store_downloader.py +300 -0
  62. skilluno-1.12.1/tests/test_mod_store_enable.py +73 -0
  63. skilluno-1.12.1/tests/test_mod_store_history.py +169 -0
  64. skilluno-1.12.1/tests/test_mod_store_history_integration.py +103 -0
  65. skilluno-1.12.1/tests/test_mod_store_history_view.py +105 -0
  66. skilluno-1.12.1/tests/test_mod_store_integration.py +249 -0
  67. skilluno-1.12.1/tests/test_mod_store_menu.py +187 -0
  68. skilluno-1.12.1/tests/test_mod_store_menu_limit.py +84 -0
  69. skilluno-1.12.1/tests/test_mod_store_render.py +123 -0
  70. skilluno-1.12.1/tests/test_mod_store_search.py +248 -0
  71. skilluno-1.12.1/tests/test_mod_store_uninstall_confirm.py +65 -0
  72. skilluno-1.12.1/tests/test_mod_store_uninstaller.py +79 -0
  73. skilluno-1.12.1/tests/test_mod_store_updater.py +117 -0
  74. skilluno-1.12.1/tests/test_mod_store_validator.py +146 -0
  75. skilluno-1.12.1/tests/test_mod_store_web_open.py +73 -0
  76. skilluno-1.12.1/tests/test_skills_uno_enabled_integration.py +47 -0
  77. skilluno-1.12.1/tests/test_uno_enabled.py +62 -0
  78. skilluno-1.12.1/tests/test_uno_paths.py +22 -0
  79. skilluno-1.12.1/tests/test_web_integrity.py +123 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zhuyiming0208
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,291 @@
1
+ Metadata-Version: 2.4
2
+ Name: skilluno
3
+ Version: 1.12.1
4
+ Summary: 一个基于 Python 的 UNO 卡牌游戏框架
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: rich>=13.0
10
+ Dynamic: license-file
11
+
12
+ ![Python Tests](https://github.com/zhuyiming0208/SkillUNO/actions/workflows/test.yml/badge.svg)
13
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
14
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)
15
+
16
+ # SkillUNO
17
+
18
+ > 一个基于 Python 的 UNO 卡牌游戏框架,支持 Mod 化技能、赛季、成就、回放、热座模式、CLI 商店与网页版商店。
19
+
20
+ *(部分代码由 AI 辅助生成)*
21
+
22
+ ---
23
+
24
+ ## 目录
25
+
26
+ - [游戏截图](#游戏截图)
27
+ - [特性](#特性)
28
+ - [快速开始](#快速开始)
29
+ - [使用方式](#使用方式)
30
+ - [交互式菜单](#交互式菜单)
31
+ - [CLI 子命令](#cli-子命令)
32
+ - [模组系统](#模组系统)
33
+ - [安装社区模组](#安装社区模组)
34
+ - [制作自己的模组](#制作自己的模组)
35
+ - [网页版商店](#网页版商店)
36
+ - [项目结构](#项目结构)
37
+ - [开发](#开发)
38
+ - [兼容性](#兼容性)
39
+ - [文档](#文档)
40
+ - [许可证](#许可证)
41
+
42
+ ---
43
+
44
+ ## 游戏截图
45
+
46
+ ![游戏界面 1](https://cdn.jsdelivr.net/gh/zhuyiming0208/SkillUNO@main/docs/screenshots/gameplay1.jpg)
47
+
48
+ ![游戏界面 2](https://cdn.jsdelivr.net/gh/zhuyiming0208/SkillUNO@main/docs/screenshots/gameplay2.jpg)
49
+
50
+ ---
51
+
52
+ ## 特性
53
+
54
+ | 特性 | 说明 |
55
+ |---|---|
56
+ | **事件驱动技能系统** | 技能通过订阅游戏事件(GAME_START / TURN_START / BEING_ADDED_CARDS 等)触发,支持自动与手动激活 |
57
+ | **赛季系统** | 内置 S1 经典 / S2 被动觉醒 / S3 同盟 / S4 补丁 四个官方赛季,含 30+ 技能 |
58
+ | **Mod 化扩展** | 支持社区作者发布自定义赛季与技能,通过 CLI 商店或网页商店安装 |
59
+ | **成就系统** | 内置成就 + 隐藏成就,记录在存档中,跨局累计 |
60
+ | **完整对局回放** | 每局可录制,支持交互式回放,逐事件查看 |
61
+ | **热座模式** | 2~4 人本地轮流同屏操作 |
62
+ | **统计面板** | 玩家胜率排行、技能使用次数、牌型频率、对局统计 |
63
+ | **可选彩色 UI** | 基于 `rich` 库,未安装时自动降级为纯文本 |
64
+ | **CLI 模组商店** | 交互式菜单 + 命令行子命令双入口 |
65
+ | **网页版商店** | 深色终端风,支持浏览、搜索、查看详情、一键安装命令 |
66
+
67
+ ---
68
+
69
+ ## 快速开始
70
+
71
+ ### 方式一:可编辑安装(推荐)
72
+
73
+ ```bash
74
+ git clone https://github.com/zhuyiming0208/SkillUNO.git
75
+ cd SkillUNO
76
+ pip install -e .
77
+ skilluno
78
+ ```
79
+
80
+ 方式二:不安装,直接运行
81
+
82
+ ```bash
83
+ git clone https://github.com/zhuyiming0208/SkillUNO.git
84
+ cd SkillUNO
85
+ PYTHONPATH=src python -m uno.main
86
+ ```
87
+
88
+ 方式三:Termux(Android)
89
+
90
+ ```bash
91
+ pkg install python git
92
+ git clone https://github.com/zhuyiming0208/SkillUNO.git
93
+ cd SkillUNO
94
+ pip install -e .
95
+ skilluno
96
+ ```
97
+
98
+ Termux 提示:软键盘没有方向键,商店内使用 u/d/l/r 代替上下左右,~ 代替 Esc。
99
+
100
+ ---
101
+
102
+ 使用方式
103
+
104
+ 交互式菜单
105
+
106
+ ```bash
107
+ skilluno
108
+ ```
109
+
110
+ 进入主菜单:
111
+
112
+ ```
113
+ SkillUNO vX.Y.Z
114
+ 1. 新游戏
115
+ 2. 回放录像
116
+ 3. 统计面板
117
+ 4. 模组商店
118
+ 0. 退出
119
+ ```
120
+
121
+ · 新游戏:选择赛季组合、房间规则、是否录制
122
+ · 回放:从 src/uno/records/ 里选择录像播放
123
+ · 统计面板:读取存档与回放,显示胜率排行、技能使用、牌型频率
124
+ · 模组商店:浏览、搜索、安装、卸载、启用/禁用模组(按 W 打开网页版)
125
+
126
+ CLI 子命令
127
+
128
+ ```bash
129
+ skilluno mod list # 列出全部模组
130
+ skilluno mod search <关键词> # 模糊搜索
131
+ skilluno mod info <ID> # 查看模组详情
132
+ skilluno mod install <ID> # 下载 + 验证 + 启用
133
+ skilluno mod uninstall <ID> # 卸载
134
+ skilluno mod list-collections # 列出模组集
135
+ skilluno mod install-collection <ID> # 一键安装模组集
136
+ skilluno mod --help # 查看帮助
137
+ ```
138
+
139
+ ---
140
+
141
+ 模组系统
142
+
143
+ 安装社区模组
144
+
145
+ 方式一:CLI 商店
146
+
147
+ ```bash
148
+ skilluno
149
+ # 选 4 进入商店
150
+ # 按 S 搜索、Enter 查看详情、I 安装
151
+ ```
152
+
153
+ 方式二:命令行
154
+
155
+ ```bash
156
+ skilluno mod install EXAMPLE
157
+ ```
158
+
159
+ 方式三:网页版商店
160
+
161
+ 访问 https://zhuyiming0208.github.io/SkillUNO/ ,复制安装命令。
162
+
163
+ 安全机制
164
+
165
+ 下载的模组经过多重验证:
166
+
167
+ 1. URL 白名单:只允许 raw.githubusercontent.com 和 cdn.jsdelivr.net
168
+ 2. 大小限制:单文件 ≤ 5MB
169
+ 3. 静态验证:用 ast.parse 解析 SEASON_ID,绝不 import 执行
170
+ 4. 隔离区:下载到 mods/_pending/,用户显式确认后才启用
171
+ 5. 备份:覆盖已安装模组前先备份 .bak
172
+
173
+ 制作自己的模组
174
+
175
+ 见 模组制作指南。
176
+
177
+ ---
178
+
179
+ 网页版商店
180
+
181
+ 网址:https://zhuyiming0208.github.io/SkillUNO/
182
+
183
+ 纯静态 HTML/CSS/JS,无构建依赖。包含:
184
+
185
+ · 首页:官方模组 + 精选模组 + 模组集
186
+ · 列表页:全部模组 + 搜索
187
+ · 详情页:模组信息、依赖、权限声明、一键复制安装命令
188
+ · 模组集:浏览和批量安装
189
+
190
+ 源码位于 web/ 目录。改完后:
191
+
192
+ ```bash
193
+ cd web
194
+ python -m http.server 8000
195
+ # 浏览器访问 http://localhost:8000
196
+ ```
197
+
198
+ ---
199
+
200
+ 项目结构
201
+
202
+ ```
203
+ SkillUNO/
204
+ ├── docs/ 项目文档
205
+ │ ├── DEVELOPER_GUIDE.md
206
+ │ ├── FAQ.md
207
+ │ ├── VersionBriefHistory.md
208
+ │ └── screenshots/
209
+ ├── mods/ 模组元数据
210
+ │ ├── mod_idx.json 第三方模组索引
211
+ │ ├── official.json 官方模组列表
212
+ │ ├── S1~S4.json 官方赛季元数据
213
+ │ ├── example.json 示例模组
214
+ │ └── collections.json 模组集
215
+ ├── src/uno/ 核心代码
216
+ │ ├── core.py 游戏核心(牌、玩家、回合、事件)
217
+ │ ├── season1~4.py 官方赛季技能
218
+ │ ├── skills_uno.py 技能加载器
219
+ │ ├── achievements.py 成就系统
220
+ │ ├── archive.py 存档读写
221
+ │ ├── replay.py 回放录制与播放
222
+ │ ├── stats.py 统计面板
223
+ │ ├── ui.py UI 抽象(ConsoleUI / RichUI / NullUI)
224
+ │ ├── mod_index.py 模组索引读取
225
+ │ └── mod_store/ CLI 模组商店
226
+ │ ├── menu.py / search.py / detail.py / history_view.py
227
+ │ ├── downloader.py / validator.py
228
+ │ ├── uninstaller.py / updater.py
229
+ │ └── cli.py 命令行子命令
230
+ ├── tests/ 测试(700+ 用例)
231
+ ├── web/ 网页版商店
232
+ ├── tools/bump.py 版本号升级工具
233
+ └── .github/workflows/ CI(测试 + 网页部署)
234
+ ```
235
+
236
+ ---
237
+
238
+ 开发
239
+
240
+ 运行测试
241
+
242
+ ```bash
243
+ python -m pytest tests/ -v
244
+ ```
245
+
246
+ 带覆盖率:
247
+
248
+ ```bash
249
+ python -m pytest tests/ --cov=src/uno --cov-report=term-missing
250
+ ```
251
+
252
+ 贡献
253
+
254
+ 欢迎提交 Issue 或 PR。添加新功能时请:
255
+
256
+ 1. 保持测试覆盖率
257
+ 2. 更新 docs/VersionBriefHistory.md
258
+ 3. 用 setver X.Y.Z 升级版本号
259
+
260
+ 版本号工具
261
+
262
+ ```bash
263
+ setver 1.13.0 --new-entry "新功能说明"
264
+ ```
265
+
266
+ (setver 是 tools/bump.py 的别名,需自行配置)
267
+
268
+ ---
269
+
270
+ 兼容性
271
+
272
+ 项 支持
273
+ Python 3.10 / 3.11 / 3.12 / 3.14
274
+ 平台 Linux / macOS / Android (Termux) / Windows
275
+ 可选依赖 rich(彩色 UI)
276
+
277
+ ---
278
+
279
+ 文档
280
+
281
+ · 开发者指南
282
+ · FAQ
283
+ · 从小白到高手
284
+ · 版本历史
285
+ · 模组制作
286
+
287
+ ---
288
+
289
+ 许可证
290
+
291
+ MIT
@@ -0,0 +1,280 @@
1
+ ![Python Tests](https://github.com/zhuyiming0208/SkillUNO/actions/workflows/test.yml/badge.svg)
2
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
3
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)
4
+
5
+ # SkillUNO
6
+
7
+ > 一个基于 Python 的 UNO 卡牌游戏框架,支持 Mod 化技能、赛季、成就、回放、热座模式、CLI 商店与网页版商店。
8
+
9
+ *(部分代码由 AI 辅助生成)*
10
+
11
+ ---
12
+
13
+ ## 目录
14
+
15
+ - [游戏截图](#游戏截图)
16
+ - [特性](#特性)
17
+ - [快速开始](#快速开始)
18
+ - [使用方式](#使用方式)
19
+ - [交互式菜单](#交互式菜单)
20
+ - [CLI 子命令](#cli-子命令)
21
+ - [模组系统](#模组系统)
22
+ - [安装社区模组](#安装社区模组)
23
+ - [制作自己的模组](#制作自己的模组)
24
+ - [网页版商店](#网页版商店)
25
+ - [项目结构](#项目结构)
26
+ - [开发](#开发)
27
+ - [兼容性](#兼容性)
28
+ - [文档](#文档)
29
+ - [许可证](#许可证)
30
+
31
+ ---
32
+
33
+ ## 游戏截图
34
+
35
+ ![游戏界面 1](https://cdn.jsdelivr.net/gh/zhuyiming0208/SkillUNO@main/docs/screenshots/gameplay1.jpg)
36
+
37
+ ![游戏界面 2](https://cdn.jsdelivr.net/gh/zhuyiming0208/SkillUNO@main/docs/screenshots/gameplay2.jpg)
38
+
39
+ ---
40
+
41
+ ## 特性
42
+
43
+ | 特性 | 说明 |
44
+ |---|---|
45
+ | **事件驱动技能系统** | 技能通过订阅游戏事件(GAME_START / TURN_START / BEING_ADDED_CARDS 等)触发,支持自动与手动激活 |
46
+ | **赛季系统** | 内置 S1 经典 / S2 被动觉醒 / S3 同盟 / S4 补丁 四个官方赛季,含 30+ 技能 |
47
+ | **Mod 化扩展** | 支持社区作者发布自定义赛季与技能,通过 CLI 商店或网页商店安装 |
48
+ | **成就系统** | 内置成就 + 隐藏成就,记录在存档中,跨局累计 |
49
+ | **完整对局回放** | 每局可录制,支持交互式回放,逐事件查看 |
50
+ | **热座模式** | 2~4 人本地轮流同屏操作 |
51
+ | **统计面板** | 玩家胜率排行、技能使用次数、牌型频率、对局统计 |
52
+ | **可选彩色 UI** | 基于 `rich` 库,未安装时自动降级为纯文本 |
53
+ | **CLI 模组商店** | 交互式菜单 + 命令行子命令双入口 |
54
+ | **网页版商店** | 深色终端风,支持浏览、搜索、查看详情、一键安装命令 |
55
+
56
+ ---
57
+
58
+ ## 快速开始
59
+
60
+ ### 方式一:可编辑安装(推荐)
61
+
62
+ ```bash
63
+ git clone https://github.com/zhuyiming0208/SkillUNO.git
64
+ cd SkillUNO
65
+ pip install -e .
66
+ skilluno
67
+ ```
68
+
69
+ 方式二:不安装,直接运行
70
+
71
+ ```bash
72
+ git clone https://github.com/zhuyiming0208/SkillUNO.git
73
+ cd SkillUNO
74
+ PYTHONPATH=src python -m uno.main
75
+ ```
76
+
77
+ 方式三:Termux(Android)
78
+
79
+ ```bash
80
+ pkg install python git
81
+ git clone https://github.com/zhuyiming0208/SkillUNO.git
82
+ cd SkillUNO
83
+ pip install -e .
84
+ skilluno
85
+ ```
86
+
87
+ Termux 提示:软键盘没有方向键,商店内使用 u/d/l/r 代替上下左右,~ 代替 Esc。
88
+
89
+ ---
90
+
91
+ 使用方式
92
+
93
+ 交互式菜单
94
+
95
+ ```bash
96
+ skilluno
97
+ ```
98
+
99
+ 进入主菜单:
100
+
101
+ ```
102
+ SkillUNO vX.Y.Z
103
+ 1. 新游戏
104
+ 2. 回放录像
105
+ 3. 统计面板
106
+ 4. 模组商店
107
+ 0. 退出
108
+ ```
109
+
110
+ · 新游戏:选择赛季组合、房间规则、是否录制
111
+ · 回放:从 src/uno/records/ 里选择录像播放
112
+ · 统计面板:读取存档与回放,显示胜率排行、技能使用、牌型频率
113
+ · 模组商店:浏览、搜索、安装、卸载、启用/禁用模组(按 W 打开网页版)
114
+
115
+ CLI 子命令
116
+
117
+ ```bash
118
+ skilluno mod list # 列出全部模组
119
+ skilluno mod search <关键词> # 模糊搜索
120
+ skilluno mod info <ID> # 查看模组详情
121
+ skilluno mod install <ID> # 下载 + 验证 + 启用
122
+ skilluno mod uninstall <ID> # 卸载
123
+ skilluno mod list-collections # 列出模组集
124
+ skilluno mod install-collection <ID> # 一键安装模组集
125
+ skilluno mod --help # 查看帮助
126
+ ```
127
+
128
+ ---
129
+
130
+ 模组系统
131
+
132
+ 安装社区模组
133
+
134
+ 方式一:CLI 商店
135
+
136
+ ```bash
137
+ skilluno
138
+ # 选 4 进入商店
139
+ # 按 S 搜索、Enter 查看详情、I 安装
140
+ ```
141
+
142
+ 方式二:命令行
143
+
144
+ ```bash
145
+ skilluno mod install EXAMPLE
146
+ ```
147
+
148
+ 方式三:网页版商店
149
+
150
+ 访问 https://zhuyiming0208.github.io/SkillUNO/ ,复制安装命令。
151
+
152
+ 安全机制
153
+
154
+ 下载的模组经过多重验证:
155
+
156
+ 1. URL 白名单:只允许 raw.githubusercontent.com 和 cdn.jsdelivr.net
157
+ 2. 大小限制:单文件 ≤ 5MB
158
+ 3. 静态验证:用 ast.parse 解析 SEASON_ID,绝不 import 执行
159
+ 4. 隔离区:下载到 mods/_pending/,用户显式确认后才启用
160
+ 5. 备份:覆盖已安装模组前先备份 .bak
161
+
162
+ 制作自己的模组
163
+
164
+ 见 模组制作指南。
165
+
166
+ ---
167
+
168
+ 网页版商店
169
+
170
+ 网址:https://zhuyiming0208.github.io/SkillUNO/
171
+
172
+ 纯静态 HTML/CSS/JS,无构建依赖。包含:
173
+
174
+ · 首页:官方模组 + 精选模组 + 模组集
175
+ · 列表页:全部模组 + 搜索
176
+ · 详情页:模组信息、依赖、权限声明、一键复制安装命令
177
+ · 模组集:浏览和批量安装
178
+
179
+ 源码位于 web/ 目录。改完后:
180
+
181
+ ```bash
182
+ cd web
183
+ python -m http.server 8000
184
+ # 浏览器访问 http://localhost:8000
185
+ ```
186
+
187
+ ---
188
+
189
+ 项目结构
190
+
191
+ ```
192
+ SkillUNO/
193
+ ├── docs/ 项目文档
194
+ │ ├── DEVELOPER_GUIDE.md
195
+ │ ├── FAQ.md
196
+ │ ├── VersionBriefHistory.md
197
+ │ └── screenshots/
198
+ ├── mods/ 模组元数据
199
+ │ ├── mod_idx.json 第三方模组索引
200
+ │ ├── official.json 官方模组列表
201
+ │ ├── S1~S4.json 官方赛季元数据
202
+ │ ├── example.json 示例模组
203
+ │ └── collections.json 模组集
204
+ ├── src/uno/ 核心代码
205
+ │ ├── core.py 游戏核心(牌、玩家、回合、事件)
206
+ │ ├── season1~4.py 官方赛季技能
207
+ │ ├── skills_uno.py 技能加载器
208
+ │ ├── achievements.py 成就系统
209
+ │ ├── archive.py 存档读写
210
+ │ ├── replay.py 回放录制与播放
211
+ │ ├── stats.py 统计面板
212
+ │ ├── ui.py UI 抽象(ConsoleUI / RichUI / NullUI)
213
+ │ ├── mod_index.py 模组索引读取
214
+ │ └── mod_store/ CLI 模组商店
215
+ │ ├── menu.py / search.py / detail.py / history_view.py
216
+ │ ├── downloader.py / validator.py
217
+ │ ├── uninstaller.py / updater.py
218
+ │ └── cli.py 命令行子命令
219
+ ├── tests/ 测试(700+ 用例)
220
+ ├── web/ 网页版商店
221
+ ├── tools/bump.py 版本号升级工具
222
+ └── .github/workflows/ CI(测试 + 网页部署)
223
+ ```
224
+
225
+ ---
226
+
227
+ 开发
228
+
229
+ 运行测试
230
+
231
+ ```bash
232
+ python -m pytest tests/ -v
233
+ ```
234
+
235
+ 带覆盖率:
236
+
237
+ ```bash
238
+ python -m pytest tests/ --cov=src/uno --cov-report=term-missing
239
+ ```
240
+
241
+ 贡献
242
+
243
+ 欢迎提交 Issue 或 PR。添加新功能时请:
244
+
245
+ 1. 保持测试覆盖率
246
+ 2. 更新 docs/VersionBriefHistory.md
247
+ 3. 用 setver X.Y.Z 升级版本号
248
+
249
+ 版本号工具
250
+
251
+ ```bash
252
+ setver 1.13.0 --new-entry "新功能说明"
253
+ ```
254
+
255
+ (setver 是 tools/bump.py 的别名,需自行配置)
256
+
257
+ ---
258
+
259
+ 兼容性
260
+
261
+ 项 支持
262
+ Python 3.10 / 3.11 / 3.12 / 3.14
263
+ 平台 Linux / macOS / Android (Termux) / Windows
264
+ 可选依赖 rich(彩色 UI)
265
+
266
+ ---
267
+
268
+ 文档
269
+
270
+ · 开发者指南
271
+ · FAQ
272
+ · 从小白到高手
273
+ · 版本历史
274
+ · 模组制作
275
+
276
+ ---
277
+
278
+ 许可证
279
+
280
+ MIT
@@ -0,0 +1,27 @@
1
+ [project]
2
+ name = "skilluno"
3
+ version = "1.12.1"
4
+ description = "一个基于 Python 的 UNO 卡牌游戏框架"
5
+ readme = "README.md"
6
+ requires-python = ">=3.8"
7
+ license = "MIT"
8
+ dependencies = [
9
+ "rich>=13.0",
10
+ ]
11
+
12
+ [project.scripts]
13
+ skilluno = "uno.main:cli"
14
+
15
+ [build-system]
16
+ requires = ["setuptools>=61"]
17
+ build-backend = "setuptools.build_meta"
18
+
19
+ [tool.setuptools.packages.find]
20
+ where = ["src"]
21
+
22
+ [tool.coverage.run]
23
+ omit = [
24
+ "src/uno/main.py",
25
+ "src/uno/ui.py",
26
+ "src/uno/season3.py",
27
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+