Cuberite
A lightweight, fast and extensible game server for Minecraft
Wither.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "AggressiveMonster.h"
5 
6 
7 
8 
9 
10 class cWither:
11  public cAggressiveMonster
12 {
14 
15 public:
16 
17  cWither();
18 
20 
21  unsigned int GetWitherInvulnerableTicks(void) const { return m_WitherInvulnerableTicks; }
22 
23  void SetWitherInvulnerableTicks(unsigned int a_Ticks) { m_WitherInvulnerableTicks = a_Ticks; }
24 
26  bool IsArmored(void) const;
27 
28  // cEntity overrides
29  virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
30  virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
31  virtual bool IsUndead(void) override { return true; }
32  virtual void KilledBy(TakeDamageInfo & a_TDI) override;
33  virtual void SpawnOn(cClientHandle & a_Client) override;
34  virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
35 
36 private:
37 
40 
41 } ;
#define CLASS_PROTODEF(classname)
Definition: Entity.h:13
Definition: Chunk.h:36
Definition: Entity.h:76
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215
cAggressiveMonster(const AString &a_ConfigName, eMonsterType a_MobType, const AString &a_SoundHurt, const AString &a_SoundDeath, const AString &a_SoundAmbient, float a_Width, float a_Height)
Definition: Wither.h:12
unsigned int GetWitherInvulnerableTicks(void) const
Definition: Wither.h:21
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Definition: Wither.cpp:110
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
Definition: Wither.cpp:66
virtual void SpawnOn(cClientHandle &a_Client) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
Definition: Wither.cpp:98
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
Definition: Wither.cpp:36
cWither()
Definition: Wither.cpp:15
unsigned int m_WitherInvulnerableTicks
The number of ticks of invulnerability left after being initially created.
Definition: Wither.h:39
bool IsArmored(void) const
Returns whether the wither is invulnerable to arrows.
Definition: Wither.cpp:27
virtual bool IsUndead(void) override
Returns whether this mob is undead (skeleton, zombie, etc.)
Definition: Wither.h:31
virtual void KilledBy(TakeDamageInfo &a_TDI) override
Called when the health drops below zero.
Definition: Wither.cpp:75
void SetWitherInvulnerableTicks(unsigned int a_Ticks)
Definition: Wither.h:23