7 #include "../Entities/Player.h" 14 super(
"Wither",
mtWither,
"entity.wither.hurt",
"entity.wither.death", 0.9, 4.0),
15 m_WitherInvulnerableTicks(220)
78 if ((NewTicks % 10) == 0)
108 double Dist = (a_Player.
GetPosition() - Pos).Length();
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
double GetPosY(void) const
double GetPosX(void) const
unsigned int AwardAchievement(const eStatistic a_Ach)
Awards the player an achievement.
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
bool IsArmored(void) const
Returns whether the wither is invulnerable to arrows.
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 KilledBy(TakeDamageInfo &a_TDI) override
Called when the health drops below zero.
void SetMaxHealth(float a_MaxHealth)
Sets the maximum value for the health.
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
float GetHealth(void) const
Returns the health of this entity.
float GetMaxHealth(void) const
virtual void Heal(int a_HitPoints)
Heals the specified amount of HPs.
virtual void KilledBy(TakeDamageInfo &a_TDI) override
Called when the health drops below zero.
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.
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
unsigned int m_WitherInvulnerableTicks
The number of ticks of invulnerability left after being initially created.
double GetPosZ(void) const
void SetHealth(float a_Health)
Sets the health of this entity; doesn't broadcast any hurt animation.
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.