1
0

Monsters: Made IsUndead overridable by the respective mob classes

This commit is contained in:
archshift 2014-07-19 14:35:35 -07:00
parent e612d07eea
commit ada88a5805
6 changed files with 11 additions and 13 deletions

View File

@ -680,16 +680,6 @@ void cMonster::GetMonsterConfig(const AString & a_Name)
bool cMonster::IsUndead(void)
{
switch (GetMobType())
{
case mtZombie:
case mtZombiePigman:
case mtSkeleton:
case mtWither:
{
return true;
}
}
return false;
}

View File

@ -107,7 +107,7 @@ public:
void GetMonsterConfig(const AString & a_Name);
/** Returns whether this mob is undead (skeleton, zombie, etc.) */
bool IsUndead(void);
virtual bool IsUndead(void);
virtual void EventLosePlayer(void);
virtual void CheckEventLostPlayer(void);

View File

@ -22,6 +22,8 @@ public:
virtual void Attack(float a_Dt) override;
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
virtual bool IsUndead(void) override { return true; }
bool IsWither(void) const { return m_bIsWither; };
private:

View File

@ -30,6 +30,8 @@ public:
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
virtual bool IsUndead(void) override { return true; }
private:

View File

@ -19,8 +19,10 @@ public:
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void MoveToPosition(const Vector3d & a_Position) override;
bool IsVillagerZombie(void) const {return m_IsVillagerZombie; }
bool IsConverting (void) const {return m_IsConverting; }
virtual bool IsUndead(void) override { return true; }
bool IsVillagerZombie(void) const { return m_IsVillagerZombie; }
bool IsConverting (void) const { return m_IsConverting; }
private:

View File

@ -18,6 +18,8 @@ public:
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
virtual bool IsUndead(void) override { return true; }
} ;