From a41a3ea009e544356cf18cdca026ba0374e1fa50 Mon Sep 17 00:00:00 2001 From: status102 Date: Sun, 12 Nov 2023 22:52:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E6=97=B6=E8=A1=A5=E5=81=BF=E8=B7=9D=E7=A6=BB=E8=BF=87=E5=A4=A7?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E9=83=A8=E7=BD=B2=E6=9C=9D=E5=90=91?= =?UTF-8?q?=E6=BB=91=E5=8A=A8=E8=B5=B7=E5=A7=8B=E7=82=B9=E8=B6=85=E5=87=BA?= =?UTF-8?q?=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks.json | 2 +- src/MaaCore/Task/BattleHelper.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/resource/tasks.json b/resource/tasks.json index 0c8cc9986d..3783c1bf0d 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -8179,7 +8179,7 @@ "Doc": "pre 是将干员滑动到场上的 duration 系数;post 是设置干员朝向滑动的 duration", "specialParams": [ 400, - 200, + 100, 2, 0, 100 diff --git a/src/MaaCore/Task/BattleHelper.cpp b/src/MaaCore/Task/BattleHelper.cpp index 7e1ee44fce..eb1e671f98 100644 --- a/src/MaaCore/Task/BattleHelper.cpp +++ b/src/MaaCore/Task/BattleHelper.cpp @@ -321,10 +321,8 @@ bool asst::BattleHelper::deploy_oper(const std::string& name, const Point& loc, static_cast(swipe_oper_task_ptr->special_params.at(0) * scale_size.second / 720.0); Point end_point = target_point + (direction_target * coeff); - // 经粗略测算,方向区域倾斜大概是 1/5 - const static auto radian = -std::atan(0.2); fix_swipe_out_of_limit(target_point, end_point, scale_size.first, scale_size.second, - swipe_oper_task_ptr->special_params.at(1), radian); + swipe_oper_task_ptr->special_params.at(1)); m_inst_helper.sleep(use_oper_task_ptr->post_delay); m_inst_helper.ctrler()->swipe(target_point, end_point, swipe_oper_task_ptr->post_delay); @@ -693,7 +691,10 @@ void asst::BattleHelper::fix_swipe_out_of_limit(Point& p1, Point& p2, int width, }; if (auto point_distance = Point::distance(adjust, { 0, 0 }); point_distance > max_distance) { - adjust = adjust * static_cast(max_distance / point_distance); + adjust = adjust = { + static_cast(adjust.x * max_distance / point_distance), + static_cast(adjust.y * max_distance / point_distance), + }; } Log.info(__FUNCTION__, "swipe end_point out of limit, start:", p1, ", end:", p2, ", adjust:", adjust);