Monsters: Made IsUndead overridable by the respective mob classes
This commit is contained in:
parent
e612d07eea
commit
ada88a5805
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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; }
|
||||
} ;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user