1
0
Fork 0
cuberite-2a/src/Entities/ThrownEggEntity.h

53 lines
972 B
C
Raw Normal View History

// ThrownEggEntity.h
// Declares the cThrownEggEntity class representing a regular thrown egg
#pragma once
#include "ProjectileEntity.h"
2014-04-27 00:58:06 +00:00
// tolua_begin
class cThrownEggEntity :
public cProjectileEntity
{
typedef cProjectileEntity super;
2016-02-05 21:45:45 +00:00
public:
2016-02-05 21:45:45 +00:00
// tolua_end
2016-02-05 21:45:45 +00:00
CLASS_PROTODEF(cThrownEggEntity)
2016-02-05 21:45:45 +00:00
cThrownEggEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed);
2016-02-05 21:45:45 +00:00
protected:
2016-02-05 21:45:45 +00:00
// cProjectileEntity overrides:
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
2016-02-05 21:45:45 +00:00
// Randomly decides whether to spawn a chicken where the egg lands.
void TrySpawnChicken(const Vector3d & a_HitPos);
private:
/** Time in ticks to wait for the hit animation to begin before destroying */
int m_DestroyTimer;
2016-02-05 21:45:45 +00:00
} ; // tolua_export