This commit is contained in:
aozhiwei 2022-12-06 16:49:42 +08:00
parent 12cbc18a48
commit ea45d1b741

View File

@ -121,6 +121,11 @@ behaviac::EBTStatus AndroidAgent::DoAttack()
if (status_ == behaviac::BT_RUNNING) {
return status_runing_cb_();
}
Human* enemy = GetOwner()->room->FindEnemy(GetOwner());
if (enemy) {
return behaviac::BT_FAILURE;
}
a8::Vec2 dir = GetOwner()->GetMoveDir();
dir.Rotate((10 + rand() % 360)/ 180.0f);
dir.Normalize();