diff --git a/resource/copilot/YanFengRongDong-30.json b/resource/copilot/YanFengRongDong-30.json new file mode 100644 index 0000000000..75d9a2c21c --- /dev/null +++ b/resource/copilot/YanFengRongDong-30.json @@ -0,0 +1,194 @@ +{ + "minimum_required": "v4.0", + "desc": { + "title": "《全自动危机合约 30》", + "details": "作业抄自 https://www.bilibili.com/video/BV1mF411L7PF" + }, + "stage_name": "obt/rune/level_rune_11-01", + "opers": [ + { + "name": "史尔特尔", + "skill": 3 + }, + { + "name": "银灰", + "skill": 3 + }, + { + "name": "号角", + "skill": 3, + "skill_usage": 1 + }, + { + "name": "风笛", + "skill": 3 + }, + { + "name": "铃兰", + "skill": 3 + }, + { + "name": "傀影", + "skill": 3 + }, + { + "name": "卡夫卡", + "skill": 2 + }, + { + "name": "极境", + "skill": 1, + "skill_usage": 1 + }, + { + "name": "阿", + "skill": 3 + }, + { + "name": "温蒂", + "skill": 3 + }, + { + "name": "桃金娘", + "skill": 1, + "skill_usage": 1 + }, + { + "name": "卡缇", + "skill": 1 + }, + { + "name": "耀骑士临光", + "skill": 2 + } + ], + "actions": [ + { + "name": "桃金娘", + "location": [ + 5, + 1 + ], + "direction": "右" + }, + { + "name": "风笛", + "location": [ + 9, + 3 + ], + "direction": "上" + }, + { + "name": "极境", + "location": [ + 6, + 1 + ], + "direction": "右" + }, + { + "pre_delay": 4500, + "name": "傀影", + "location": [ + 8, + 1 + ], + "direction": "下" + }, + { + "type": "撤退", + "name": "傀影" + }, + { + "name": "温蒂", + "location": [ + 10, + 4 + ], + "direction": "左" + }, + { + "type": "技能", + "name": "风笛" + }, + { + "kills": 3, + "type": "撤退", + "name": "风笛" + }, + { + "name": "号角", + "location": [ + 5, + 2 + ], + "direction": "左" + }, + { + "name": "工程蓄水炮", + "location": [ + 9, + 4 + ], + "direction": "下" + }, + { + "pre_delay": 12000, + "type": "技能", + "name": "温蒂" + }, + { + "type": "撤退", + "name": "温蒂" + }, + { + "name": "史尔特尔", + "location": [ + 6, + 6 + ], + "direction": "右" + }, + { + "pre_delay": 6000, + "type": "技能", + "name": "史尔特尔" + }, + { + "kills": 12, + "type": "撤退", + "name": "史尔特尔" + }, + { + "name": "铃兰", + "location": [ + 10, + 5 + ], + "direction": "左" + }, + { + "kills": 15, + "type": "撤退", + "name": "号角" + }, + { + "name": "风笛", + "location": [ + 8, + 6 + ], + "direction": "上" + }, + { + "pre_delay": 5000, + "name": "傀影", + "location": [ + 9, + 3 + ], + "direction": "下" + } + ] +} diff --git a/resource/tasks.json b/resource/tasks.json index c1ca55f9a0..2f3d479462 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -4513,6 +4513,7 @@ }, "BattleAutoSkillFlag": { "template": "BattleSkillReady.png", + "cache": false, "rectMove": [ -40, -150, @@ -4533,6 +4534,7 @@ ], "cache": false, "action": "ClickSelf", + "preDelay": 500, "rearDelay": 500, "rectMove": [ 0, diff --git a/resource/template/BattleSkillReady.png b/resource/template/BattleSkillReady.png index 8b33c8b382..638d3c5b11 100644 Binary files a/resource/template/BattleSkillReady.png and b/resource/template/BattleSkillReady.png differ diff --git a/src/MeoAssistant/BattleProcessTask.cpp b/src/MeoAssistant/BattleProcessTask.cpp index 707899ac50..070e10f8c7 100644 --- a/src/MeoAssistant/BattleProcessTask.cpp +++ b/src/MeoAssistant/BattleProcessTask.cpp @@ -83,16 +83,6 @@ bool asst::BattleProcessTask::analyze_opers_preview() std::this_thread::yield(); } - //#ifdef ASST_DEBUG - auto draw = m_ctrler->get_image(); - for (const auto& [loc, info] : m_normal_tile_info) { - std::string text = "( " + std::to_string(loc.x) + ", " + std::to_string(loc.y) + " )"; - cv::putText(draw, text, cv::Point(info.pos.x - 30, info.pos.y), 1, 1.2, cv::Scalar(0, 0, 255), 2); - } - - cv::imwrite("map.png", draw); - //#endif - // 干员头像出来之后,还要过 2 秒左右才可以点击,这里要加个延时 sleep(Task.get("BattleWaitingToLoad")->rear_delay); while (true) { @@ -102,6 +92,17 @@ bool asst::BattleProcessTask::analyze_opers_preview() } std::this_thread::yield(); } + { + //#ifdef ASST_DEBUG + auto draw = m_ctrler->get_image(); + for (const auto& [loc, info] : m_normal_tile_info) { + std::string text = "( " + std::to_string(loc.x) + ", " + std::to_string(loc.y) + " )"; + cv::putText(draw, text, cv::Point(info.pos.x - 30, info.pos.y), 1, 1.2, cv::Scalar(0, 0, 255), 2); + } + + cv::imwrite("map.png", draw); + //#endif + } battle_pause(); auto opers = oper_analyzer.get_opers(); @@ -318,6 +319,9 @@ bool asst::BattleProcessTask::do_action(const BattleAction& action) bool asst::BattleProcessTask::wait_condition(const BattleAction& action) { while (m_kills < action.kills) { + if (need_exit()) { + return false; + } const auto& image = m_ctrler->get_image(); BattleImageAnalyzer analyzer(image); @@ -336,8 +340,10 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) // 部署干员还有额外等待费用够或 CD 转好 if (action.type == BattleActionType::Deploy) { const std::string& name = m_group_to_oper_mapping[action.group_name].name; - while (true) { + if (need_exit()) { + return false; + } const auto& image = m_ctrler->get_image(); update_opers_info(image);