summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-11-04 22:53:37 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-11-04 22:53:37 +0100
commit3d00e52d42edc69eb777c90c6e6f479a5a473598 (patch)
tree9ed2245653c77b7de86678c345254fe70342126e /src/Mobs/Monster.h
parentMore player speed/position overrides (diff)
downloadcuberite-fixesandfeatures.tar
cuberite-fixesandfeatures.tar.gz
cuberite-fixesandfeatures.tar.bz2
cuberite-fixesandfeatures.tar.lz
cuberite-fixesandfeatures.tar.xz
cuberite-fixesandfeatures.tar.zst
cuberite-fixesandfeatures.zip
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r--src/Mobs/Monster.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index a1f9c4a5b..f6fe88638 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -6,6 +6,8 @@
#include "../BlockID.h"
#include "../Item.h"
#include "../Enchantments.h"
+#include "../Root.h"
+#include "../MonsterConfig.h"
#include "MonsterTypes.h"
@@ -18,6 +20,31 @@ class cWorld;
+
+struct CreateMonsterInfo
+{
+ CreateMonsterInfo(const AString & a_ClassName) :
+ MonsterInfo(cRoot::Get()->GetMonsterConfig()->ReturnAttributes(a_ClassName))
+ {
+ }
+
+ CreateEntityInfo EntityInfo;
+ cMonsterConfig::sReturnAttributes MonsterInfo;
+
+ float DropChanceWeapon;
+ float DropChanceHelmet;
+ float DropChanceChestplate;
+ float DropChanceLeggings;
+ float DropChanceBoots;
+
+ AString CustomName;
+ bool CustomNameAlwaysVisible;
+ bool CanPickUpLoot;
+};
+
+
+
+
// tolua_begin
class cMonster :
public cPawn
@@ -49,7 +76,7 @@ public:
a_MobType is the type of the mob (also used in the protocol ( http://wiki.vg/Entities#Mobs 2012_12_22))
a_SoundHurt and a_SoundDeath are assigned into m_SoundHurt and m_SoundDeath, respectively
*/
- cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
+ cMonster(CreateMonsterInfo a_Info, const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
CLASS_PROTODEF(cMonster)
@@ -74,9 +101,6 @@ public:
virtual void CheckEventSeePlayer(void);
virtual void EventSeePlayer(cEntity * a_Player);
- /// Reads the monster configuration for the specified monster name and assigns it to this object.
- void GetMonsterConfig(const AString & a_Name);
-
/** Returns whether this mob is undead (skeleton, zombie, etc.) */
virtual bool IsUndead(void);