使用本技能前,请确保有以下工具:
工具用途检查命令文本编辑器编辑文件已有Python验证 JSONpython3 --version.NET SDK编译 SMAPI Moddotnet --version
python
import subprocess
import shutil
def check_tools():
errors = []
# 检查 Python
if not shutil.which('python3'):
errors.append("❌ Python 未安装")
# 检查 .NET (可选,用于 SMAPI Mod)
if not shutil.which('dotnet'):
errors.append("⚠️ .NET SDK 未安装(SMAPI Mod 需要,CP Mod 不需要)")
if errors:
return errors
return ["✅ 所有工具就绪"]
根据用户需求自动选择:
需求类型需要 .NET添加 NPC/对话/立绘CP Mod❌ 不需要修改游戏数据CP Mod❌ 不需要添加新地图CP Mod❌ 不需要修改游戏机制SMAPI Mod✅ 需要添加孩子功能SMAPI Mod✅ 需要代码级 HookSMAPI Mod✅ 需要
python
def determine_mod_type(user_request):
request = user_request.lower()
smapi_keywords = ["孩子", "孩子功能", "hook", "修改机制", "代码", "dll", "编译"]
cp_keywords = ["对话", "立绘", "npc", "剧情", "事件", "地图", "json"]
for keyword in smapi_keywords:
if keyword in request:
return "SMAPI"
for keyword in cp_keywords:
if keyword in request:
return "CP"
return "CP" # 默认 CP
text
ModName/
├── manifest.json # Mod 信息
├── content.json # 内容定义
└── assets/ # 资源文件夹
├── Dialogue/ # 对话文件
├── Image/ # 图片资源
├── Maps/ # 地图文件
├── Schedule/ # 行程文件
└── i18n/ # 多语言
text
ModName/
├── ModName.csproj # 项目文件
├── ModEntry.cs # 主代码
└── manifest.json # Mod 信息
json
{
"Name": "ModName",
"Author": "YourName",
"Version": "1.0.0",
"Description": "Mod 描述",
"UniqueID": "YourName.ModName",
"ContentPackFor": {
"UniqueID": "Pathoschild.ContentPatcher",
"MinimumVersion": "2.0"
}
}
json
{
"Format": "2.3.0",
"Changes": [
{
"LogName": "说明",
"Action": "EditData/Load/EditImage",
"Target": "目标路径",
"Entries": {}
}
]
}
json
{
"Action": "EditData",
"Target": "Characters/Dialogue/MarriageDialogueNPC名",
"Entries": {
"Rainy_Day_0": "对话内容",
"Indoor_Night_0": "对话内容"
}
}
条件代码结婚Spouse NPC名好感度Friendship NPC名 数字 (2500 = 10心)时间Time 600 1000天气Weather rainy季节Season summer雨天Weather rainy晴天Weather sunny
bash
python3 -c "import json; json.load(open('file.json'))"
bash
dotnet build
~/Library/Application Support/Steam/steamapps/common/Stardew Valley/.../Stardew Valley/Contents/MacOS/Mods/.../Stardew Valley/Contents/MacOS/smapi-internal/