diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-11-04 22:53:37 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-11-04 22:53:37 +0100 |
commit | 3d00e52d42edc69eb777c90c6e6f479a5a473598 (patch) | |
tree | 9ed2245653c77b7de86678c345254fe70342126e /src/Mobs/Monster.h | |
parent | More player speed/position overrides (diff) | |
download | cuberite-3d00e52d42edc69eb777c90c6e6f479a5a473598.tar cuberite-3d00e52d42edc69eb777c90c6e6f479a5a473598.tar.gz cuberite-3d00e52d42edc69eb777c90c6e6f479a5a473598.tar.bz2 cuberite-3d00e52d42edc69eb777c90c6e6f479a5a473598.tar.lz cuberite-3d00e52d42edc69eb777c90c6e6f479a5a473598.tar.xz cuberite-3d00e52d42edc69eb777c90c6e6f479a5a473598.tar.zst cuberite-3d00e52d42edc69eb777c90c6e6f479a5a473598.zip |
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r-- | src/Mobs/Monster.h | 32 |
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); |