From 6b77dc74ade3d8088da09d26c1b701d92ef28e9e Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 24 Mar 2014 12:29:19 +0200 Subject: Wither invulnerability --- src/Mobs/Wither.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Mobs/Wither.h') diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h index 56effc6bb..df3a57798 100644 --- a/src/Mobs/Wither.h +++ b/src/Mobs/Wither.h @@ -16,8 +16,22 @@ public: cWither(void); CLASS_PROTODEF(cWither); + + unsigned int GetNumInvulnerableTicks(void) const { return m_InvulnerableTicks; } + + void SetNumInvulnerableTicks(unsigned int a_Ticks) { m_InvulnerableTicks = a_Ticks; } + // Override functions virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; + + virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override; + + virtual void Tick(float a_Dt, cChunk & a_Chunk) override; + +private: + + /** The number of ticks of invulnerability left after being initially created. Zero once invulnerability has expired. */ + unsigned int m_InvulnerableTicks; } ; -- cgit v1.2.3 From 4f3377bbbfa12623be61561ae75bdd9d8d5fbe8c Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 25 Mar 2014 09:10:55 +0200 Subject: Minor fixes --- src/Mobs/Wither.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Mobs/Wither.h') diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h index df3a57798..d09e3607a 100644 --- a/src/Mobs/Wither.h +++ b/src/Mobs/Wither.h @@ -21,17 +21,16 @@ public: void SetNumInvulnerableTicks(unsigned int a_Ticks) { m_InvulnerableTicks = a_Ticks; } - // Override functions + // cEntity overrides virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; - virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override; - virtual void Tick(float a_Dt, cChunk & a_Chunk) override; private: /** The number of ticks of invulnerability left after being initially created. Zero once invulnerability has expired. */ unsigned int m_InvulnerableTicks; + } ; -- cgit v1.2.3 From 0fe1e50ffc744d861744e4aa4905e1b4b15e10fd Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 25 Mar 2014 10:32:58 +0200 Subject: Protocol: Wither metadata --- src/Mobs/Wither.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Mobs/Wither.h') diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h index d09e3607a..52666a190 100644 --- a/src/Mobs/Wither.h +++ b/src/Mobs/Wither.h @@ -20,6 +20,9 @@ public: unsigned int GetNumInvulnerableTicks(void) const { return m_InvulnerableTicks; } void SetNumInvulnerableTicks(unsigned int a_Ticks) { m_InvulnerableTicks = a_Ticks; } + + /** Returns whether the wither is invulnerable to arrows. */ + bool IsArmored(void) const; // cEntity overrides virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; -- cgit v1.2.3 From ba4216641120ec2f49464ed0b136af3198d48f89 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 25 Mar 2014 11:13:27 +0200 Subject: Fixed wither summoning --- src/Mobs/Wither.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Mobs/Wither.h') diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h index 52666a190..bc78bfaad 100644 --- a/src/Mobs/Wither.h +++ b/src/Mobs/Wither.h @@ -25,6 +25,7 @@ public: bool IsArmored(void) const; // cEntity overrides + virtual bool Initialize(cWorld * a_World) override; virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override; virtual void Tick(float a_Dt, cChunk & a_Chunk) override; -- cgit v1.2.3