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:
|
||||||
|
@ -31,6 +31,8 @@ public:
|
|||||||
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:
|
||||||
|
|
||||||
/** The number of ticks of invulnerability left after being initially created. Zero once invulnerability has expired. */
|
/** The number of ticks of invulnerability left after being initially created. Zero once invulnerability has expired. */
|
||||||
|
@ -19,6 +19,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 MoveToPosition(const Vector3d & a_Position) override;
|
virtual void MoveToPosition(const Vector3d & a_Position) override;
|
||||||
|
|
||||||
|
virtual bool IsUndead(void) override { return true; }
|
||||||
|
|
||||||
bool IsVillagerZombie(void) const { return m_IsVillagerZombie; }
|
bool IsVillagerZombie(void) const { return m_IsVillagerZombie; }
|
||||||
bool IsConverting (void) const { return m_IsConverting; }
|
bool IsConverting (void) const { return m_IsConverting; }
|
||||||
|
|
||||||
|
@ -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