Cuberite
A lightweight, fast and extensible game server for Minecraft
MagmaCube.cpp
Go to the documentation of this file.
1 #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
2 
3 #include "MagmaCube.h"
4 
5 
6 
7 
8 
9 cMagmaCube::cMagmaCube(int a_Size) :
10  super("MagmaCube", mtMagmaCube, Printf("entity.%smagmacube.hurt", GetSizeName(a_Size).c_str()), Printf("entity.%smagmacube.death", GetSizeName(a_Size).c_str()), 0.6 * a_Size, 0.6 * a_Size),
11  m_Size(a_Size)
12 {
13 }
14 
15 
16 
17 
18 
19 void cMagmaCube::GetDrops(cItems & a_Drops, cEntity * a_Killer)
20 {
21  UNUSED(a_Killer);
22  if (GetSize() > 1)
23  {
25  }
26 }
27 
28 
29 
30 
31 
33 {
34  if (a_Size == 1)
35  {
36  return "small_";
37  }
38  return "";
39 }
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
Definition: MagmaCube.cpp:19
static AString GetSizeName(int a_Size)
Returns the text describing the slime's size, as used by the client's resource subsystem for sounds...
Definition: MagmaCube.cpp:32
AString & Printf(AString &str, const char *format, fmt::ArgList args)
Output the formatted text into the string.
Definition: StringUtils.cpp:55
#define UNUSED
Definition: Globals.h:152
int GetSize(void) const
Definition: MagmaCube.h:21
std::string AString
Definition: StringUtils.h:13
Definition: Entity.h:73
cMagmaCube(int a_Size)
Creates a MagmaCube of the specified size; with 1 being the smallest.
Definition: MagmaCube.cpp:9
void AddRandomUncommonDropItem(cItems &a_Drops, float a_Chance, short a_Item, short a_ItemHealth=0)
Adds a item a_Item with the chance of a_Chance (in percent) to itemdrops a_Drops. ...
Definition: Monster.cpp:1234
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:234