diff options
author | Samuel Barney <samjbarney@gmail.com> | 2013-10-14 17:42:43 +0200 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2013-10-14 17:42:43 +0200 |
commit | 5df5176f8d1793b44c7e2353cb46ca0966be1bdd (patch) | |
tree | 95343394cd9902ceaf885f379342c593392e9c16 /source/Mobs/Creeper.cpp | |
parent | Mobs no longer spawn up in the air. (diff) | |
parent | APIDump: Documented HOOK_HANDSHAKE. (diff) | |
download | cuberite-5df5176f8d1793b44c7e2353cb46ca0966be1bdd.tar cuberite-5df5176f8d1793b44c7e2353cb46ca0966be1bdd.tar.gz cuberite-5df5176f8d1793b44c7e2353cb46ca0966be1bdd.tar.bz2 cuberite-5df5176f8d1793b44c7e2353cb46ca0966be1bdd.tar.lz cuberite-5df5176f8d1793b44c7e2353cb46ca0966be1bdd.tar.xz cuberite-5df5176f8d1793b44c7e2353cb46ca0966be1bdd.tar.zst cuberite-5df5176f8d1793b44c7e2353cb46ca0966be1bdd.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Mobs/Creeper.cpp | 21 |
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); +} + + + + |