summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Ghast.cpp
diff options
context:
space:
mode:
authorRorkh <rorkh@internet.ru>2021-09-18 11:10:31 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-10-02 22:18:18 +0200
commit4c5d9d38f45ae7c18a3e9799152305757a8a1d2a (patch)
tree6c369d0901427be8ab92bef9cd229e60a21486a0 /src/Mobs/Ghast.cpp
parentSnipe skeleton achievment (diff)
downloadcuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.gz
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.bz2
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.lz
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.xz
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.zst
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.zip
Diffstat (limited to 'src/Mobs/Ghast.cpp')
-rw-r--r--src/Mobs/Ghast.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/Mobs/Ghast.cpp b/src/Mobs/Ghast.cpp
index 3b20bea28..39fc2e99b 100644
--- a/src/Mobs/Ghast.cpp
+++ b/src/Mobs/Ghast.cpp
@@ -22,21 +22,6 @@ cGhast::cGhast(void) :
-void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
-{
- unsigned int LootingLevel = 0;
- if (a_Killer != nullptr)
- {
- LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
- }
- AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER);
- AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GHAST_TEAR);
-}
-
-
-
-
-
bool cGhast::Attack(std::chrono::milliseconds a_Dt)
{
if ((GetTarget() != nullptr) && (m_AttackCoolDownTicksLeft == 0) && (!m_IsCharging))
@@ -71,6 +56,21 @@ bool cGhast::DoTakeDamage(TakeDamageInfo & a_TDI)
+void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+{
+ unsigned int LootingLevel = 0;
+ if (a_Killer != nullptr)
+ {
+ LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
+ }
+ AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER);
+ AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GHAST_TEAR);
+}
+
+
+
+
+
void cGhast::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
Super::Tick(a_Dt, a_Chunk);
@@ -113,5 +113,3 @@ void cGhast::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
AddSpeed(SpeedVector);
}
}
-
-