6 #include "../Entities/ProjectileEntity.h"
7 #include "../Entities/Player.h"
14 Super(
"Creeper",
mtCreeper,
"entity.creeper.hurt",
"entity.creeper.death",
"entity.creeper.ambient", 0.6f, 1.7f),
17 m_BurnedWithFlintAndSteel(false),
71 unsigned int LootingLevel = 0;
72 if (a_Killer !=
nullptr)
80 (a_Killer !=
nullptr) &&
84 auto ProjectileCreatorCallback = [](
cEntity & a_Entity)
unsigned int GetLevel(int a_EnchantmentID) const
Returns the level for the specified enchantment; 0 if not stored.
bool IsProjectile(void) const
static const UInt32 INVALID_ID
Special ID that is considered an "invalid value", signifying no entity.
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
double GetPosX(void) const
double GetPosZ(void) const
UInt32 GetUniqueID(void) const
void Destroy()
Destroys the entity, schedules it for memory freeing and broadcasts the DestroyEntity packet.
double GetPosY(void) const
virtual cItem GetEquippedWeapon(void) const
Returns the curently equipped weapon; empty item if none.
float GetHealth(void) const
Returns the health of this entity.
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
cWorld * GetWorld(void) const
const cItem & GetEquippedItem(void) const
bool IsGameModeCreative(void) const
Returns true if the player is in Creative mode, either explicitly, or by inheriting from current worl...
void UseEquippedItem(short a_Damage=1)
Damage the player's equipped item by a_Damage, possibly less if the equipped item is enchanted.
UInt32 GetCreatorUniqueID(void) const
Returns the unique ID of the entity who created this projectile May return an ID <0.
cEnchantments m_Enchantments
This class bridges a vector of cItem for safe access via Lua.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
virtual bool Attack(std::chrono::milliseconds a_Dt) override
Try to perform attack returns true if attack was deemed successful (hit player, fired projectile,...
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
bool m_BurnedWithFlintAndSteel
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
void AddRandomDropItem(cItems &a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth=0)
Adds a random number of a_Item between a_Min and a_Max to itemdrops a_Drops.
cPawn * GetTarget()
Returns the current target.
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
bool TargetIsInRange(void)
Returns whether or not the target is close enough for attack.
virtual void DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_BlockY, double a_BlockZ, bool a_CanCauseFire, eExplosionSource a_Source, void *a_SourceData) override
Does an explosion with the specified strength at the specified coordinates.
virtual void BroadcastEntityMetadata(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
int GetTickRandomNumber(int a_Range)
Returns a random number in range [0 .
bool DoWithEntityByID(UInt32 a_UniqueID, cEntityCallback a_Callback)
Calls the callback if the entity with the specified ID is found, with the entity object as the callba...
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override