⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gm_unit.h

📁 混乱竞技场的全套代码,客户端资源可以网上搜
💻 H
字号:
// GsUnit.h: interface for the GsUnit class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GSUNIT_H__D162DE54_37F3_4B7E_97F6_4463851325C8__INCLUDED_)
#define AFX_GSUNIT_H__D162DE54_37F3_4B7E_97F6_4463851325C8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "GM_Object.h"

#define GSUNIT_NORMAL	0x00000000
#define	GSUNIT_DEATH	0x80000000

enum	UINT_AI_TYPE
{
	UNIT_AI_NONE	= 0,			//无AI,用于不受电脑控制的单位
	UNIT_AI_PASSIVE,				//被动的,受到攻击时才还击
	UNIT_AI_WARLIKE,
	UINT_AI_COUNT
};



class GM_Unit   : public GM_Object  
{
	friend	GM_World;
	
	LONG m_aim_x;
	LONG m_aim_y;
	LONG m_aim_h;

public:

	LONG DoDeath();
	LONG DoWalk();
	LONG DoEndWalk();
	
	VOID PlyFlinch();
	BOOL IsWaiting();
	VOID PlyFidget();
	VOID PlyWait();
	VOID PlyWalk(float degree, int act_count=1);
	VOID PlyRanged(LONG posX, LONG posY);
	VOID PlySpell(int x, int y, const char* spell);
	VOID PlyDeath();
	VOID AddAnimation(KEY key, GSANI* pAni);
	void PlyWalkTo(int x, int y);
	VOID PlyMeleeTo(int x, int y, int act_count=1);
	BOOL TestEyeshot(LONG nX, LONG nY);
	BOOL TestEyeshot(GM_Object* pObject);
	VOID SetEyeshot(float fEyeshot);
	VOID GetPos(LONG& nX, LONG& nY);
	BOOL is_death();
	BOOL is_walk();
	BOOL is_flinch();
	BOOL is_wait();
	BOOL is_fidget();
	BOOL is_melee();
	BOOL is_ranged();
	BOOL is_spell();
	BOOL is_block();

	virtual BOOL Create(ID id, const char *szFile, float x, float y, float h);
	virtual VOID Cleanup();

	virtual BOOL CanRanged();
	virtual BOOL CanMelee();
	
	virtual HRESULT	Render();
	virtual LONG	Update();
	virtual VOID	RunAI();

	GM_Unit(GM_World* pScene);
	virtual ~GM_Unit();
protected:
	virtual VOID DoTestHit();
	virtual VOID OnMove();
	virtual VOID OnWait();
public:
	void SetRender(BOOL bRender);
	DWORD	m_dwActionTime;
	DWORD	m_dwActionCount;
	LONG	m_Flag;
	LONG	m_sex;
protected:
	// 大小 1.0 为基准
	float	m_tall_rate;
	float	m_alpha;
	float	m_eyeshot_x;
	float	m_eyeshot_y;
	float	m_degree_look_at;
	float	m_walk_speed;
	float	m_run_speed;
	float	m_melee_radius;
	float	m_ranged_radius;
	GSANI	m_ani_melee;
	GSANI	m_ani_ranged;
	GSANI	m_ani_spell;
	GSANI	m_ani_block;
	GSANI	m_ani_flinch;
	GSANI	m_ani_fidget;
	GSANI	m_ani_begin_walk;
	GSANI	m_ani_end_walk;
	GSANI	m_ani_walk;
	GSANI	m_ani_run;
	GSANI	m_ani_wait;
	GSANI	m_ani_death;

	GSANI	m_ani_arrow;

	std::map<KEY, GSANI*>	m_mapAni;
protected:
	UINT_AI_TYPE	m_ai_type;
};



#endif // !defined(AFX_GSUNIT_H__D162DE54_37F3_4B7E_97F6_4463851325C8__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -