summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Enderman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/Enderman.cpp')
-rw-r--r--src/Mobs/Enderman.cpp64
1 files changed, 2 insertions, 62 deletions
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp
index 000496df0..65b771406 100644
--- a/src/Mobs/Enderman.cpp
+++ b/src/Mobs/Enderman.cpp
@@ -78,6 +78,7 @@ cEnderman::cEnderman(void) :
CarriedBlock(E_BLOCK_AIR),
CarriedMeta(0)
{
+ m_EMPersonality = PASSIVE;
}
@@ -97,67 +98,6 @@ void cEnderman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
-void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk)
-{
- if (GetTarget() != nullptr)
- {
- return;
- }
-
- cPlayerLookCheck Callback(GetPosition(), m_SightDistance);
- if (m_World->ForEachPlayer(Callback))
- {
- return;
- }
-
- ASSERT(Callback.GetPlayer() != nullptr);
-
- if (!CheckLight())
- {
- // Insufficient light for enderman to become aggravated
- // TODO: Teleport to a suitable location
- return;
- }
-
- if (!Callback.GetPlayer()->CanMobsTarget())
- {
- return;
- }
-
- // Target the player
- cMonster::EventSeePlayer(Callback.GetPlayer(), a_Chunk);
- m_EMState = CHASING;
- m_bIsScreaming = true;
- GetWorld()->BroadcastEntityMetadata(*this);
-}
-
-
-
-
-
-void cEnderman::CheckEventLostPlayer(void)
-{
- super::CheckEventLostPlayer();
- if (!CheckLight())
- {
- EventLosePlayer();
- }
-}
-
-
-
-
-
-void cEnderman::EventLosePlayer()
-{
- super::EventLosePlayer();
- m_bIsScreaming = false;
- GetWorld()->BroadcastEntityMetadata(*this);
-}
-
-
-
-
bool cEnderman::CheckLight()
{
@@ -196,7 +136,7 @@ void cEnderman::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
// Take damage when touching water, drowning damage seems to be most appropriate
if (CheckRain() || IsSwimming())
{
- EventLosePlayer();
+ // EventLosePlayer(); //mobTodo
TakeDamage(dtDrowning, nullptr, 1, 0);
// TODO teleport to a safe location
}