summaryrefslogtreecommitdiffstats
path: root/source/Mobs/Creeper.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-10-09 22:02:59 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-10-09 22:02:59 +0200
commitfe6fa23a97421af3d02b9faf92b8df2f73abb556 (patch)
treea080fa2de23b3123dc2d13ab8ee5565c3eac9ad6 /source/Mobs/Creeper.cpp
parentInitial round of fixes (diff)
downloadcuberite-fe6fa23a97421af3d02b9faf92b8df2f73abb556.tar
cuberite-fe6fa23a97421af3d02b9faf92b8df2f73abb556.tar.gz
cuberite-fe6fa23a97421af3d02b9faf92b8df2f73abb556.tar.bz2
cuberite-fe6fa23a97421af3d02b9faf92b8df2f73abb556.tar.lz
cuberite-fe6fa23a97421af3d02b9faf92b8df2f73abb556.tar.xz
cuberite-fe6fa23a97421af3d02b9faf92b8df2f73abb556.tar.zst
cuberite-fe6fa23a97421af3d02b9faf92b8df2f73abb556.zip
Diffstat (limited to '')
-rw-r--r--source/Mobs/Creeper.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/Mobs/Creeper.cpp b/source/Mobs/Creeper.cpp
index 9b1b68b79..b41b05f42 100644
--- a/source/Mobs/Creeper.cpp
+++ b/source/Mobs/Creeper.cpp
@@ -2,13 +2,16 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Creeper.h"
+#include "../World.h"
cCreeper::cCreeper(void) :
- super("Creeper", 50, "mob.creeper.say", "mob.creeper.say", 0.6, 1.8)
+ super("Creeper", 50, "mob.creeper.say", "mob.creeper.say", 0.6, 1.8),
+ m_bIsBlowing(false),
+ m_bIsCharged(false)
{
}
@@ -26,3 +29,19 @@ void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+void cCreeper::DoTakeDamage(TakeDamageInfo & a_TDI)
+{
+ super::DoTakeDamage(a_TDI);
+
+ if (a_TDI.DamageType == dtLightning)
+ {
+ m_bIsCharged = true;
+ }
+
+ m_World->BroadcastEntityMetadata(*this);
+}
+
+
+
+