2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Entity.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-14 10:28:17 -05:00
|
|
|
// tolua_begin
|
2020-04-13 12:38:06 -04:00
|
|
|
class cTNTEntity:
|
2013-07-29 07:13:03 -04:00
|
|
|
public cEntity
|
|
|
|
{
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2013-12-14 10:28:17 -05:00
|
|
|
// tolua_end
|
2020-04-13 12:38:06 -04:00
|
|
|
|
|
|
|
using Super = cEntity;
|
|
|
|
|
|
|
|
public: // tolua_export
|
|
|
|
|
2014-07-22 18:36:13 -04:00
|
|
|
CLASS_PROTODEF(cTNTEntity)
|
2013-07-29 07:13:03 -04:00
|
|
|
|
2020-09-12 14:57:44 -04:00
|
|
|
cTNTEntity(Vector3d a_Pos, unsigned a_FuseTicks = 80);
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
// cEntity overrides:
|
|
|
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
2015-01-11 16:12:26 -05:00
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-03-08 04:25:46 -05:00
|
|
|
// tolua_begin
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-03-08 04:25:46 -05:00
|
|
|
/** Explode the tnt */
|
|
|
|
void Explode(void);
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-03-08 04:25:46 -05:00
|
|
|
/** Returns the fuse ticks until the tnt will explode */
|
2020-09-12 14:57:44 -04:00
|
|
|
unsigned GetFuseTicks(void) const { return m_FuseTicks; }
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-03-08 04:25:46 -05:00
|
|
|
/** Set the fuse ticks until the tnt will explode */
|
2020-09-12 14:57:44 -04:00
|
|
|
void SetFuseTicks(unsigned a_FuseTicks) { m_FuseTicks = a_FuseTicks; }
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-03-08 04:25:46 -05:00
|
|
|
// tolua_end
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
protected:
|
2014-03-08 06:24:33 -05:00
|
|
|
int m_FuseTicks; ///< How much ticks is left, while the tnt will explode
|
2014-07-17 16:15:34 -04:00
|
|
|
}; // tolua_export
|