mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
perf: 优化自动战斗的cooling等待条件
This commit is contained in:
@@ -278,14 +278,11 @@ bool asst::BattleProcessTask::wait_condition(const Action& action)
|
||||
// 计算有几个干员在cd
|
||||
if (action.cooling >= 0) {
|
||||
while (!need_exit()) {
|
||||
BattleImageAnalyzer analyzer(ctrler()->get_image());
|
||||
analyzer.set_target(BattleImageAnalyzer::Target::Oper);
|
||||
if (analyzer.analyze()) {
|
||||
int cooling_count = static_cast<int>(
|
||||
ranges::count_if(analyzer.get_opers(), [](const auto& oper) -> bool { return oper.cooling; }));
|
||||
if (cooling_count == action.cooling) {
|
||||
break;
|
||||
}
|
||||
update_deployment();
|
||||
size_t cooling_count = ranges::count_if(m_cur_deployment_opers | views::values,
|
||||
[](const auto& oper) -> bool { return oper.cooling; });
|
||||
if (cooling_count == action.cooling) {
|
||||
break;
|
||||
}
|
||||
use_all_ready_skill();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user