Install
openclaw skills install @hmily741963/qiguo-strategy-gameThis skill launches the single-file HTML strategy game 七国群雄传 (Seven Kingdoms Tactics), a 三国群英传-style isometric turn-based wargame. Use it when the user wants to play a browser strategy game, mentions 七国群雄传 / 战棋 / 三国群英传-style web game, or asks to open / play this game. It copies the self-contained HTML into the workspace and opens it directly in the built-in preview so the user can play immediately with zero setup.
openclaw skills install @hmily741963/qiguo-strategy-gameA zero-dependency, single-file HTML5 Canvas strategy wargame in the spirit of 三国群英传 — isometric 3D 战棋, seven-warring-states theme, with combo chains, bond auras, co-op ultimate (合击必杀), and a general codex (武将图鉴). Two modes are bundled, and each supports two play styles:
人机对战 (vs AI) — default; you command one side, the computer commands the other.
双人轮流 Hotseat(同设备) — two human players share one device and take turns on the same screen. Chosen on the state-select screen via the 👥 双人轮流(同设备) toggle.
联机对战 (Net Play) — two players on separate tabs / separate devices play live. Chosen on the state-select screen via the 🌐 联机对战 toggle. Two transports: 本机多标签 (BroadcastChannel, same browser, zero setup) and 跨设备 (WebSocket relay net-server.js, two devices). Both skirmish and campaign support net play, host = red/我方, client = blue/敌方 (viewpoint swapped on client).
战役模式 (Campaign) — campaign-mode.html: pick a state, conquer cities, recruit generals, and unify the realm. Includes the 武将图鉴 collection system. Hotseat and 联机 apply to each battle (the strategic map stays single-player setup).
普通模式 (Skirmish) — skirmish-mode.html: pick a state + scenario, fast single battle. 10 历史名局 (长平/即墨火牛/宜阳/蓟城/桂陵/鄢郢/函谷关/邯郸/伊阙/阏与) each with bespoke terrain & 史实剧情. Hotseat and 联机 fully supported.
The skill is purely a launcher: it copies the bundled HTML into the current workspace and opens it in the built-in preview panel so the user plays instantly. No server, no build step, no network.
net-server.js and use 跨设备.Follow these steps exactly. The game is bundled under assets/ in this skill's directory.
Resolve the skill directory. The current skill lives at ~/.workbuddy/skills/qiguo-strategy-game/. The bundled files are:
assets/campaign-mode.html — 战役模式assets/skirmish-mode.html — 普通模式net-server.js — zero-dependency WebSocket relay for 跨设备 联机 (only needed for two-device matches)Choose which mode to open based on the user's words:
campaign-mode.htmlskirmish-mode.htmlHotseat note: the 人机 / 双人 toggle lives on the state-select screen (a row reading
对战模式: 🤖 人机对战 · 👥 双人轮流(同设备)). It is selected before choosing a state and applies to the whole battle. In Hotseat, Player 1 commands the blue side and Player 2 the red side; 结束回合 passes control to the other player (not the AI).
Copy the chosen HTML into the current workspace so the user owns a playable, editable copy. Use the Bash tool:
mkdir -p "<cwd>/七国群雄传" && cp "<skill_dir>/assets/<file>.html" "<cwd>/七国群雄传/<file>.html"
Replace <cwd> with the current working directory (from context) and <skill_dir> with the resolved skill path. Keep the English filename so the path stays portable.
CRITICAL — open in the built-in preview via present_files. After copying, call the present_files tool with the absolute path of the copied HTML file(s). This renders the game directly inside the conversation's preview panel and shows an artifact card.
present_files with the absolute local path, e.g. C:\Users\...\七国群雄传\campaign-mode.htmlfile://... URL or a relative path and tell the user to open it themselves. The user must be able to play immediately in the preview.Tell the user, in one short line, that the game is open in the preview and how to start (choose a state → start battle; in campaign, march from your capital to an adjacent enemy city).
localStorage; open via the 图鉴 button, shows "collected / total".These hooks keep players coming back and help the game spread — mention them when describing the skill:
localStorage and toasts 连续登录 N 天:每日一战,终将一统天下! on launch — a lightweight daily-return hook that rewards habitual play without gating content.gameMode='hotseat'.玩家1 · 秦 行动) and the status bar (玩家1 / 玩家2 counts, current side's 阵型 and 军师).玩家2 结束回合 ▶ when it is Player 2's turn.🏆 玩家1 · 秦 胜利! / 🏆 玩家2 · 赵 胜利! so both humans get credit.On the state-select screen, tap 🌐 联机对战 (default 🤖 人机对战). A room row appears with a room number, a transport toggle (本机多标签 / 跨设备), an optional server box, and 创建房间(主机)/ 加入房间(客机)buttons.
Two transports
net-server.js in this skill's directory. Start it with node net-server.js (default port 8770) on a machine reachable by both players; both enter ws://<host-ip>:8770 in the 服务器 box before joining.Match flow
Rules
🟢 你方回合(红方) / ⏳ 等待对方(蓝方) so each side knows when to act.net-server.js first.Note: in campaign net play, only the tactical battle is networked (host plays the strategy map; the client joins the battle the host launches). This is by design.
drawWeather() 粒子系统——下雨/下雪斜线飘落、雷暴随机闪电(白屏 + 折线)+ 命中触发镜头微震、大风/沙尘暴横向尘霾飘移;天气类型由既有 weather 全局(剧本天气)自动驱动,无需额外操作即随战场气候呈现对应天象。THEME_BY_SCENARIO 与 GAME_THEME——长平之战(血色黄昏天空 + 焦土红偏色)、即墨火牛(暗夜 + 营地底部火光闪烁)、蓟城死守(冰蓝雪原偏色)等,开战时按 scenario.name 自动套用天空渐变 / 太阳光晕 / 雾色 / 地表 tint,并强化夜战暗角。GAME_TRACES + addTrace() + drawTileTraces()——单位移动在草地/丘陵/平原烙下踩踏痕、攻城/车系武将攻击留下车辙、灼烧产生焦黑痕(带余烬),最多 520 处并按寿命淡出;由移动(D 钩子)、命中/车辙(C 钩子)、灼烧(E 钩子)自动写入。drawWorldBackdrop 远山/云/鸟随 cam.panX 按 0.06%~0.42% 不同速率视差位移营造纵深;render 顶部按 cam.shake 做随机平移、命中/雷暴衰减触发微震(A 钩子),渲染末尾配对 ctx.restore()。drawDepthFog:按地图实际屏幕纵向范围(minY/maxY)计算每格雾化强度——远景(上方)浓、近景(下方)淡,背景Δ≈39.5、前景Δ≈0,纵深感拉满且不压暗近处信息;雾色随 THEME.fog 走,主题切换自动适配。drawGodRays / 新云层:太阳处 7 道放射状线性渐变光(lighter 叠加),顶部亮像素比升至 0.032;云由单层改为 puffs 数组的蓬松积云 + 软投影(0.12 视差),云影随光位漂移。decoWater:在 v1.3.0 径向渐变/波光/拍岸浪之上,新增 3 条 lighter 焦散微光带 + 镜面太阳反光点(椭圆高光),活水帧间差 7.49。decoCastle:火/夜主题下城体加暖色径向光晕、四角楼窗光(闪烁)、双层火炬火焰、主楼窗光 + 暖色描边,夜战暖色像素由 0 升至 27,城堡成为暗夜视觉锚点。decoForest:每棵树 translate/rotate 随风轻摆,3 片秋/绿飘落叶缓降,告别"死板绿钉"。drawAmbient:46 颗缓动花粉/尘埃(lighter 微光)漂浮;火/雷暴主题额外升起 26 颗余烬,氛围更"活"。GAME_NO_DECO / GAME_NO_DEPTHFOG / GAME_NO_AMBIENT 测试隔离开关隔离瞬态层测量。tileCorners 返回的是矩形而不是等距菱形(实测包围盒 52×26、面积 1377,正确菱形应为 688,相邻瓦片 2 个角点互相重叠),导致地图实际是"一堆互相重叠的矩形条靠画家算法裁剪",完全没有等距斜边——这是"地图又丑又难辨"的病根。现改为标准菱形 (0,-TH/2)→(TW/2,0)→(0,TH/2)→(-TW/2,0),实测面积比 1.000、相邻重叠率 0。terrain 为空,render() 每帧抛 Cannot read properties of undefined(每回合 1 次);已加空地图保护,实测 0 报错。package.json 版本号至 1.1.1,clawhub.ai / skillhub.cn 双平台版本一致。UCOL,战场与图鉴同源渲染,一眼可辨"谁是谁"。解决"造出来的士兵长得都一样"的玩家痛点。net-server.js)。