diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-04 15:15:10 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-04 15:15:10 +0200 |
commit | 0d1804e439ec0028be4d5380e66c13481781fc57 (patch) | |
tree | 95d4c3ab397568f36832cf27cf98c351e9d22e4d /src/Entities/Entity.h | |
parent | Fixed lever and button powering direction (diff) | |
parent | Fixed pressure plate oversights (diff) | |
download | cuberite-0d1804e439ec0028be4d5380e66c13481781fc57.tar cuberite-0d1804e439ec0028be4d5380e66c13481781fc57.tar.gz cuberite-0d1804e439ec0028be4d5380e66c13481781fc57.tar.bz2 cuberite-0d1804e439ec0028be4d5380e66c13481781fc57.tar.lz cuberite-0d1804e439ec0028be4d5380e66c13481781fc57.tar.xz cuberite-0d1804e439ec0028be4d5380e66c13481781fc57.tar.zst cuberite-0d1804e439ec0028be4d5380e66c13481781fc57.zip |
Diffstat (limited to 'src/Entities/Entity.h')
-rw-r--r-- | src/Entities/Entity.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 9b8011b55..a682701de 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -262,8 +262,10 @@ public: // tolua_end - /// Makes this entity take damage specified in the a_TDI. The TDI is sent through plugins first, then applied - virtual void DoTakeDamage(TakeDamageInfo & a_TDI); + /** Makes this entity take damage specified in the a_TDI. + The TDI is sent through plugins first, then applied. + If it returns false, the entity hasn't receive any damage. */ + virtual bool DoTakeDamage(TakeDamageInfo & a_TDI); // tolua_begin @@ -394,6 +396,12 @@ public: virtual bool IsSubmerged(void) const{ return m_IsSubmerged; } /** Gets remaining air of a monster */ int GetAirLevel(void) const { return m_AirLevel; } + + /** Gets the invulnerable ticks from the entity */ + int GetInvulnerableTicks(void) const { return m_InvulnerableTicks; } + + /** Set the invulnerable ticks from the entity */ + void SetInvulnerableTicks(int a_InvulnerableTicks) { m_InvulnerableTicks = a_InvulnerableTicks; } // tolua_end @@ -478,29 +486,33 @@ protected: int m_AirTickTimer; private: - // Measured in degrees, [-180, +180) + /** Measured in degrees, [-180, +180) */ double m_HeadYaw; - // Measured in meter/second (m/s) + /** Measured in meter/second (m/s) */ Vector3d m_Speed; - // Measured in degrees, [-180, +180) + /** Measured in degrees, [-180, +180) */ Vector3d m_Rot; - /// Position of the entity's XZ center and Y bottom + /** Position of the entity's XZ center and Y bottom */ Vector3d m_Pos; - // Measured in meter / second + /** Measured in meter / second */ Vector3d m_WaterSpeed; - // Measured in Kilograms (Kg) + /** Measured in Kilograms (Kg) */ double m_Mass; - /// Width of the entity, in the XZ plane. Since entities are represented as cylinders, this is more of a diameter. + /** Width of the entity, in the XZ plane. Since entities are represented as cylinders, this is more of a diameter. */ double m_Width; - /// Height of the entity (Y axis) + /** Height of the entity (Y axis) */ double m_Height; + + /** 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; } ; // tolua_export typedef std::list<cEntity *> cEntityList; |