1
This commit is contained in:
parent
95a25be38b
commit
d62d418f50
@ -22,7 +22,7 @@ public:
|
||||
behaviac::EBTStatus DoPursuit();
|
||||
|
||||
private:
|
||||
glm::vec3& AdjustShotDir(glm::vec3& shot_dir);
|
||||
virtual glm::vec3& AdjustShotDir(glm::vec3& shot_dir) override;
|
||||
|
||||
private:
|
||||
Android* owner_ = nullptr;
|
||||
|
@ -446,7 +446,20 @@ bool BaseAgent::ShotCanReach(const glm::vec3& target_pos)
|
||||
|
||||
behaviac::EBTStatus BaseAgent::CoShot()
|
||||
{
|
||||
if (!current_target_.Get()) {
|
||||
return behaviac::BT_FAILURE;
|
||||
}
|
||||
if (GlmHelper::IsEqual2D(GetOwner()->GetPos().ToGlmVec3(),
|
||||
current_target_.Get()->GetPos().ToGlmVec3())) {
|
||||
return behaviac::BT_FAILURE;
|
||||
}
|
||||
bool shot_ok = false;
|
||||
glm::vec3 dir = GetOwner()->GetPos().CalcDir(current_target_.Get()->GetPos());
|
||||
GlmHelper::Normalize(dir);
|
||||
GetOwner()->SetAttackDir(dir);
|
||||
GetOwner()->shot_hold = true;
|
||||
GetOwner()->Shot(AdjustShotDir(dir), shot_ok, 0, 0);
|
||||
return behaviac::BT_SUCCESS;
|
||||
}
|
||||
|
||||
bool BaseAgent::IsNearGas(float distance)
|
||||
@ -461,7 +474,7 @@ behaviac::EBTStatus BaseAgent::CoRunGas()
|
||||
|
||||
float BaseAgent::GetSafeAreaRadius()
|
||||
{
|
||||
return 500;
|
||||
return GetOwner()->room->GetGasData().gas_progress;
|
||||
}
|
||||
|
||||
bool BaseAgent::IsDead()
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
public:
|
||||
void SetOwner(Creature* owner) { owner_ = owner; };
|
||||
Creature* GetOwner() { return owner_; };
|
||||
virtual glm::vec3& AdjustShotDir(glm::vec3& shot_dir) { return shot_dir; };
|
||||
|
||||
protected:
|
||||
behaviac::EBTStatus DoRunningCb();
|
||||
|
Loading…
x
Reference in New Issue
Block a user