From 912a1e7adc650d20b0302a3dfe45816b5e541bc7 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 21 Dec 2012 11:04:08 +0000 Subject: Refactored the TakeDamage API to take equipped weapon and armor into consideration (PvP untested) http://forum.mc-server.org/showthread.php?tid=625 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1087 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Mobs/Monster.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'source/Mobs/Monster.h') diff --git a/source/Mobs/Monster.h b/source/Mobs/Monster.h index f0da23977..6d3d1d775 100644 --- a/source/Mobs/Monster.h +++ b/source/Mobs/Monster.h @@ -17,14 +17,18 @@ class cClientHandle; -class cMonster : public cPawn //tolua_export -{ //tolua_export +// tolua_begin +class cMonster : + public cPawn +{ + typedef cPawn super; public: - - cMonster(); + // tolua_end + + cMonster(void); virtual ~cMonster(); - virtual bool IsA( const char* a_EntityType ); + virtual bool IsA(const char * a_EntityType); virtual void SpawnOn(cClientHandle & a_ClientHandle) override; @@ -33,8 +37,9 @@ public: virtual void HandlePhysics(float a_Dt); virtual void ReplicateMovement(void); - virtual void TakeDamage(int a_Damage, cEntity * a_Instigator) override; - virtual void KilledBy(cEntity * a_Killer) override; + virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override; + + virtual void KilledBy(cPawn * a_Killer) override; virtual void MoveToPosition(const Vector3f & a_Position); virtual bool ReachedDestination(void); @@ -47,7 +52,7 @@ public: virtual void CheckEventSeePlayer(); virtual void EventSeePlayer(cEntity *); float m_SightDistance; - virtual cPlayer *FindClosestPlayer(); //non static is easier. also virtual so other mobs can implement their own searching algo + virtual cPlayer * FindClosestPlayer(); // non static is easier. also virtual so other mobs can implement their own searching algo virtual void GetMonsterConfig(const char* pm_name); virtual void EventLosePlayer(); virtual void CheckEventLostPlayer(); @@ -69,7 +74,7 @@ public: protected: - cEntity* m_Target; + cEntity * m_Target; float m_AttackRate; float idle_interval; @@ -94,7 +99,7 @@ protected: float m_AttackInterval; void AddRandomDropItem(cItems & a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth = 0); -}; //tolua_export +} ; // tolua_export -- cgit v1.2.3