diff options
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); |