Make endermen take damage in water
This commit is contained in:
parent
488c6159df
commit
126b14aa09
@ -181,3 +181,23 @@ bool cEnderman::CheckLight()
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void cEnderman::Tick(float a_Dt, cChunk & a_Chunk)
|
||||||
|
{
|
||||||
|
super::Tick(a_Dt, a_Chunk);
|
||||||
|
|
||||||
|
//TODO take damage in rain
|
||||||
|
|
||||||
|
//Take damage when touching water, drowning damage seems to be most appropriate
|
||||||
|
if (IsSwimming())
|
||||||
|
{
|
||||||
|
EventLosePlayer();
|
||||||
|
TakeDamage(dtDrowning, NULL, 1, 0);
|
||||||
|
//TODO teleport to a safe location
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
virtual void CheckEventSeePlayer(void) override;
|
virtual void CheckEventSeePlayer(void) override;
|
||||||
virtual void CheckEventLostPlayer(void) override;
|
virtual void CheckEventLostPlayer(void) override;
|
||||||
virtual void EventLosePlayer(void) override;
|
virtual void EventLosePlayer(void) override;
|
||||||
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
||||||
|
|
||||||
bool IsScreaming(void) const {return m_bIsScreaming; }
|
bool IsScreaming(void) const {return m_bIsScreaming; }
|
||||||
BLOCKTYPE GetCarriedBlock(void) const {return CarriedBlock; }
|
BLOCKTYPE GetCarriedBlock(void) const {return CarriedBlock; }
|
||||||
|
Loading…
Reference in New Issue
Block a user