summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Ghast.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 16:13:31 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 16:13:31 +0200
commit48dff0f03c5df964a411e310f8905aaa3c84ac27 (patch)
treefe76a724ce321fabd6cb261a41799b741ca0a394 /src/Mobs/Ghast.cpp
parentremoved agressiveMonster (diff)
downloadcuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.gz
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.bz2
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.lz
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.xz
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.zst
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.zip
Diffstat (limited to 'src/Mobs/Ghast.cpp')
-rw-r--r--src/Mobs/Ghast.cpp51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/Mobs/Ghast.cpp b/src/Mobs/Ghast.cpp
index 97a27be5a..d9cd31f45 100644
--- a/src/Mobs/Ghast.cpp
+++ b/src/Mobs/Ghast.cpp
@@ -9,8 +9,9 @@
cGhast::cGhast(void) :
- super("Ghast", mtGhast, "entity.ghast.hurt", "entity.ghast.death", 4, 4)
+ super("Ghast", mtGhast, "entity.ghast.hurt", "entity.ghast.death", 4, 4)
{
+ m_EMPersonality = AGGRESSIVE;
}
@@ -19,13 +20,13 @@ 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);
+ 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);
}
@@ -34,23 +35,23 @@ void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
// mobTODO
/*bool cGhast::Attack(std::chrono::milliseconds a_Dt)
{
- if ((GetTarget() != nullptr) && (m_AttackCoolDownTicksLeft == 0))
- {
- // Setting this higher gives us more wiggle room for attackrate
- Vector3d Speed = GetLookVector() * 20;
- Speed.y = Speed.y + 1;
-
- auto GhastBall = cpp14::make_unique<cGhastFireballEntity>(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
- auto GhastBallPtr = GhastBall.get();
- if (!GhastBallPtr->Initialize(std::move(GhastBall), *m_World))
- {
- return false;
- }
-
- ResetAttackCooldown();
- return true;
- }
- return false;
+ if ((GetTarget() != nullptr) && (m_AttackCoolDownTicksLeft == 0))
+ {
+ // Setting this higher gives us more wiggle room for attackrate
+ Vector3d Speed = GetLookVector() * 20;
+ Speed.y = Speed.y + 1;
+
+ auto GhastBall = cpp14::make_unique<cGhastFireballEntity>(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
+ auto GhastBallPtr = GhastBall.get();
+ if (!GhastBallPtr->Initialize(std::move(GhastBall), *m_World))
+ {
+ return false;
+ }
+
+ ResetAttackCooldown();
+ return true;
+ }
+ return false;
}*/