Cuberite
A lightweight, fast and extensible game server for Minecraft
Creeper.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "AggressiveMonster.h"
5 
6 
7 
8 
9 
10 class cCreeper:
11  public cAggressiveMonster
12 {
14 
15 public:
16 
17  cCreeper();
18 
20 
21  virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
22  virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
23  virtual bool Attack(std::chrono::milliseconds a_Dt) override;
24  virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
25  virtual void OnRightClicked(cPlayer & a_Player) override;
26 
27  bool IsBlowing(void) const {return m_bIsBlowing; }
28  bool IsCharged(void) const {return m_bIsCharged; }
30 
31 private:
32 
35 
36 } ;
37 
38 
39 
40 
#define CLASS_PROTODEF(classname)
Definition: Entity.h:13
Definition: Chunk.h:36
Definition: Entity.h:76
Definition: Player.h:29
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)
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Definition: Creeper.cpp:26
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
Definition: Creeper.cpp:142
virtual bool Attack(std::chrono::milliseconds a_Dt) override
Try to perform attack returns true if attack was deemed successful (hit player, fired projectile,...
Definition: Creeper.cpp:123
bool IsCharged(void) const
Definition: Creeper.h:28
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
Definition: Creeper.cpp:63
bool m_bIsBlowing
Definition: Creeper.h:33
bool m_BurnedWithFlintAndSteel
Definition: Creeper.h:33
int m_ExplodingTimer
Definition: Creeper.h:34
bool IsBlowing(void) const
Definition: Creeper.h:27
cCreeper()
Definition: Creeper.cpp:13
bool m_bIsCharged
Definition: Creeper.h:33
bool IsBurnedWithFlintAndSteel(void) const
Definition: Creeper.h:29
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
Definition: Creeper.cpp:103