diff --git a/server/gameserver/android_new.ai.cc b/server/gameserver/android_new.ai.cc index 70e8154..acdfa6a 100644 --- a/server/gameserver/android_new.ai.cc +++ b/server/gameserver/android_new.ai.cc @@ -696,7 +696,11 @@ void AndroidNewAI::DoShotNewAI() } bool shot_ok = false; - a8::Vec2 shot_dir = node_.target->GetPos() - myself->GetPos(); + a8::Vec2 shot_dir = myself->attack_dir; + if (node_.total_shot_times >= node_.next_total_shot_times) { + shot_dir = node_.target->GetPos() - myself->GetPos(); + node_.next_total_shot_times += 7 + (rand() % 6); + } if (std::abs(shot_dir.x) > FLT_EPSILON || std::abs(shot_dir.y) > FLT_EPSILON) { shot_dir.Normalize(); @@ -714,6 +718,7 @@ void AndroidNewAI::DoShotNewAI() node_.start_shot_frameno = myself->room->GetFrameNo(); } ++node_.shot_times; + ++node_.total_shot_times; } } } diff --git a/server/gameserver/android_new.ai.h b/server/gameserver/android_new.ai.h index b21833e..e2dde8e 100644 --- a/server/gameserver/android_new.ai.h +++ b/server/gameserver/android_new.ai.h @@ -20,6 +20,8 @@ public: long long exec_frame_num = 0; long long start_shot_frameno = 0; int shot_times = 0; + int total_shot_times = 0; + int next_total_shot_times = 0; long long param1 = 0; Human* target = nullptr;