6 #include "../Entities/Player.h"
7 #include "../LineBlockTracer.h"
52 if ((Cosine < std::cos(0.09)) || (Cosine > std::cos(0)))
82 Super(
"Enderman",
mtEnderman,
"entity.endermen.hurt",
"entity.endermen.death",
"entity.endermen.ambient", 0.6f, 2.9f),
83 m_bIsScreaming(false),
95 unsigned int LootingLevel = 0;
96 if (a_Killer !=
nullptr)
155 if (EndermiteFound !=
nullptr)
182 if (
IsInWater() || Chunk->IsWeatherWetAt(Rel))
#define PREPARE_REL_AND_CHUNK(Position, OriginalChunk)
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.
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
void TakeDamage(cEntity &a_Attacker)
Makes this pawn take damage from an attack by a_Attacker.
float GetHeight(void) const
virtual cItem GetEquippedWeapon(void) const
Returns the curently equipped weapon; empty item if none.
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
Vector3d GetLookVector(void) const
cWorld * GetWorld(void) const
virtual cItem GetEquippedHelmet(void) const override
Returns the currently equipped helmet; empty item if none.
bool CanMobsTarget(void) const
Returns true if the player can be targeted by Mobs.
cEnchantments m_Enchantments
This class bridges a vector of cItem for safe access via Lua.
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).
virtual void EventSeePlayer(cPlayer *a_Player, cChunk &a_Chunk) override
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
cMonster * GetMonsterOfTypeInSight(eMonsterType a_mobtype, unsigned int SightDistance=16)
Check if a monster of certain type is in sight.
Vector3d m_EndermanHeadPosition
cPlayer * GetPlayer(void) const
bool operator()(cPlayer &a_Player)
cPlayerLookCheck(Vector3d a_EndermanHeadPosition, int a_SightDistance)
virtual void EventLosePlayer(void) override
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
virtual void CheckEventSeePlayer(cChunk &a_Chunk) override
void SetTarget(cPawn *a_NewTarget)
Sets the target that this mob will chase.
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.
enum cMonster::MState m_EMState
virtual void EventLosePlayer(void)
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
T Dot(const Vector3< T > &a_Rhs) const
virtual void BroadcastEntityMetadata(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual bool ForEachPlayer(cPlayerListCallback a_Callback) override
Calls the callback for each player in the list; returns true if all players processed,...