From f473f13585e1bc901bfeb05cd5a9bb35489595da Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Tue, 17 Jul 2012 12:02:03 +0000 Subject: Simple health regeneration system Prepared for food git-svn-id: http://mc-server.googlecode.com/svn/trunk@679 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source/cPlayer.h') diff --git a/source/cPlayer.h b/source/cPlayer.h index ef85a1d4e..c1420023e 100644 --- a/source/cPlayer.h +++ b/source/cPlayer.h @@ -83,7 +83,15 @@ public: void Heal( int a_Health ); //tolua_export /// Returns true if any food has been consumed, false if player "full" - bool Feed(short a_Food); + bool Feed(short a_Food, float a_Saturation); + + short GetMaxFoodLevel() { return m_MaxFoodLevel; } + short GetFoodLevel() { return m_FoodLevel; } + + float GetMaxFoodSaturationLevel() { return m_MaxFoodSaturationLevel; } + float GetFoodSaturationLevel() { return m_FoodSaturationLevel; } + + void AddFoodExhaustion(float a_Exhaustion) { m_FoodExhaustionLevel += a_Exhaustion; } void TakeDamage( int a_Damage, cEntity* a_Instigator ); //tolua_export void KilledBy( cEntity* a_Killer ); //tolua_export @@ -102,8 +110,7 @@ public: void UseEquippedItem(void); - /// Returns true if the item type is edible && it has been consumed, false otherwise - bool EatItem(int a_ItemType); + void SendHealth(); protected: virtual void Destroyed(); @@ -120,6 +127,13 @@ protected: bool m_bVisible; + short m_FoodLevel; + short m_MaxFoodLevel; + float m_FoodSaturationLevel; + float m_MaxFoodSaturationLevel; + float m_FoodExhaustionLevel; + char m_FoodTickTimer; + float m_LastGroundHeight; bool m_bTouchGround; double m_Stance; -- cgit v1.2.3