1
This commit is contained in:
parent
7af787519a
commit
15816af295
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user