From 7c4cb9a3852e33d8bcc5f8283485e833c6eab93e Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 1 Sep 2014 20:12:56 +0200 Subject: Added CustomName to cMonster. --- src/Mobs/Monster.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/Mobs/Monster.h') diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index cdbd26c09..ce4e36a46 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -144,7 +144,23 @@ 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 a empty string. */ + const AString & GetCustomName(void) const { return m_CustomName; } + + /** Sets the custom name of the monster. You see the name over the monster. */ + 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 false, you only see the name when you sight the mob. If 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(eType a_MobType); @@ -228,6 +244,8 @@ protected: float m_DestroyTimer; eType m_MobType; + AString m_CustomName; + bool m_CustomNameAlwaysVisible; AString m_SoundHurt; AString m_SoundDeath; -- cgit v1.2.3