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)
|
bool cMonster::IsUndead(void)
|
||||||
{
|
{
|
||||||
switch (GetMobType())
|
|
||||||
{
|
|
||||||
case mtZombie:
|
|
||||||
case mtZombiePigman:
|
|
||||||
case mtSkeleton:
|
|
||||||
case mtWither:
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public:
|
|||||||
void GetMonsterConfig(const AString & a_Name);
|
void GetMonsterConfig(const AString & a_Name);
|
||||||
|
|
||||||
/** Returns whether this mob is undead (skeleton, zombie, etc.) */
|
/** Returns whether this mob is undead (skeleton, zombie, etc.) */
|
||||||
bool IsUndead(void);
|
virtual bool IsUndead(void);
|
||||||
|
|
||||||
virtual void EventLosePlayer(void);
|
virtual void EventLosePlayer(void);
|
||||||
virtual void CheckEventLostPlayer(void);
|
virtual void CheckEventLostPlayer(void);
|
||||||
|
@ -22,6 +22,8 @@ public:
|
|||||||
virtual void Attack(float a_Dt) override;
|
virtual void Attack(float a_Dt) override;
|
||||||
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
||||||
|
|
||||||
|
virtual bool IsUndead(void) override { return true; }
|
||||||
|
|
||||||
bool IsWither(void) const { return m_bIsWither; };
|
bool IsWither(void) const { return m_bIsWither; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -30,6 +30,8 @@ public:
|
|||||||
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
||||||
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
||||||
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
||||||
|
|
||||||
|
virtual bool IsUndead(void) override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -19,8 +19,10 @@ public:
|
|||||||
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
|
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
|
||||||
virtual void MoveToPosition(const Vector3d & a_Position) override;
|
virtual void MoveToPosition(const Vector3d & a_Position) override;
|
||||||
|
|
||||||
bool IsVillagerZombie(void) const {return m_IsVillagerZombie; }
|
virtual bool IsUndead(void) override { return true; }
|
||||||
bool IsConverting (void) const {return m_IsConverting; }
|
|
||||||
|
bool IsVillagerZombie(void) const { return m_IsVillagerZombie; }
|
||||||
|
bool IsConverting (void) const { return m_IsConverting; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ public:
|
|||||||
|
|
||||||
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
|
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
|
||||||
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
||||||
|
|
||||||
|
virtual bool IsUndead(void) override { return true; }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user