5 #include "../Entities/Player.h" 6 #include "../LineBlockTracer.h" 76 super(
"Enderman",
mtEnderman,
"entity.endermen.hurt",
"entity.endermen.death", 0.5, 2.9),
77 m_bIsScreaming(false),
89 unsigned int LootingLevel = 0;
90 if (a_Killer !=
nullptr)
NIBBLETYPE GetBlockSkyLight(Vector3i a_BlockPos)
Returns the sky light value at the specified block position.
T Dot(const Vector3< T > &a_Rhs) const
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void BroadcastEntityMetadata(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
static bool IsValidHeight(int a_Height)
Validates a height-coordinate.
virtual void CheckEventSeePlayer(cChunk &a_Chunk) override
cPawn * GetTarget()
Returns the current target.
cPlayer * GetPlayer(void) const
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
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.
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
unsigned int GetLevel(int a_EnchantmentID) const
Returns the level for the specified enchantment; 0 if not stored.
virtual bool IsInWater(void) const
Returns true if any part of the entity is in a water block.
static bool LineOfSightTrace(cWorld &a_World, const Vector3d &a_Start, const Vector3d &a_End, int a_Sight)
Returns true if the two positions are within line of sight (not obscured by blocks).
enum cMonster::MState m_EMState
static void BlockToChunk(int a_X, int a_Z, int &a_ChunkX, int &a_ChunkZ)
Converts absolute block coords to chunk coords:
virtual void CheckEventLostPlayer(void)
cEnchantments m_Enchantments
virtual void EventLosePlayer(void)
virtual void CheckEventLostPlayer(void) override
Vector3d GetLookVector(void) const
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
NIBBLETYPE GetSkyDarkness()
Get the current darkness level based on the time.
bool IsChunkLighted(int a_ChunkX, int a_ChunkZ)
void TakeDamage(cEntity &a_Attacker)
Makes this pawn take damage from an attack by a_Attacker.
virtual void EventLosePlayer(void) override
virtual void EventSeePlayer(cPlayer *a_Player, cChunk &a_Chunk)
virtual cItem GetEquippedWeapon(void) const
Returns the curently equipped weapon; empty item if none.
void QueueLightChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr< cChunkCoordCallback > a_Callback={})
Queues a chunk for lighting; a_Callback is called after the chunk is lighted.
virtual cItem GetEquippedHelmet(void) const override
Returns the currently equipped helmet; empty item if none.
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
bool CanMobsTarget(void) const
Returns true if the player can be targeted by Mobs.
bool CheckLight(void)
Returns if the current sky light level is sufficient for the enderman to become aggravated.
bool operator()(cPlayer &a_Player)
cPlayerLookCheck(Vector3d a_EndermanPos, int a_SightDistance)
cWorld * GetWorld(void) const
This class bridges a vector of cItem for safe access via Lua.
virtual bool ForEachPlayer(cPlayerListCallback a_Callback) override
Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true.