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