diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-09-25 16:22:08 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-09-25 16:22:08 +0200 |
commit | 9c459cbe50dd7c7c327d712369b523dd018575bf (patch) | |
tree | 9dea40b71ffdca0dccf31fa1f005e279d822fa46 /src/Mobs/Monster.h | |
parent | Fix accedental c++11 (diff) | |
parent | Merge pull request #1449 from mc-server/WorldLoader (diff) | |
download | cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.gz cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.bz2 cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.lz cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.xz cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.zst cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.zip |
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r-- | src/Mobs/Monster.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index ef94262f6..9fd67d67c 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -16,13 +16,15 @@ class cClientHandle; class cWorld; + + // tolua_begin class cMonster : public cPawn { typedef cPawn super; public: - + enum eFamily { mfHostile = 0, // Spider, Zombies ... @@ -56,6 +58,8 @@ public: virtual void KilledBy(TakeDamageInfo & a_TDI) override; + virtual void OnRightClicked(cPlayer & a_Player) override; + virtual void MoveToPosition(const Vector3d & a_Position); // tolua_export virtual bool ReachedDestination(void); @@ -111,7 +115,24 @@ public: virtual bool IsSitting (void) const { return false; } // tolua_begin - + + /** Returns true if the monster has a custom name. */ + bool HasCustomName(void) const { return !m_CustomName.empty(); } + + /** Gets the custom name of the monster. If no custom name is set, the function returns an empty string. */ + const AString & GetCustomName(void) const { return m_CustomName; } + + /** Sets the custom name of the monster. You see the name over the monster. + If you want to disable the custom name, simply set an empty string. */ + void SetCustomName(const AString & a_CustomName); + + /** Is the custom name of this monster always visible? If not, you only see the name when you sight the mob. */ + bool IsCustomNameAlwaysVisible(void) const { return m_CustomNameAlwaysVisible; } + + /** Sets the custom name visiblity of this monster. + If it's false, you only see the name when you sight the mob. If it's true, you always see the custom name. */ + void SetCustomNameAlwaysVisible(bool a_CustomNameAlwaysVisible); + /// Translates MobType enum to a string, empty string if unknown static AString MobTypeToString(eMonsterType a_MobType); @@ -195,6 +216,8 @@ protected: float m_DestroyTimer; eMonsterType m_MobType; + AString m_CustomName; + bool m_CustomNameAlwaysVisible; AString m_SoundHurt; AString m_SoundDeath; |