Cuberite
A lightweight, fast and extensible game server for Minecraft
Chicken.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "PassiveMonster.h"
4 
5 
6 
7 
8 
9 class cChicken:
10  public cPassiveMonster
11 {
13 
14 public:
15 
16  cChicken();
17 
19 
20  virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
21  virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
22 
23  virtual void GetFollowedItems(cItems & a_Items) override
24  {
25  a_Items.Add(E_ITEM_BEETROOT_SEEDS);
26  a_Items.Add(E_ITEM_MELON_SEEDS);
27  a_Items.Add(E_ITEM_PUMPKIN_SEEDS);
28  a_Items.Add(E_ITEM_SEEDS);
29  }
30 
31  virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
32 
33 private:
34 
36 } ;
37 
38 
39 
@ E_ITEM_MELON_SEEDS
Definition: BlockType.h:407
@ E_ITEM_BEETROOT_SEEDS
Definition: BlockType.h:482
@ E_ITEM_SEEDS
Definition: BlockType.h:339
@ E_ITEM_PUMPKIN_SEEDS
Definition: BlockType.h:406
#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
void Add(const cItem &a_Item)
Definition: Item.h:233
virtual void GetFollowedItems(cItems &a_Items) override
Returns the items that the animal of this class follows when a player holds it in hand.
Definition: Chicken.h:23
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Definition: Chicken.cpp:22
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
Definition: Chicken.cpp:56
int m_EggDropTimer
Definition: Chicken.h:35
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
When hit by someone, run away.
Definition: Chicken.cpp:76
cChicken()
Definition: Chicken.cpp:10
cPassiveMonster(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)