From aa1f39bbfbe6b359fed34dc4d2eb7bf9e6db900b Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 2 Jan 2023 03:44:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=85=A8?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/copilot/SSS_Test.json | 3 +++ .../Config/Miscellaneous/SSSCopilotConfig.cpp | 1 + .../Task/Miscellaneous/SSSBattleProcessTask.cpp | 12 +++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/resource/copilot/SSS_Test.json b/resource/copilot/SSS_Test.json index 6c09832f46..0894652d7d 100644 --- a/resource/copilot/SSS_Test.json +++ b/resource/copilot/SSS_Test.json @@ -87,6 +87,9 @@ ], "draw_as_possible": true, "actions": [ + { + "type": "二倍速" + }, { "name": "桃金娘", "location": [ diff --git a/src/MaaCore/Config/Miscellaneous/SSSCopilotConfig.cpp b/src/MaaCore/Config/Miscellaneous/SSSCopilotConfig.cpp index 0d9cbc9847..8e033feece 100644 --- a/src/MaaCore/Config/Miscellaneous/SSSCopilotConfig.cpp +++ b/src/MaaCore/Config/Miscellaneous/SSSCopilotConfig.cpp @@ -72,6 +72,7 @@ bool asst::SSSCopilotConfig::parse(const json::value& json) stage_data.draw_as_possible = stage.at("draw_as_possible").as_boolean(); stage_data.actions = CopilotConfig::parse_actions(stage); + stage_data.groups = m_data.groups; for (const auto& strategy_info : stage.at("strategies").as_array()) { Strategy strategy; diff --git a/src/MaaCore/Task/Miscellaneous/SSSBattleProcessTask.cpp b/src/MaaCore/Task/Miscellaneous/SSSBattleProcessTask.cpp index 1704cc6cb8..6a493b3785 100644 --- a/src/MaaCore/Task/Miscellaneous/SSSBattleProcessTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/SSSBattleProcessTask.cpp @@ -73,8 +73,14 @@ bool asst::SSSBattleProcessTask::do_strategic_action(const cv::Mat& reusable) if (m_all_cores.contains(name)) { exist_core.emplace(name, oper); } - else if (oper.available) { - available_tool_men.emplace(oper.role, oper); + else { + if (oper.available) { + available_tool_men.emplace(oper.role, oper); + } + if (m_skill_usage.find(name) == m_skill_usage.cend()) { + // 工具人的技能一概好了就用 + m_skill_usage.emplace(name, SkillUsage::Possibly); + } } } @@ -85,7 +91,7 @@ bool asst::SSSBattleProcessTask::do_strategic_action(const cv::Mat& reusable) const auto& core = exist_core.at(strategy.core); if (!core.available) { // 直接返回,等费用,等下次循环处理部署逻辑 - return true; + break; } // 部署完,画面会发生变化,所以直接返回,后续逻辑交给下次循环处理 return deploy_oper(strategy.core, strategy.location, strategy.direction);