summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 8f433b816..db147f3fc 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -45,6 +45,7 @@ class cWorld;
class cClientHandle;
class cPlayer;
class cChunk;
+class cMonster;
@@ -87,6 +88,7 @@ public:
etFloater,
etItemFrame,
etPainting,
+ etLeashKnot,
// Common variations
etMob = etMonster, // DEPRECATED, use etMonster instead!
@@ -176,6 +178,7 @@ public:
bool IsExpOrb (void) const { return (m_EntityType == etExpOrb); }
bool IsFloater (void) const { return (m_EntityType == etFloater); }
bool IsItemFrame (void) const { return (m_EntityType == etItemFrame); }
+ bool IsLeashKnot (void) const { return (m_EntityType == etLeashKnot); }
bool IsPainting (void) const { return (m_EntityType == etPainting); }
/** Returns true if the entity is of the specified class or a subclass (cPawn's IsA("cEntity") returns true) */
@@ -267,7 +270,7 @@ public:
bool IsTicking(void) const;
/** Destroys the entity and schedules it for memory freeing; if a_ShouldBroadcast is set to true, broadcasts the DestroyEntity packet */
- void Destroy(bool a_ShouldBroadcast = true);
+ virtual void Destroy(bool a_ShouldBroadcast = true);
/** Makes this pawn take damage from an attack by a_Attacker. Damage values are calculated automatically and DoTakeDamage() called */
void TakeDamage(cEntity & a_Attacker);
@@ -519,6 +522,15 @@ public:
/** Set the entity's status to either ticking or not ticking. */
void SetIsTicking(bool a_IsTicking);
+ /** Adds a mob to the leashed list of mobs */
+ void AddLeashedMob(cMonster * a_Monster);
+
+ /** Removes a mob from the leashed list of mobs */
+ void RemoveLeashedMob(cMonster * a_Monster);
+
+ /** Returs whether the entity has any mob leashed to */
+ bool HasAnyMobLeashed() const { return m_LeashedMobs.size() > 0; }
+
protected:
/** Structure storing the portal delay timer and cooldown boolean */
struct sPortalCooldownData
@@ -668,6 +680,12 @@ private:
/** If a player hit a entity, the entity receive a invulnerable of 10 ticks.
While this ticks, a player can't hit this entity. */
int m_InvulnerableTicks;
+
+ typedef std::list<cMonster *> cMonsterList;
+
+ /** List of leashed mobs to this entity */
+ cMonsterList m_LeashedMobs;
+
} ; // tolua_export