1
This commit is contained in:
parent
418d98deea
commit
e42c46ffd6
@ -482,7 +482,7 @@ void AndroidNewAI::UpdateThinking()
|
||||
ChangeToStateNewAI(ASE_RandomWalk);
|
||||
}
|
||||
} else {
|
||||
Human* target = GetTarget();
|
||||
Creature* target = GetTarget();
|
||||
if (target) {
|
||||
node_.target.Attach(target);
|
||||
ChangeToStateNewAI(ASE_Attack);
|
||||
@ -682,7 +682,7 @@ void AndroidNewAI::ChangeToStateNewAI(AndroidStateEx_e to_state)
|
||||
node_.exec_frame_num = 0;
|
||||
}
|
||||
|
||||
Human* AndroidNewAI::GetTarget()
|
||||
Creature* AndroidNewAI::GetTarget()
|
||||
{
|
||||
if (GetAiLevel() <= 1) {
|
||||
return nullptr;
|
||||
@ -692,20 +692,11 @@ Human* AndroidNewAI::GetTarget()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Human* target = nullptr;
|
||||
myself->TouchAllLayerHumanList
|
||||
Creature* target = nullptr;
|
||||
myself->TouchProperTargets
|
||||
(
|
||||
[myself, &target] (Human* hum, bool& stop)
|
||||
[myself, &target] (Creature* hum, bool& stop)
|
||||
{
|
||||
if (hum->dead) {
|
||||
return;
|
||||
}
|
||||
if (a8::HasBitFlag(hum->status, HS_Disable)) {
|
||||
return;
|
||||
}
|
||||
if (myself->team_id == hum->team_id) {
|
||||
return;
|
||||
}
|
||||
if (target) {
|
||||
if (myself->GetPos().ManhattanDistance(target->GetPos()) >
|
||||
myself->GetPos().ManhattanDistance(hum->GetPos())) {
|
||||
|
@ -82,7 +82,7 @@ private:
|
||||
void ChangeToStateNewAI(AndroidStateEx_e to_state);
|
||||
void DoShotNewAI();
|
||||
|
||||
Human* GetTarget();
|
||||
Creature* GetTarget();
|
||||
float GetAttackRange();
|
||||
int GetAttackTimes();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user