2013-11-25 14:05:52 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Entity.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-14 19:43:38 -04:00
|
|
|
// tolua_begin
|
2013-11-25 14:05:52 -05:00
|
|
|
class cExpOrb :
|
|
|
|
public cEntity
|
|
|
|
{
|
2014-07-06 18:50:22 -04:00
|
|
|
typedef cEntity super;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2013-11-25 14:05:52 -05:00
|
|
|
public:
|
2014-03-14 19:43:38 -04:00
|
|
|
// tolua_end
|
|
|
|
|
2014-07-22 18:36:13 -04:00
|
|
|
CLASS_PROTODEF(cExpOrb)
|
2014-03-14 19:43:38 -04:00
|
|
|
|
2013-11-25 14:05:52 -05:00
|
|
|
cExpOrb(double a_X, double a_Y, double a_Z, int a_Reward);
|
|
|
|
cExpOrb(const Vector3d & a_Pos, int a_Reward);
|
|
|
|
|
|
|
|
// Override functions
|
2015-01-11 16:12:26 -05:00
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2018-01-16 14:13:17 -05:00
|
|
|
|
|
|
|
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
|
|
|
|
2013-11-25 14:05:52 -05:00
|
|
|
virtual void SpawnOn(cClientHandle & a_Client) override;
|
2014-03-14 19:43:38 -04:00
|
|
|
|
2017-05-09 08:24:41 -04:00
|
|
|
// tolua_begin
|
|
|
|
|
2014-03-14 19:32:49 -04:00
|
|
|
/** Returns the number of ticks that this entity has existed */
|
2017-05-09 08:24:41 -04:00
|
|
|
int GetAge(void) const { return std::chrono::duration_cast<cTickTime>(m_Timer).count(); }
|
2014-03-14 19:43:38 -04:00
|
|
|
|
2014-03-14 19:32:49 -04:00
|
|
|
/** Set the number of ticks that this entity has existed */
|
2017-05-09 08:24:41 -04:00
|
|
|
void SetAge(int a_Age) { m_Timer = cTickTime(a_Age); }
|
2013-11-25 14:05:52 -05:00
|
|
|
|
2014-03-14 19:32:49 -04:00
|
|
|
/** Get the exp amount */
|
2017-05-09 08:24:41 -04:00
|
|
|
int GetReward(void) const { return m_Reward; }
|
2014-03-14 19:43:38 -04:00
|
|
|
|
2014-03-14 19:32:49 -04:00
|
|
|
/** Set the exp amount */
|
2017-05-09 08:24:41 -04:00
|
|
|
void SetReward(int a_Reward) { m_Reward = a_Reward; }
|
|
|
|
|
|
|
|
// tolua_end
|
2013-11-25 14:05:52 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int m_Reward;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-03-14 19:32:49 -04:00
|
|
|
/** The number of ticks that the entity has existed / timer between collect and destroy; in msec */
|
2015-01-16 08:27:10 -05:00
|
|
|
std::chrono::milliseconds m_Timer;
|
2014-03-25 13:15:05 -04:00
|
|
|
} ; // tolua_export
|