2014-10-21 15:25:52 -04:00
|
|
|
|
|
|
|
// FireworkEntity.h
|
|
|
|
|
|
|
|
// Declares the cFireworkEntity class representing the flying firework rocket
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-26 20:50:05 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ProjectileEntity.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-26 20:58:06 -04:00
|
|
|
// tolua_begin
|
|
|
|
|
2014-04-26 20:50:05 -04:00
|
|
|
class cFireworkEntity :
|
2014-04-27 20:03:06 -04:00
|
|
|
public cProjectileEntity
|
2014-04-26 20:50:05 -04:00
|
|
|
{
|
|
|
|
typedef cProjectileEntity super;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// tolua_end
|
|
|
|
|
2014-07-22 18:36:13 -04:00
|
|
|
CLASS_PROTODEF(cFireworkEntity)
|
2014-04-26 20:50:05 -04:00
|
|
|
|
|
|
|
cFireworkEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem & a_Item);
|
2014-10-21 15:25:52 -04:00
|
|
|
|
|
|
|
// tolua_begin
|
|
|
|
|
|
|
|
/** Returns the item used to create the rocket (has all the firework effects on it) */
|
2014-04-26 20:50:05 -04:00
|
|
|
const cItem & GetItem(void) const { return m_FireworkItem; }
|
2014-10-21 15:25:52 -04:00
|
|
|
|
|
|
|
/** Sets the item that is used to create the rocket (has all the firework effects on it) */
|
|
|
|
void SetItem(const cItem & a_Item) { m_FireworkItem = a_Item; }
|
|
|
|
|
|
|
|
/** Returns the number of ticks left until the firework explosion. */
|
|
|
|
int GetTicksToExplosion(void) const { return m_TicksToExplosion; }
|
|
|
|
|
|
|
|
/** Sets the number of ticks left until the firework explosion. */
|
|
|
|
void SetTicksToExplosion(int a_TicksToExplosion) { m_TicksToExplosion = a_TicksToExplosion; }
|
|
|
|
|
|
|
|
// tolua_end
|
2014-04-26 20:50:05 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// cProjectileEntity overrides:
|
2015-01-11 16:12:26 -05:00
|
|
|
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2014-04-26 20:50:05 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2014-10-21 15:25:52 -04:00
|
|
|
int m_TicksToExplosion;
|
2014-04-26 20:50:05 -04:00
|
|
|
cItem m_FireworkItem;
|
|
|
|
|
2014-07-17 16:15:34 -04:00
|
|
|
}; // tolua_export
|
2014-10-21 15:25:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|