2012-02-13 13:47:03 -08:00
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
#pragma once
|
2012-02-13 13:47:03 -08:00
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
#include "cEntity.h"
|
2012-02-13 13:47:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
|
|
|
|
struct TakeDamageInfo //tolua_export
|
|
|
|
{ //tolua_export
|
|
|
|
int Damage; //tolua_export
|
|
|
|
cEntity* Instigator; //tolua_export
|
|
|
|
}; //tolua_export
|
|
|
|
|
2012-02-13 13:47:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
class cPawn : public cEntity //tolua_export
|
|
|
|
{ //tolua_export
|
|
|
|
public:
|
|
|
|
CLASS_PROTOTYPE();
|
|
|
|
|
|
|
|
cPawn();
|
|
|
|
virtual ~cPawn();
|
|
|
|
|
2012-02-22 07:46:38 -08:00
|
|
|
virtual void TeleportToEntity( cEntity* a_Entity ); //tolua_export
|
2011-10-03 11:41:19 -07:00
|
|
|
virtual void TeleportTo( const double & a_PosX, const double & a_PosY, const double & a_PosZ ); //tolua_export
|
|
|
|
|
2012-02-13 13:47:03 -08:00
|
|
|
virtual void Tick(float a_Dt) override;
|
2011-12-27 18:10:05 -08:00
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
void Heal( int a_Health ); //tolua_export
|
|
|
|
virtual void TakeDamage( int a_Damage, cEntity* a_Instigator ); //tolua_export
|
|
|
|
virtual void KilledBy( cEntity* a_Killer ); //tolua_export
|
|
|
|
int GetHealth() { return m_Health; } //tolua_export
|
|
|
|
|
2011-12-27 18:10:05 -08:00
|
|
|
enum MetaData {NORMAL, BURNING, CROUCHED, RIDING, SPRINTING, EATING, BLOCKING};
|
|
|
|
|
2012-02-02 04:43:30 -08:00
|
|
|
virtual void SetMetaData(MetaData a_MetaData);
|
|
|
|
virtual MetaData GetMetaData() { return m_MetaData; }
|
2011-12-27 18:10:05 -08:00
|
|
|
|
2012-02-02 04:43:30 -08:00
|
|
|
virtual void InStateBurning(float a_Dt);
|
2011-12-27 18:10:05 -08:00
|
|
|
|
|
|
|
virtual void CheckMetaDataBurn();
|
|
|
|
|
2012-02-02 04:43:30 -08:00
|
|
|
virtual void SetMaxHealth(short a_MaxHealth);
|
|
|
|
virtual short GetMaxHealth() { return m_MaxHealth; }
|
2011-12-27 18:10:05 -08:00
|
|
|
|
2012-02-02 04:43:30 -08:00
|
|
|
//virtual void SetMaxFood(short a_MaxFood);
|
2012-02-13 13:47:03 -08:00
|
|
|
virtual short GetMaxFood() { return m_MaxFoodLevel / 6; }
|
|
|
|
virtual short GetFood() { return m_FoodLevel / 6; }
|
2011-12-29 07:31:48 -08:00
|
|
|
|
2012-02-02 04:43:30 -08:00
|
|
|
//virtual void SetMaxFoodSaturation(float a_MaxFoodSaturation);
|
|
|
|
virtual float GetMaxFoodSaturation() { return fmod(m_MaxFoodLevel, 6.f); }
|
|
|
|
virtual float GetFoodSaturation() { return fmod(m_FoodLevel, 6.f); }
|
2011-12-29 07:31:48 -08:00
|
|
|
|
2012-02-02 04:43:30 -08:00
|
|
|
virtual void SetMaxFoodLevel(short a_MaxFoodLevel);
|
|
|
|
virtual short GetMaxFoodLevel() { return m_MaxFoodLevel; }
|
2011-12-29 07:31:48 -08:00
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
protected:
|
2012-02-13 13:47:03 -08:00
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
short m_Health;
|
2011-12-29 07:31:48 -08:00
|
|
|
short m_FoodLevel;
|
2011-12-27 18:10:05 -08:00
|
|
|
short m_MaxHealth;
|
2011-12-29 07:31:48 -08:00
|
|
|
short m_MaxFoodLevel;
|
2011-12-27 18:10:05 -08:00
|
|
|
|
|
|
|
bool m_bBurnable;
|
|
|
|
|
2012-02-13 13:47:03 -08:00
|
|
|
MetaData m_MetaData;
|
2011-10-03 11:41:19 -07:00
|
|
|
|
|
|
|
double m_LastPosX, m_LastPosY, m_LastPosZ;
|
|
|
|
float m_TimeLastTeleportPacket;
|
2011-12-27 18:10:05 -08:00
|
|
|
|
|
|
|
float m_FireDamageInterval;
|
|
|
|
float m_BurnPeriod;
|
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
}; //tolua_export
|
2012-02-13 13:47:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|