Initial commit: Text Adventure Game

Features:
- Combat system with AP/EP hit calculation and three-layer defense
- Auto-combat/farming mode
- Item system with stacking support
- Skill system with levels, milestones, and parent skill sync
- Shop system with dynamic pricing
- Inventory management with bulk selling
- Event system
- Game loop with offline earnings
- Save/Load system

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-01-21 17:13:51 +08:00
commit cb412544e9
90 changed files with 17149 additions and 0 deletions

387
wf/code.json Normal file
View File

@@ -0,0 +1,387 @@
{
"id": "workflow-1768962824958",
"name": "code",
"version": "1.0.0",
"nodes": [
{
"id": "start-node-default",
"type": "start",
"name": "start-node-default",
"position": {
"x": 100,
"y": 200
},
"data": {
"label": "开始"
}
},
{
"id": "check-docs-1",
"type": "mcp",
"name": "check-docs-1",
"position": {
"x": 330,
"y": 165
},
"data": {
"serverId": "filesystem",
"toolName": "read_file",
"toolDescription": "读取步骤文档文件",
"parameters": [
{
"name": "file_path",
"type": "string",
"description": "步骤文档文件路径",
"required": true
}
],
"parameterValues": {
"file_path": "./step_documentation.md"
},
"mode": "manualParameterConfig",
"validationStatus": "valid",
"outputPorts": 1
}
},
{
"id": "if-docs-exist",
"type": "ifElse",
"name": "if-docs-exist",
"position": {
"x": 600,
"y": 135
},
"data": {
"evaluationTarget": "file_content",
"branches": [
{
"id": "has-docs",
"label": "存在文档",
"condition": "文件存在且包含内容"
},
{
"id": "no-docs",
"label": "无文档",
"condition": "文件不存在或为空"
}
],
"outputPorts": 2
}
},
{
"id": "error-no-docs",
"type": "subAgent",
"name": "error-no-docs",
"position": {
"x": 840,
"y": 285
},
"data": {
"description": "处理缺少步骤文档的情况",
"prompt": "错误:未找到步骤文档。此工作流需要步骤文档才能继续。请创建一个包含开发步骤的 step_documentation.md 文件。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "end-error",
"type": "end",
"name": "end-error",
"position": {
"x": 1320,
"y": 510
},
"data": {
"label": "结束 - 错误"
}
},
{
"id": "extract-steps-1",
"type": "subAgent",
"name": "extract-steps-1",
"position": {
"x": 855,
"y": 120
},
"data": {
"description": "从文档中提取开发步骤",
"prompt": "从步骤文档中提取并列出所有开发步骤。对于每个步骤,识别任务描述、要求和验收标准。以编号列表格式输出步骤。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "foreach-loop-start",
"type": "subAgent",
"name": "foreach-loop-start",
"position": {
"x": 1290,
"y": 15
},
"data": {
"description": "初始化foreach循环处理步骤",
"prompt": "初始化foreach循环以按顺序处理每个开发步骤。跟踪当前步骤索引和总步骤数。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "develop-step-1",
"type": "subAgent",
"name": "develop-step-1",
"position": {
"x": 1710,
"y": 45
},
"data": {
"description": "开发当前步骤",
"prompt": "根据要求开发当前步骤。专注于实现本步骤描述的核心功能。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "verify-step-1",
"type": "subAgent",
"name": "verify-step-1",
"position": {
"x": 1980,
"y": 165
},
"data": {
"description": "验证完成的步骤",
"prompt": "验证当前步骤是否已成功完成。检查是否满足所有要求,功能是否按预期工作。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "if-step-passed",
"type": "ifElse",
"name": "if-step-passed",
"position": {
"x": 2340,
"y": 150
},
"data": {
"evaluationTarget": "verification_result",
"branches": [
{
"id": "step-passed",
"label": "通过",
"condition": "验证成功"
},
{
"id": "step-failed",
"label": "失败",
"condition": "验证失败"
}
],
"outputPorts": 2
}
},
{
"id": "step-complete",
"type": "subAgent",
"name": "step-complete",
"position": {
"x": 2625,
"y": 135
},
"data": {
"description": "移动到下一步",
"prompt": "当前步骤成功完成。移动到序列中的下一步。如果这是最后一步,则标记工作流为完成。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "fix-bugs-1",
"type": "subAgent",
"name": "fix-bugs-1",
"position": {
"x": 2625,
"y": 345
},
"data": {
"description": "修复错误或完成开发",
"prompt": "修复验证过程中发现的任何错误或问题。继续在此步骤上工作,直到验证通过为止。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "loop-back",
"type": "subAgent",
"name": "loop-back",
"position": {
"x": 1380,
"y": 345
},
"data": {
"description": "返回开发阶段",
"prompt": "返回开发阶段以继续修复当前步骤。循环返回直到验证通过。",
"model": "sonnet",
"outputPorts": 1
}
},
{
"id": "end-success",
"type": "end",
"name": "end-success",
"position": {
"x": 3120,
"y": 210
},
"data": {
"label": "结束 - 成功"
}
}
],
"connections": [
{
"id": "c1",
"from": "start-node-default",
"to": "check-docs-1",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c2",
"from": "check-docs-1",
"to": "if-docs-exist",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c3",
"from": "if-docs-exist",
"to": "error-no-docs",
"fromPort": "branch-1",
"toPort": "input"
},
{
"id": "c4",
"from": "if-docs-exist",
"to": "extract-steps-1",
"fromPort": "branch-0",
"toPort": "input"
},
{
"id": "c5",
"from": "error-no-docs",
"to": "end-error",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c6",
"from": "extract-steps-1",
"to": "foreach-loop-start",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c7",
"from": "foreach-loop-start",
"to": "develop-step-1",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c8",
"from": "develop-step-1",
"to": "verify-step-1",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c9",
"from": "verify-step-1",
"to": "if-step-passed",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c10",
"from": "if-step-passed",
"to": "step-complete",
"fromPort": "branch-0",
"toPort": "input"
},
{
"id": "c11",
"from": "if-step-passed",
"to": "fix-bugs-1",
"fromPort": "branch-1",
"toPort": "input"
},
{
"id": "c12",
"from": "step-complete",
"to": "end-success",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c13",
"from": "fix-bugs-1",
"to": "loop-back",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c14",
"from": "loop-back",
"to": "develop-step-1",
"fromPort": "output",
"toPort": "input"
}
],
"createdAt": "2026-01-21T02:33:44.958Z",
"updatedAt": "2026-01-21T02:33:44.958Z",
"conversationHistory": {
"schemaVersion": "1.0.0",
"messages": [
{
"id": "msg-1768962395829-0.4059296316485371",
"sender": "user",
"content": "这是一个按步骤开发并验证的工作流如果用户提供了工作步骤文档则检查步骤文档如果没有提供则检查项目是否存在步骤文档。如果没有步骤文档则退出提示该工作流需要步骤文档。获取到步骤文档之后foreach进行逐步开发与验证每一步都必须经过开发开发完成之后验证验证完成之后进行下一步没完成则继续这一步的bug消除或开发直到最终完成",
"timestamp": "2026-01-21T02:26:35.829Z"
},
{
"id": "ai-1768962395829-0.3003715067855044",
"sender": "ai",
"content": "I'll review the current workflow and analyze the user's request to refine it.\n\nBased on the current workflow, I see it has only a Start and End node. The user's request is to create a step-by-step development and validation workflow that:\n\n1. Checks for step documentation (either provided by user or existing in project)\n2. If no step documentation exists, exits with an error message\n3. If step documentation exists, processes each step with:\n - Development of the step\n - Verification after development\n - If verification fails, continue debugging/completing the current step\n - Only proceed to next step after successful verification\n4. Continues until all steps are completed\n(no content)\n\n(no content)\n\n(no content)",
"timestamp": "2026-01-21T02:26:35.829Z",
"isLoading": false,
"toolInfo": null
},
{
"id": "ai-completion-1768962499055-0.9858225921933254",
"sender": "ai",
"content": "Created step-by-step development and validation workflow with loop structure for iterative development, verification, and bug fixing until completion",
"timestamp": "2026-01-21T02:28:19.055Z",
"isLoading": false
},
{
"id": "8b3720ea-6fea-403c-a6f7-43bf6e0ee4ec",
"sender": "user",
"content": "其中的步骤信息和提示词都换成中文",
"timestamp": "2026-01-21T02:31:41.307Z"
},
{
"id": "ac28af67-28ab-486c-9453-23de15ee3871",
"sender": "ai",
"content": "将步骤信息和提示词全部更新为中文",
"timestamp": "2026-01-21T02:31:41.307Z"
}
],
"currentIteration": 1,
"maxIterations": 20,
"createdAt": "2026-01-21T02:23:02.038Z",
"updatedAt": "2026-01-21T02:31:41.307Z",
"sessionId": "f50c6996-4640-4c4f-9383-59268a016851"
},
"subAgentFlows": []
}

290
wf/req.json Normal file
View File

@@ -0,0 +1,290 @@
{
"id": "workflow-1768961987404",
"name": "req",
"version": "1.0.0",
"nodes": [
{
"id": "start-node-default",
"type": "start",
"name": "start-node-default",
"position": {
"x": 120,
"y": -135
},
"data": {
"label": "Start"
}
},
{
"id": "prompt-requirements",
"type": "prompt",
"name": "prompt-requirements",
"position": {
"x": 330,
"y": -165
},
"data": {
"label": "获取需求",
"prompt": "请描述您的需求细节",
"variables": {}
}
},
{
"id": "analyze-project",
"type": "subAgent",
"name": "analyze-project",
"position": {
"x": 615,
"y": -180
},
"data": {
"description": "分析当前项目",
"prompt": "请分析当前项目的架构、功能、技术栈和代码结构",
"model": "opus",
"outputPorts": 1
}
},
{
"id": "compare-requirements",
"type": "subAgent",
"name": "compare-requirements",
"position": {
"x": 105,
"y": 0
},
"data": {
"description": "需求比对分析",
"prompt": "对比分析当前项目与需求的差异,识别需要修改的地方",
"model": "opus",
"outputPorts": 1
}
},
{
"id": "confirm-details",
"type": "askUserQuestion",
"name": "confirm-details",
"position": {
"x": 450,
"y": -15
},
"data": {
"questionText": "是否需要确认细节?",
"options": [
{
"label": "是",
"description": "需要确认细节后再继续"
},
{
"label": "否",
"description": "不需要确认,直接进行比对"
}
],
"outputPorts": 2
}
},
{
"id": "confirm-questions",
"type": "prompt",
"name": "confirm-questions",
"position": {
"x": 750,
"y": -15
},
"data": {
"label": "确认细节",
"prompt": "提出需要确认的问题清单",
"variables": {}
}
},
{
"id": "check-complexity",
"type": "ifElse",
"name": "check-complexity",
"position": {
"x": 765,
"y": 150
},
"data": {
"evaluationTarget": "modificationComplexity",
"branches": [
{
"label": "复杂",
"condition": "修改复杂度高,需要多步骤"
},
{
"label": "简单",
"condition": "修改相对简单,可直接进行"
}
],
"outputPorts": 2
}
},
{
"id": "plan-steps",
"type": "subAgent",
"name": "plan-steps",
"position": {
"x": 1005,
"y": 150
},
"data": {
"description": "步骤规划",
"prompt": "规划可验证的修改步骤,确保每个步骤都可验证",
"model": "opus",
"outputPorts": 1
}
},
{
"id": "create-doc",
"type": "prompt",
"name": "create-doc",
"position": {
"x": 1320,
"y": 150
},
"data": {
"label": "形成文档",
"prompt": "生成步骤文档,包含所有可验证的修改步骤",
"variables": {}
}
},
{
"id": "modify-direct",
"type": "subAgent",
"name": "modify-direct",
"position": {
"x": 1005,
"y": 315
},
"data": {
"description": "直接修改",
"prompt": "直接进行修改并验证结果",
"model": "opus",
"outputPorts": 1
}
},
{
"id": "end-node-default",
"type": "end",
"name": "end-node-default",
"position": {
"x": 1845,
"y": 315
},
"data": {
"label": "End"
}
}
],
"connections": [
{
"id": "c1",
"from": "start-node-default",
"to": "prompt-requirements",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c2",
"from": "prompt-requirements",
"to": "analyze-project",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c3",
"from": "analyze-project",
"to": "compare-requirements",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c4",
"from": "compare-requirements",
"to": "confirm-details",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c5",
"from": "confirm-details",
"to": "confirm-questions",
"fromPort": "branch-0",
"toPort": "input"
},
{
"id": "c6",
"from": "confirm-questions",
"to": "check-complexity",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c7",
"from": "confirm-details",
"to": "check-complexity",
"fromPort": "branch-1",
"toPort": "input"
},
{
"id": "c8",
"from": "check-complexity",
"to": "plan-steps",
"fromPort": "branch-0",
"toPort": "input"
},
{
"id": "c9",
"from": "plan-steps",
"to": "create-doc",
"fromPort": "output",
"toPort": "input"
},
{
"id": "c12",
"from": "check-complexity",
"to": "modify-direct",
"fromPort": "branch-1",
"toPort": "input"
},
{
"id": "c13",
"from": "modify-direct",
"to": "end-node-default",
"fromPort": "output",
"toPort": "input"
},
{
"id": "reactflow__edge-create-docout-end-node-defaultin",
"from": "create-doc",
"to": "end-node-default",
"fromPort": "out",
"toPort": "in"
}
],
"createdAt": "2026-01-21T02:19:47.404Z",
"updatedAt": "2026-01-21T02:19:47.404Z",
"conversationHistory": {
"schemaVersion": "1.0.0",
"messages": [
{
"id": "c2485fab-419e-4178-a1d7-523b38d819e0",
"sender": "user",
"content": "这是一个需求分析的工作流,获取到需求后,分析当前项目,然后和需求比对,如果有需要确认的细节,优先确认。确认完细节之后,如果修改比较复杂,则开始进行步骤规划,要求每个步骤都可验证,然后形成步骤文档,然后开启逐步的修改和验证。如果不需要多步修改,则直接进行改动和验证",
"timestamp": "2026-01-21T02:17:36.276Z"
},
{
"id": "f0773c1d-57f4-44a1-baaf-7bb9caac04e6",
"sender": "ai",
"content": "Created a complete requirements analysis workflow with all nodes and connections based on user feedback",
"timestamp": "2026-01-21T02:17:36.276Z"
}
],
"currentIteration": 1,
"maxIterations": 20,
"createdAt": "2026-01-21T02:12:16.962Z",
"updatedAt": "2026-01-21T02:17:36.276Z",
"sessionId": "eeb4044d-005d-4e95-8eef-6d944ad236fd"
},
"subAgentFlows": []
}