game2006/server/gameserver/new_hero_agent.h
aozhiwei 41c2b17f77 1
2023-10-13 17:23:32 +08:00

97 lines
2.6 KiB
C++

#pragma once
#include "new_base_agent.h"
class Hero;
class RoomAgent;
class TeamAgent;
class TargetAgent;
class HeroAgent : public BaseAgent
{
public:
HeroAgent();
virtual ~HeroAgent();
BEHAVIAC_DECLARE_AGENTTYPE(HeroAgent, BaseAgent)
void Exec();
void SetOwner(Creature* owner);
int GetUniId();
int GetAgentType();
bool IsMoving();
glm::vec3 GetPos();
bool IsDead();
glm::vec3 GetSafeAreaCenter();
float GetSafeAreaRadius();
float GetHp();
float GetMaxHp();
void OpenBulletTraceMode();
void CloseBulletTraceMode();
float CalcDistance(const glm::vec3& target_pos);
int GetHeroId();
int GetLevel();
bool CanShot();
bool CanUseSkill();
void UseSkill(int skill_id);
void SendEmote(int emote);
int GetBattleTimes();
void SetMoveDir(const glm::vec3& dir);
void SetAttackDir(const glm::vec3& dir);
void ShotNormal(const glm::vec3& dir);
void ShotTrace();
glm::vec3 GetRandomDir();
glm::vec3 GetTargetDir();
glm::vec3 RandomPoint(float range);
float GetShotRange();
void SetV(int id, int val);
int GetV(int id);
int IncV(int id);
int DecV(int id);
behaviac::EBTStatus CoIdle(int time);
behaviac::EBTStatus CoMoveCurrentTargetRaycast();
behaviac::EBTStatus CoShotCurrentTargetRaycast();
behaviac::EBTStatus CoMoveMasterRaycast();
behaviac::EBTStatus CoFindPath(const glm::vec3& pos);
behaviac::EBTStatus CoFindPathEx(const glm::vec3& pos, float distance);
behaviac::EBTStatus CoStartMove(float distance);
behaviac::EBTStatus CoSleep(int time);
virtual Room* GetRoom() override;
public:
RoomAgent* room_agent = nullptr;
TeamAgent* team_agent = nullptr;
HeroAgent* master_agent = nullptr;
TargetAgent* current_target_agent = nullptr;
float task_param0 = 0.0f;
float task_param1 = 0.0f;
float task_param2 = 0.0f;
float task_param3 = 0.0f;
float task_param4 = 0.0f;
float tmp_val0 = 0.0f;
float tmp_val1 = 0.0f;
float tmp_val2 = 0.0f;
float tmp_val3 = 0.0f;
float tmp_val4 = 0.0f;
glm::vec3 tmp_point0 = glm::vec3(0.0f, 0.0f, 0.0f);
glm::vec3 tmp_point1 = glm::vec3(0.0f, 0.0f, 0.0f);
glm::vec3 tmp_point2 = glm::vec3(0.0f, 0.0f, 0.0f);
int out_errno = 0;
float out_val0 = 0.0;
float out_val1 = 0.0;
float out_val2 = 0.0;
float out_val3 = 0.0;
float out_val4 = 0.0;
glm::vec3 out_point0 = glm::vec3(0.0f, 0.0f, 0.0f);
glm::vec3 out_point1 = glm::vec3(0.0f, 0.0f, 0.0f);
glm::vec3 out_point2 = glm::vec3(0.0f, 0.0f, 0.0f);
private:
Creature* owner_ = nullptr;
bool bullet_trace_mode_ = false;
};