1
0
This commit is contained in:
Howaner
2014-04-26 16:44:15 +02:00
parent e5683ede63
commit 49f6819829
8 changed files with 26 additions and 23 deletions

View File

@@ -10,7 +10,7 @@
cWither::cWither(void) :
super("Wither", mtWither, "mob.wither.hurt", "mob.wither.death", 0.9, 4.0),
m_InvulnerableTicks(220)
m_WitherInvulnerableTicks(220)
{
SetMaxHealth(300);
}
@@ -47,7 +47,7 @@ bool cWither::DoTakeDamage(TakeDamageInfo & a_TDI)
return false;
}
if (m_InvulnerableTicks > 0)
if (m_WitherInvulnerableTicks > 0)
{
return false;
}
@@ -68,16 +68,16 @@ void cWither::Tick(float a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
if (m_InvulnerableTicks > 0)
if (m_WitherInvulnerableTicks > 0)
{
unsigned int NewTicks = m_InvulnerableTicks - 1;
unsigned int NewTicks = m_WitherInvulnerableTicks - 1;
if (NewTicks == 0)
{
m_World->DoExplosionAt(7.0, GetPosX(), GetPosY(), GetPosZ(), false, esWitherBirth, this);
}
m_InvulnerableTicks = NewTicks;
m_WitherInvulnerableTicks = NewTicks;
if ((NewTicks % 10) == 0)
{

View File

@@ -17,9 +17,9 @@ public:
CLASS_PROTODEF(cWither);
unsigned int GetNumInvulnerableTicks(void) const { return m_InvulnerableTicks; }
unsigned int GetWitherInvulnerableTicks(void) const { return m_WitherInvulnerableTicks; }
void SetNumInvulnerableTicks(unsigned int a_Ticks) { m_InvulnerableTicks = a_Ticks; }
void SetWitherInvulnerableTicks(unsigned int a_Ticks) { m_WitherInvulnerableTicks = a_Ticks; }
/** Returns whether the wither is invulnerable to arrows. */
bool IsArmored(void) const;
@@ -33,7 +33,7 @@ public:
private:
/** The number of ticks of invulnerability left after being initially created. Zero once invulnerability has expired. */
unsigned int m_InvulnerableTicks;
unsigned int m_WitherInvulnerableTicks;
} ;