From d7adbba59d2372234a616b87f8b3b5a03888ddbc Mon Sep 17 00:00:00 2001 From: "mtilden@gmail.com" Date: Thu, 29 Dec 2011 15:31:48 +0000 Subject: - Initial food handling by cedeel git-svn-id: http://mc-server.googlecode.com/svn/trunk@156 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPawn.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/cPawn.h') diff --git a/source/cPawn.h b/source/cPawn.h index 24209dc76..e075b422e 100644 --- a/source/cPawn.h +++ b/source/cPawn.h @@ -1,5 +1,6 @@ #pragma once #include "cEntity.h" +#include "math.h" struct TakeDamageInfo //tolua_export { //tolua_export @@ -37,9 +38,22 @@ public: virtual inline void SetMaxHealth(short a_MaxHealth); virtual inline short GetMaxHealth() { return m_MaxHealth; } + //virtual inline void SetMaxFood(short a_MaxFood); + virtual inline short GetMaxFood() { return m_MaxFoodLevel/6; } + virtual inline short GetFood() { return m_FoodLevel/6; } + + //virtual inline void SetMaxFoodSaturation(float a_MaxFoodSaturation); + virtual inline float GetMaxFoodSaturation() { return fmod(m_MaxFoodLevel, 6.f); } + virtual inline float GetFoodSaturation() { return fmod(m_FoodLevel, 6.f); } + + virtual inline void SetMaxFoodLevel(short a_MaxFoodLevel); + virtual inline short GetMaxFoodLevel() { return m_MaxFoodLevel; } + protected: short m_Health; + short m_FoodLevel; short m_MaxHealth; + short m_MaxFoodLevel; bool m_bBurnable; -- cgit v1.2.3