2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2012-09-23 18:09:57 -04:00
|
|
|
#include "Entity.h"
|
2012-12-27 21:45:20 -05:00
|
|
|
#include "Item.h"
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cPlayer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-24 03:58:26 -04:00
|
|
|
// tolua_begin
|
|
|
|
class cPickup :
|
|
|
|
public cEntity
|
|
|
|
{
|
|
|
|
// tolua_end
|
|
|
|
typedef cEntity super;
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
public:
|
2012-12-21 07:21:20 -05:00
|
|
|
CLASS_PROTODEF(cPickup);
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-01-11 23:46:01 -05:00
|
|
|
cPickup(int a_MicroPosX, int a_MicroPosY, int a_MicroPosZ, const cItem & a_Item, float a_SpeedX = 0.f, float a_SpeedY = 0.f, float a_SpeedZ = 0.f); // tolua_export
|
2012-08-24 03:58:26 -04:00
|
|
|
|
|
|
|
virtual void Initialize(cWorld * a_World) override;
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-01-11 23:46:01 -05:00
|
|
|
cItem & GetItem(void) {return m_Item; } // tolua_export
|
2012-12-27 21:45:20 -05:00
|
|
|
const cItem & GetItem(void) const {return m_Item; }
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2012-08-24 03:58:26 -04:00
|
|
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-01-11 23:46:01 -05:00
|
|
|
virtual bool CollectedBy(cPlayer * a_Dest); // tolua_export
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-04-13 17:02:10 -04:00
|
|
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
|
|
|
virtual void HandlePhysics(float a_Dt, cChunk & a_Chunk) override;
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-03-09 09:35:43 -05:00
|
|
|
short GetHealth(void) const { return m_Health; }
|
|
|
|
|
|
|
|
/// Returns the number of ticks that this entity has existed
|
|
|
|
short GetAge(void) const { return (short)(m_Timer / 50); }
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
private:
|
2013-03-09 09:35:43 -05:00
|
|
|
short m_Health;
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-02-21 16:55:36 -05:00
|
|
|
Vector3d m_ResultingSpeed; //Can be used to modify the resulting speed for the current tick ;)
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-02-21 16:55:36 -05:00
|
|
|
Vector3d m_WaterSpeed;
|
2012-06-14 09:06:06 -04:00
|
|
|
bool m_bOnGround;
|
|
|
|
bool m_bReplicated;
|
|
|
|
|
|
|
|
float m_Timer;
|
|
|
|
|
2012-12-27 21:45:20 -05:00
|
|
|
cItem m_Item;
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
bool m_bCollected;
|
2013-01-11 23:46:01 -05:00
|
|
|
}; // tolua_export
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|