Cuberite
A lightweight, fast and extensible game server for Minecraft
IronGolem.cpp
Go to the documentation of this file.
1 
2 #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
3 
4 #include "IronGolem.h"
5 
6 
7 
8 
9 
11  Super("IronGolem", mtIronGolem, "entity.irongolem.hurt", "entity.irongolem.death", "entity.irongolem.ambient", 1.4f, 2.7f)
12 {
13 }
14 
15 
16 
17 
18 
19 void cIronGolem::GetDrops(cItems & a_Drops, cEntity * a_Killer)
20 {
21  UNUSED(a_Killer);
22  AddRandomDropItem(a_Drops, 0, 5, E_ITEM_IRON);
23  AddRandomDropItem(a_Drops, 0, 2, E_BLOCK_FLOWER);
24 }
25 
26 
27 
28 
@ E_BLOCK_FLOWER
Definition: BlockType.h:48
@ E_ITEM_IRON
Definition: BlockType.h:309
#define UNUSED
Definition: Globals.h:72
@ mtIronGolem
Definition: MonsterTypes.h:38
Definition: Entity.h:76
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
Definition: IronGolem.cpp:19
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.
Definition: Monster.cpp:1518