This commit is contained in:
aozhiwei 2020-07-15 20:35:41 +08:00
parent 09ccefb3cd
commit 44cd830ee0

View File

@ -555,13 +555,9 @@ void AndroidNewAI::UpdatePursuit()
Human* myself = (Human*)owner;
float distance = myself->GetPos().Distance(node_.target->GetPos());
if (distance < GetAttackRange()) {
#if 0
UpdateAttack();
#else
ChangeToStateNewAI(ASE_Attack);
#endif
} else {
if (node_.exec_frame_num > 100) {
if (node_.exec_frame_num > 100 * 2) {
ChangeToStateNewAI(ASE_RandomWalk);
}
}
@ -581,7 +577,8 @@ void AndroidNewAI::DoMoveNewAI()
hum->_UpdateMove(speed);
hum->on_move_collision = nullptr;
if (node_.nearest_human) {
if (hum->GetPos().ManhattanDistance(node_.nearest_human->GetPos()) < 200) {
if (node_.main_state != ASE_Pursuit &&
hum->GetPos().ManhattanDistance(node_.nearest_human->GetPos()) < 200) {
ChangeToStateNewAI(ASE_Thinking);
} else if (hum->GetPos().ManhattanDistance(node_.nearest_human->GetPos()) > 800) {
GetTarget();