perf: 优化 自动战斗-战斗列表 跳过战斗后剧情的逻辑

This commit is contained in:
status102
2023-09-18 14:28:54 +08:00
parent 4102f9727e
commit eb852d0029
2 changed files with 20 additions and 9 deletions

View File

@@ -13131,14 +13131,25 @@
163
]
},
"Copilot@ClickCornerUntilFailedOrThreeStars": {
"Copilot@ClickCornerUntilEndOfAction": {
"algorithm": "JustReturn",
"action": "DoNothing",
"maxTimes": 30,
"exceededNext": [
"Copilot@EndOfAction"
],
"next": [
"Copilot@SkipThePreBattlePlot",
"Copilot@EndOfAction",
"Copilot@ClickCornerBeforeThreeStars"
]
},
"Copilot@SkipThePreBattlePlotConfirm": {
"template": "SkipThePreBattlePlotConfirm.png",
"next": [
"Copilot@ClickCornerUntilEndOfAction"
]
},
"Copilot@EndOfAction": {
"template": "EndOfAction.png",
"action": "DoNothing",
@@ -13159,7 +13170,7 @@
"Doc": "三星之前",
"baseTask": "Copilot@ClickCornerUntilStartButton",
"next": [
"Copilot@ClickCornerUntilFailedOrThreeStars"
"Copilot@ClickCornerUntilEndOfAction"
]
},
"Copilot@ClickCornerUntilStartButton": {

View File

@@ -133,7 +133,13 @@ bool asst::CopilotTask::set_params(const json::value& params)
m_formation_task_ptr->set_support_unit_name(std::move(support_unit_name));
size_t loop_times = params.get("loop_times", 1);
if (loop_times > 1) {
if (need_navigate) {
// 如果没三星就中止
Task.get<OcrTaskInfo>("Copilot@BattleStartPreFlag")->text.emplace_back(m_navigate_name);
m_stop_task_ptr->set_tasks({ "Copilot@ClickCornerUntilEndOfAction" });
m_stop_task_ptr->set_enable(true);
}
else if (loop_times > 1) {
m_stop_task_ptr->set_tasks({ "ClickCornerUntilStartButton" });
m_stop_task_ptr->set_enable(true);
@@ -145,12 +151,6 @@ bool asst::CopilotTask::set_params(const json::value& params)
m_subtasks.insert(m_subtasks.end(), m_subtasks.begin(), raw_end);
}
}
else if (need_navigate) {
// 如果没三星就中止
Task.get<OcrTaskInfo>("Copilot@BattleStartPreFlag")->text.emplace_back(m_navigate_name);
m_stop_task_ptr->set_tasks({ "Copilot@ClickCornerUntilFailedOrThreeStars" });
m_stop_task_ptr->set_enable(true);
}
return true;
}