game2004/server/gameserver/zombiemode.ai.h
2020-08-06 14:16:00 +08:00

49 lines
920 B
C++

#pragma once
#include "aicomponent.h"
enum ZombieState_e
{
ZSE_Idle = 0,
ZSE_Thinking = 1,
ZSE_Attack = 2,
ZSE_RandomWalk = 3,
ZSE_Pursuit = 4,
ZSE_FindPath = 5,
ZSE_FindPathMoving = 6
};
class Human;
class ZombieAINode;
class ZombieModeAI : public AIComponent
{
public:
ZombieModeAI();
virtual ~ZombieModeAI() override;
virtual void Update(int delta_time) override;
virtual void Reset() override;
float GetAttackRate();
private:
void UpdateAI();
void UpdateIdle();
void UpdateThinking();
void UpdateAttack();
void UpdateRandomWalk();
void UpdatePursuit();
void UpdateFindPath();
void UpdateFindPathMoving();
void DoMove();
void ChangeToState(ZombieState_e to_state);
void DoShot();
void DoSkill();
Human* GetTarget();
float GetAttackRange();
int GetAttackTimes();
private:
ZombieAINode* node_ = nullptr;
};