rft!: 自动战斗协议 干员技能默认值变更为 0 (不指定技能) (#15898)

* rft!: 自动战斗协议 干员技能默认值变更为 0 (不指定技能)

* fix: 检查范围修复
This commit is contained in:
Status102
2026-03-02 23:16:40 +08:00
committed by GitHub
parent 56b585d424
commit b2d8591974
10 changed files with 21 additions and 21 deletions

View File

@@ -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.)

View File

@@ -20,7 +20,7 @@ JSONファイルはコメントをサポートしておらず、テキスト内
{
"name": "ソーンズ", // オペーレーター名
"skill": 3, // スキルID と範囲 [0, 3], オプション, 1 がデフォルト
"skill": 3, // スキルID と範囲 [0, 3], オプション, 0 がデフォルト
"skill_usage": 0, // スキルの使用, オプション, デフォルトは 0
// 0 - `パッシブ`

View File

@@ -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스킬 등)

View File

@@ -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 技能等)

View File

@@ -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 技能等)

View File

@@ -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<battle::SkillUsage>(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<battle::SkillUsage>(oper_info.get("skill_usage", 0));
oper.skill_times = oper_info.get("skill_times", 1); // 使用技能的次数,默认为 1兼容曾经的作业

View File

@@ -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::string, int> { std::move(name), op.get("skill", 1) });
user_additional.emplace_back(std::pair<std::string, int> { std::move(name), op.get("skill", 0) });
}
m_formation_task_ptr->set_user_additional(std::move(user_additional));
}

View File

@@ -128,10 +128,10 @@ public class AsstCopilotTask : AsstBaseTask
public string Name { get; set; } = string.Empty;
/// <summary>
/// Gets or sets 技能序号,可选,默认为 1,取值范围 [1, 3]
/// Gets or sets 技能序号,可选,默认为 0,取值范围 [0, 3]
/// </summary>
[JsonProperty("skill")]
public int Skill { get; set; } = 1;
public int Skill { get; set; } = 0;
/// <summary>
/// Gets or sets 模组编号,可选,默认为 0

View File

@@ -136,10 +136,10 @@ public class CopilotModel : CopilotBase
public string Name { get; set; } = string.Empty;
/// <summary>
/// Gets or sets 技能序号,可选,默认为1,取值范围 [1, 3]
/// Gets or sets 技能序号,可选,默认为 0,取值范围 [0, 3]
/// </summary>
[JsonProperty("skill")]
public int Skill { get; set; } = 1;
public int Skill { get; set; } = 0;
/// <summary>
/// Gets or sets 技能用法。可选,默认为 0

View File

@@ -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);
}