墨香最新私服

源代码在线查看: object.h

软件大小: 45474 K
上传用户: d_zhihua
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

				// Object.h: interface for the CObject class.
				//
				//////////////////////////////////////////////////////////////////////
				
				#if !defined(AFX_OBJECT_H__A8AFB488_5BB5_45E5_8482_EE4EE2A55DDD__INCLUDED_)
				#define AFX_OBJECT_H__A8AFB488_5BB5_45E5_8482_EE4EE2A55DDD__INCLUDED_
				
				#if _MSC_VER > 1000
				#pragma once
				#endif // _MSC_VER > 1000
				
				#include "GridUnit.h"
				#include "Status.h"
				#include "PtrList.h"
				
				class CBattle;
				class CStunState;
				class CAmplifiedPower;
				
				enum EObjectKind
				{
					eObjectKind_Player = 1,
					eObjectKind_Npc		=	2,
					eObjectKind_Item	=	4,
					eObjectKind_Tactic	=	8,
					eObjectKind_SkillObject=16,
					eObjectKind_Monster	=	32,
					eObjectKind_BossMonster=33,
					eObjectKind_SpecialMonster=34,
				};
				
				enum eSpecialState
				{
					eSpecialState_Stun,
					eSpecialState_AmplifiedPowerPhy,
					eSpecialState_AmplifiedPowerAtt,
				
					eSpecialState_Max
				};
				class CAction;
				class CSpecialState;
				
				class CObject : public CGridUnit
				{
					CSpecialState* m_pSpecialState[eSpecialState_Max];
				
					TILEINDEX m_dwPreoccupiedTileIndex;		// 急痢窍绊 乐绰 鸥老狼 牢郸胶
				
					BOOL m_bInited;
					friend class CObjectFactory;
					friend class CCharMove;
					friend class CObjectStateManager;
					DWORD	m_dwSkillDelayStartTime;		// speedhack check;
				protected:
					CObject();
					virtual ~CObject();
				
					DWORD m_AgentNum;
					BYTE m_ObjectKind;
				
					BASEOBJECT_INFO m_BaseObjectInfo;
					MOVE_INFO m_MoveInfo;
					STATE_INFO	m_ObjectState;
				
					RECOVER_TIME m_LifeRecoverTime;
					YYRECOVER_TIME m_YYLifeRecoverTime;
				
					RECOVER_TIME m_ShieldRecoverTime;
				
					cPtrList m_StatusList;
					
					DWORD m_KyungGongNaeRyuk_LastCheckTime;
					
					CBattle* m_pBattle;
				
					virtual void DoSetInited()	{}
					virtual void DoDamage(CObject* pAttacker,RESULTINFO* pDamageInfo,DWORD beforeLife)	{}
				
					friend class CCharacterCalcManager;
				
					virtual void SetState(BYTE state);
				
				public:
					DWORD GetSkillDelayStartTime() { return m_dwSkillDelayStartTime; }
					void	SetSkillDelayStartTime(DWORD val){ m_dwSkillDelayStartTime = val; }
					BYTE GetBattleTeam()				{	return m_BaseObjectInfo.BattleTeam;	}
					DWORD GetBattleID()				{	return m_BaseObjectInfo.BattleID;	}
					void SetBattleID(DWORD BattleID){ m_BaseObjectInfo.BattleID = BattleID;	}
					CBattle* GetBattle()			{	return m_pBattle;	}
					void SetBattle(DWORD BattleID,BYTE Team);
					
					virtual void SendMsg(MSGBASE* pMsg,int MsgLen);
				
					inline DWORD GetAgentNum()	
					{
						return m_AgentNum;	
					}
				
					virtual BOOL Init(EObjectKind kind,DWORD AgentNum, BASEOBJECT_INFO* pBaseObjectInfo);
					virtual void Release();
				
					inline BYTE GetObjectKind()						{	return m_ObjectKind;	}
					inline void SetObjectKind(EObjectKind kind)		{	m_ObjectKind = kind;	}
				
					inline char* GetObjectName()					{return m_BaseObjectInfo.ObjectName;	}
					
					inline BYTE GetState()					{return m_BaseObjectInfo.ObjectState;	}
				
					void GetPosition(VECTOR3* pos);
					BASEMOVE_INFO * GetMoveInfo() { return &m_MoveInfo; }
					//VECTOR3 * GetCurTargetPosition();
				
					void SetInited();
					void SetNotInited();
					BOOL GetInited()	{	return m_bInited;	}
				
				
					inline DWORD GetID()	{	return m_BaseObjectInfo.dwObjectID;	}
					inline DWORD GetUserID()	{	return m_BaseObjectInfo.dwUserID;	}
				
					void GetBaseObjectInfo(BASEOBJECT_INFO* pRtInfo);
					virtual void GetSendMoveInfo(SEND_MOVEINFO* pRtInfo,CAddableInfoList* pAddInfoList);
				
					virtual void SetAddMsg(char* pAddMsg,WORD* pMsgLen,DWORD dwReceiverID,BOOL bLogin) = 0;
					virtual void SetRemoveMsg(char* pRemoveMsg,WORD* pMsgLen,DWORD dwReceiverID);
				
					virtual float GetRadius()	{	return 0;	}
					
					//////////////////////////////////////////////////////////////////////////
					// 惑怕(State) 包访
					virtual void OnStartObjectState(BYTE State,DWORD dwParam)	{}
					virtual void OnEndObjectState(BYTE State) {}
					virtual void StateProcess()		{};	
				
					//////////////////////////////////////////////////////////////////////////
					// 鸥老 包访
					TILEINDEX GetPreoccupiedTileIndex()		{	return m_dwPreoccupiedTileIndex;	}
					void SetPreoccupiedTileIndex(TILEINDEX tileindex)		{	m_dwPreoccupiedTileIndex = tileindex;	}
					virtual int GetObjectTileSize();
					
					//////////////////////////////////////////////////////////////////////////
					// 单固瘤 磷澜 包访
					void Die(CObject* pAttacker);
					virtual void DoDie(CObject* pAttacker)	{}
					virtual void CalcRealDamage(CObject* pOperator,WORD PhyDamage,WORD AttrDamage,RESULTINFO* pDamageInfo);
					virtual DWORD CalcShieldDamage(DWORD ShieldDamage);
					virtual void CalcCounterDamage(WORD Attrib,WORD AttrDamage,WORD PhyDamage,RESULTINFO* pDamageInfo);	
					virtual void CalcVampiric(RESULTINFO* pDamageInfo);
					virtual DWORD Damage(CObject* pAttacker,RESULTINFO* pDamageInfo);	
					
					//////////////////////////////////////////////////////////////////////////
					// Status
					virtual void AddStatus(CStatus* pStatus);
					virtual void RemoveStatus(CStatus* pStatus);
				
					//////////////////////////////////////////////////////////////////////////
					// 沥焊 掘绢坷绰 窃荐甸
					virtual LEVELTYPE GetLevel()	{	return 0;	};
					virtual void SetLevel(LEVELTYPE level)	{};	
					virtual DWORD GetLife() {	return 0;	}
					virtual void SetLife(DWORD Life,BOOL bSendMsg = TRUE)	{};	
					virtual DWORD GetShield() {	return 0;	}
					virtual void SetShield(DWORD Life,BOOL bSendMsg = TRUE)	{};	
					virtual DWORD GetNaeRyuk(){ return 0; }
					virtual void SetNaeRyuk(DWORD val,BOOL bSendMsg = TRUE)	{};	
				
				
				//////////////////////////////////////////////////////////////////////////
				// 
				#define GET_STATUS(var_type,func)						\
				var_type	func ## ()								\
				{														\
					var_type Ori = Do ## func();						\
					var_type Up = 0,Down = 0;							\
					PTRLISTSEARCHSTART(m_StatusList,CStatus*,pSL)		\
						pSL->func(Ori,Up,Down);							\
					PTRLISTSEARCHEND;									\
					return STATUSCALC(Ori,Up,Down);						\
				};														\
				virtual var_type	Do ## func ## ()	{	return 0; }		
				//	
				
					GET_STATUS(DWORD,GetMaxLife);
					GET_STATUS(DWORD,GetMaxShield);
					GET_STATUS(DWORD,GetMaxNaeRyuk);
					GET_STATUS(DWORD,GetPhyDefense);
					GET_STATUS(DWORD,GetPhyAttackPowerMin);
					GET_STATUS(DWORD,GetPhyAttackPowerMax);
					GET_STATUS(DWORD,GetCritical);
					GET_STATUS(float,GetMoveSpeed);
					GET_STATUS(float,GetUngiPlusRate);
					GET_STATUS(float,GetAddAttackRange);
					GET_STATUS(float,GetDodgeRate);
					
					float GetAttDefense(WORD Attrib);
					virtual float DoGetAttDefense(WORD Attrib)	{return 0;}
				//////////////////////////////////////////////////////////////////////////
				
					virtual void SetMaxLife(WORD life)	{};	
					virtual void SetMaxNaeRyuk(WORD val)	{};	
					virtual float GetAttribPlusPercent(WORD Attrib) { return 0;	}	
					
					void AddLife(DWORD val,DWORD* realAddLife,BOOL bSendMsg = TRUE);
					void AddNaeRyuk(DWORD val,DWORD* realAddNaeRyuk);
					void ReduceNaeRyuk(DWORD val);
					
					void CheckLifeValid();
					void CheckNaeRyukValid();
					void CheckShieldValid();
				
					virtual DWORD GetGravity(){ return 0;	}
					virtual void SetGravity(DWORD gravity){ }
					//////////////////////////////////////////////////////////////////////////	
				
					//////////////////////////////////////////////////////////////////////////
					// Special State
					void StartSpecialState(DWORD SpecialStateKind,DWORD Time,
										WORD wParam1,WORD wParam2,float fParam3,
										WORD EffectNum,WORD StateIcon);
					void EndSpecialState(DWORD SpecialStateKind);
					BOOL IsInSpecialState(DWORD SpecialStateKind);
					void SpecialStateProcess(DWORD TickTime);	
					WORD GetSpecialStateParam1(DWORD SpecialStateKind);
					WORD GetSpecialStateParam2(DWORD SpecialStateKind);
					float GetSpecialStateParam3(DWORD SpecialStateKind);
					//////////////////////////////////////////////////////////////////////////
					
				};
				
				#endif // !defined(AFX_OBJECT_H__A8AFB488_5BB5_45E5_8482_EE4EE2A55DDD__INCLUDED_)
				
							

相关资源