summaryrefslogtreecommitdiffstats
path: root/src/Mobs/EnderDragon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/EnderDragon.cpp')
-rw-r--r--src/Mobs/EnderDragon.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Mobs/EnderDragon.cpp b/src/Mobs/EnderDragon.cpp
index a3ba5f937..e33fb21f1 100644
--- a/src/Mobs/EnderDragon.cpp
+++ b/src/Mobs/EnderDragon.cpp
@@ -2,6 +2,8 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "EnderDragon.h"
+#include "../ClientHandle.h"
+#include "../CompositeChat.h"
@@ -17,6 +19,21 @@ cEnderDragon::cEnderDragon(void) :
+bool cEnderDragon::DoTakeDamage(TakeDamageInfo & a_TDI)
+{
+ if (!Super::DoTakeDamage(a_TDI))
+ {
+ return false;
+ }
+
+ m_World->BroadcastBossBarUpdateHealth(*this, GetUniqueID(), GetHealth() / GetMaxHealth());
+ return true;
+}
+
+
+
+
+
void cEnderDragon::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
// No drops
@@ -25,3 +42,11 @@ void cEnderDragon::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+void cEnderDragon::SpawnOn(cClientHandle & a_Client)
+{
+ Super::SpawnOn(a_Client);
+
+ // Red boss bar with no divisions that plays boss music and creates fog:
+ a_Client.SendBossBarAdd(GetUniqueID(), cCompositeChat("Ender Dragon"), GetHealth() / GetMaxHealth(), BossBarColor::Red, BossBarDivisionType::None, false, true, true);
+}