diff options
author | Jonathan Frederick <doublej472@gmail.com> | 2014-09-28 22:56:41 +0200 |
---|---|---|
committer | Jonathan Frederick <doublej472@gmail.com> | 2014-09-28 22:56:41 +0200 |
commit | 126b14aa09fcde7a54bc8a176b44f5f6c8f936c1 (patch) | |
tree | fa61d19a5aaa23d47876db151ffa9cc0da5f3e9c /src/Mobs | |
parent | Revert "1.8: Fixed plugin messages." (diff) | |
download | cuberite-126b14aa09fcde7a54bc8a176b44f5f6c8f936c1.tar cuberite-126b14aa09fcde7a54bc8a176b44f5f6c8f936c1.tar.gz cuberite-126b14aa09fcde7a54bc8a176b44f5f6c8f936c1.tar.bz2 cuberite-126b14aa09fcde7a54bc8a176b44f5f6c8f936c1.tar.lz cuberite-126b14aa09fcde7a54bc8a176b44f5f6c8f936c1.tar.xz cuberite-126b14aa09fcde7a54bc8a176b44f5f6c8f936c1.tar.zst cuberite-126b14aa09fcde7a54bc8a176b44f5f6c8f936c1.zip |
Diffstat (limited to 'src/Mobs')
-rw-r--r-- | src/Mobs/Enderman.cpp | 20 | ||||
-rw-r--r-- | src/Mobs/Enderman.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp index 51255beb3..fb372709a 100644 --- a/src/Mobs/Enderman.cpp +++ b/src/Mobs/Enderman.cpp @@ -181,3 +181,23 @@ bool cEnderman::CheckLight() return true; } + + + + + +void cEnderman::Tick(float a_Dt, cChunk & a_Chunk) +{ + super::Tick(a_Dt, a_Chunk); + + //TODO take damage in rain + + //Take damage when touching water, drowning damage seems to be most appropriate + if (IsSwimming()) + { + EventLosePlayer(); + TakeDamage(dtDrowning, NULL, 1, 0); + //TODO teleport to a safe location + } + +} diff --git a/src/Mobs/Enderman.h b/src/Mobs/Enderman.h index 4583746e7..947c32b96 100644 --- a/src/Mobs/Enderman.h +++ b/src/Mobs/Enderman.h @@ -21,6 +21,7 @@ public: virtual void CheckEventSeePlayer(void) override; virtual void CheckEventLostPlayer(void) override; virtual void EventLosePlayer(void) override; + virtual void Tick(float a_Dt, cChunk & a_Chunk) override; bool IsScreaming(void) const {return m_bIsScreaming; } BLOCKTYPE GetCarriedBlock(void) const {return CarriedBlock; } |