1
0

Merge pull request #923 from archshift/master

Added flag for fireproof entities.
This commit is contained in:
Mattes D 2014-04-22 15:04:04 +02:00
commit b3a9b73278
3 changed files with 17 additions and 5 deletions

View File

@ -47,7 +47,7 @@ AttackDamage=4.0
SightDistance=25.0
MaxHealth=40
[Zombiepigman]
[ZombiePigman]
AttackRange=2.0
AttackRate=1
AttackDamage=7.0
@ -145,7 +145,7 @@ AttackDamage=0.0
SightDistance=25.0
MaxHealth=10
[Magmacube]
[MagmaCube]
AttackRange=2.0
AttackRate=1
AttackDamage=6.0

View File

@ -788,7 +788,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastBurnDamage++;
if (m_TicksSinceLastBurnDamage >= BURN_TICKS_PER_DAMAGE)
{
TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0);
if (!m_IsFireproof)
{
TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0);
}
m_TicksSinceLastBurnDamage = 0;
}
m_TicksLeftBurning--;
@ -856,7 +859,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastLavaDamage++;
if (m_TicksSinceLastLavaDamage >= LAVA_TICKS_PER_DAMAGE)
{
TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0);
if (!m_IsFireproof)
{
TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0);
}
m_TicksSinceLastLavaDamage = 0;
}
}
@ -874,7 +880,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastFireDamage++;
if (m_TicksSinceLastFireDamage >= FIRE_TICKS_PER_DAMAGE)
{
TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
if (!m_IsFireproof)
{
TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
}
m_TicksSinceLastFireDamage = 0;
}
}

View File

@ -435,6 +435,9 @@ protected:
cWorld * m_World;
/// Whether the entity is capable of taking fire or lava damage.
bool m_IsFireproof;
/// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
int m_TicksSinceLastBurnDamage;