From b2d85919745cceff033763fd525cafe212b2196c Mon Sep 17 00:00:00 2001 From: Status102 <102887808+status102@users.noreply.github.com> Date: Mon, 2 Mar 2026 23:16:40 +0800 Subject: [PATCH] =?UTF-8?q?rft!:=20=E8=87=AA=E5=8A=A8=E6=88=98=E6=96=97?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=20=E5=B9=B2=E5=91=98=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E5=8F=98=E6=9B=B4=E4=B8=BA=200=20(?= =?UTF-8?q?=E4=B8=8D=E6=8C=87=E5=AE=9A=E6=8A=80=E8=83=BD)=20(#15898)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * rft!: 自动战斗协议 干员技能默认值变更为 0 (不指定技能) * fix: 检查范围修复 --- docs/en-us/protocol/copilot-schema.md | 2 +- docs/ja-jp/protocol/copilot-schema.md | 2 +- docs/ko-kr/protocol/copilot-schema.md | 2 +- docs/zh-cn/protocol/copilot-schema.md | 2 +- docs/zh-tw/protocol/copilot-schema.md | 2 +- .../Config/Miscellaneous/CopilotConfig.cpp | 4 ++-- src/MaaCore/Task/Interface/CopilotTask.cpp | 2 +- .../Models/AsstTasks/AsstCopilotTask.cs | 4 ++-- src/MaaWpfGui/Models/Copilot/CopilotModel.cs | 4 ++-- .../ViewModels/UI/CopilotViewModel.cs | 18 +++++++++--------- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/en-us/protocol/copilot-schema.md b/docs/en-us/protocol/copilot-schema.md index bb9421f670..4aad51eb93 100644 --- a/docs/en-us/protocol/copilot-schema.md +++ b/docs/en-us/protocol/copilot-schema.md @@ -20,7 +20,7 @@ Please note that JSON files do not support comments. The comments in this docume // Specified operators { "name": "重岳", // Operator name ("重岳" = "Chongyue") - "skill": 3, // Skill number. Optional, default is 1, range [0, 3] + "skill": 3, // Skill number. Optional, default is 0, range [0, 3] "skill_usage": 2, // Skill usage method. Optional, default is 0 // 0 - Do not use automatically (depends on "actions" field) // 1 - Use whenever ready, as many times as possible (e.g., Thorns S3, Myrtle S1, etc.) diff --git a/docs/ja-jp/protocol/copilot-schema.md b/docs/ja-jp/protocol/copilot-schema.md index a9a27c06d6..31d9c399ef 100644 --- a/docs/ja-jp/protocol/copilot-schema.md +++ b/docs/ja-jp/protocol/copilot-schema.md @@ -20,7 +20,7 @@ JSONファイルはコメントをサポートしておらず、テキスト内 { "name": "ソーンズ", // オペーレーター名 - "skill": 3, // スキルID と範囲 [0, 3], オプション, 1 がデフォルト + "skill": 3, // スキルID と範囲 [0, 3], オプション, 0 がデフォルト "skill_usage": 0, // スキルの使用, オプション, デフォルトは 0 // 0 - `パッシブ` diff --git a/docs/ko-kr/protocol/copilot-schema.md b/docs/ko-kr/protocol/copilot-schema.md index 77e7b0ad49..3cc0da8a10 100644 --- a/docs/ko-kr/protocol/copilot-schema.md +++ b/docs/ko-kr/protocol/copilot-schema.md @@ -20,7 +20,7 @@ JSON 파일은 주석을 지원하지 않으므로, 텍스트 내의 주석은 // 특정 오퍼레이터 지정 { "name": "重岳", // 오퍼레이터명 - "skill": 3, // 스킬 번호. 선택 사항, 기본값 1, 범위 [0, 3] + "skill": 3, // 스킬 번호. 선택 사항, 기본값 0, 범위 [0, 3] "skill_usage": 2, // 스킬 사용법. 선택 사항, 기본값 0 // 0 - 자동 사용 안 함 ("actions" 필드에 의존) // 1 - 쿨타임 찰 때마다 사용 (예: 쏜즈 3스킬, 머틀 1스킬 등) diff --git a/docs/zh-cn/protocol/copilot-schema.md b/docs/zh-cn/protocol/copilot-schema.md index ebdf8bd276..0f9fbd545f 100644 --- a/docs/zh-cn/protocol/copilot-schema.md +++ b/docs/zh-cn/protocol/copilot-schema.md @@ -20,7 +20,7 @@ icon: ph:sword-bold // 指定干员 { "name": "重岳", // 干员名 - "skill": 3, // 技能序号。可选,默认为 1,取值范围 [0, 3] + "skill": 3, // 技能序号。可选,默认为 0,取值范围 [0, 3] "skill_usage": 2, // 技能用法。可选,默认为 0 // 0 - 不自动使用(依赖 "actions" 字段) // 1 - 好了就用,有多少次用多少次(例如干员 棘刺 3 技能、桃金娘 1 技能等) diff --git a/docs/zh-tw/protocol/copilot-schema.md b/docs/zh-tw/protocol/copilot-schema.md index 27988d69a7..d4bf843885 100644 --- a/docs/zh-tw/protocol/copilot-schema.md +++ b/docs/zh-tw/protocol/copilot-schema.md @@ -20,7 +20,7 @@ icon: ph:sword-bold // 指定幹員 { "name": "重岳", // 幹員名稱 - "skill": 3, // 技能序號。選填,預設為 1,取值範圍 [0, 3] + "skill": 3, // 技能序號。選填,預設為 0,取值範圍 [0, 3] "skill_usage": 2, // 技能用法。選填,預設為 0 // 0 - 不自動使用(依賴 "actions" 欄位) // 1 - 好了就用,有多少次用多少次(例如幹員 棘刺 3 技能、桃金娘 1 技能等) diff --git a/src/MaaCore/Config/Miscellaneous/CopilotConfig.cpp b/src/MaaCore/Config/Miscellaneous/CopilotConfig.cpp index 73d00f8711..747f9b1765 100644 --- a/src/MaaCore/Config/Miscellaneous/CopilotConfig.cpp +++ b/src/MaaCore/Config/Miscellaneous/CopilotConfig.cpp @@ -53,7 +53,7 @@ asst::battle::copilot::OperUsageGroups asst::CopilotConfig::parse_groups(const j for (const auto& oper_info : opt.value()) { OperUsage oper; oper.name = oper_info.at("name").as_string(); - oper.skill = oper_info.get("skill", 1); + oper.skill = oper_info.get("skill", 0); oper.skill_usage = static_cast(oper_info.get("skill_usage", 0)); oper.skill_times = oper_info.get("skill_times", 1); // 使用技能的次数,默认为 1,兼容曾经的作业 @@ -96,7 +96,7 @@ asst::battle::copilot::OperUsageGroups asst::CopilotConfig::parse_groups(const j for (const auto& oper_info : group_info.at("opers").as_array()) { OperUsage oper; oper.name = oper_info.at("name").as_string(); - oper.skill = oper_info.get("skill", 1); + oper.skill = oper_info.get("skill", 0); oper.skill_usage = static_cast(oper_info.get("skill_usage", 0)); oper.skill_times = oper_info.get("skill_times", 1); // 使用技能的次数,默认为 1,兼容曾经的作业 diff --git a/src/MaaCore/Task/Interface/CopilotTask.cpp b/src/MaaCore/Task/Interface/CopilotTask.cpp index 18b38ed619..311c6c1a7e 100644 --- a/src/MaaCore/Task/Interface/CopilotTask.cpp +++ b/src/MaaCore/Task/Interface/CopilotTask.cpp @@ -157,7 +157,7 @@ bool asst::CopilotTask::set_params(const json::value& params) callback(AsstMsg::SubTaskError, info); return false; } - user_additional.emplace_back(std::pair { std::move(name), op.get("skill", 1) }); + user_additional.emplace_back(std::pair { std::move(name), op.get("skill", 0) }); } m_formation_task_ptr->set_user_additional(std::move(user_additional)); } diff --git a/src/MaaWpfGui/Models/AsstTasks/AsstCopilotTask.cs b/src/MaaWpfGui/Models/AsstTasks/AsstCopilotTask.cs index a803e7afb2..78c3c3ac3d 100644 --- a/src/MaaWpfGui/Models/AsstTasks/AsstCopilotTask.cs +++ b/src/MaaWpfGui/Models/AsstTasks/AsstCopilotTask.cs @@ -128,10 +128,10 @@ public class AsstCopilotTask : AsstBaseTask public string Name { get; set; } = string.Empty; /// - /// Gets or sets 技能序号,可选,默认为 1,取值范围 [1, 3] + /// Gets or sets 技能序号,可选,默认为 0,取值范围 [0, 3] /// [JsonProperty("skill")] - public int Skill { get; set; } = 1; + public int Skill { get; set; } = 0; /// /// Gets or sets 模组编号,可选,默认为 0 diff --git a/src/MaaWpfGui/Models/Copilot/CopilotModel.cs b/src/MaaWpfGui/Models/Copilot/CopilotModel.cs index 643a350aa5..53aeddcc20 100644 --- a/src/MaaWpfGui/Models/Copilot/CopilotModel.cs +++ b/src/MaaWpfGui/Models/Copilot/CopilotModel.cs @@ -136,10 +136,10 @@ public class CopilotModel : CopilotBase public string Name { get; set; } = string.Empty; /// - /// Gets or sets 技能序号,可选,默认为1,取值范围 [1, 3] + /// Gets or sets 技能序号,可选,默认为 0,取值范围 [0, 3] /// [JsonProperty("skill")] - public int Skill { get; set; } = 1; + public int Skill { get; set; } = 0; /// /// Gets or sets 技能用法。可选,默认为 0 diff --git a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs index c4aa094f01..f0a7f15b31 100644 --- a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs @@ -449,9 +449,9 @@ public partial class CopilotViewModel : Screen } int skill = op.Skill; - if (skill < 1) + if (skill < 0) { - skill = 1; + skill = 0; } else if (skill > 3) { @@ -477,10 +477,10 @@ public partial class CopilotViewModel : Screen { var name = match.Groups["name"].Value.Trim(); var skillStr = match.Groups["skill"].Value; - int skill = string.IsNullOrEmpty(skillStr) ? 1 : int.Parse(skillStr); - if (skill < 1) + int skill = string.IsNullOrEmpty(skillStr) ? 0 : int.Parse(skillStr); + if (skill < 0) { - skill = 1; + skill = 0; } else if (skill > 3) { @@ -505,7 +505,7 @@ public partial class CopilotViewModel : Screen // 如果列表为空,添加一行空行 if (UserAdditionalItems.Count == 0) { - var newItem = new UserAdditionalItemViewModel { Name = string.Empty, Skill = 1, Module = 0 }; + var newItem = new UserAdditionalItemViewModel { Name = string.Empty, Skill = 0, Module = 0 }; UserAdditionalItems.Add(newItem); } @@ -527,9 +527,9 @@ public partial class CopilotViewModel : Screen } int skill = item.Skill; - if (skill < 1) + if (skill < 0) { - skill = 1; + skill = 0; } else if (skill > 3) { @@ -573,7 +573,7 @@ public partial class CopilotViewModel : Screen return; } - var newItem = new UserAdditionalItemViewModel { Name = string.Empty, Skill = 1, Module = 0 }; + var newItem = new UserAdditionalItemViewModel { Name = string.Empty, Skill = 0, Module = 0 }; UserAdditionalItems.Add(newItem); }