1
0

Destroy an ender crystal, damage a dragon when hit by an egg.

This commit is contained in:
Alexander Harkness 2015-11-02 19:04:56 +00:00
parent ad8b711b4d
commit 1d4c6d3fbe
2 changed files with 103 additions and 92 deletions

View File

@ -93,7 +93,7 @@ public:
enum eEntityStatus
{
// TODO: Investiagate 0, 1, and 5 as Wiki.vg is not certain
// TODO: Investigate 0, 1, and 5 as Wiki.vg is not certain
// Entity becomes coloured red
esGenericHurt = 2,

View File

@ -32,7 +32,14 @@ void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_H
void cThrownEggEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
{
int TotalDamage = 0;
// TODO: If entity is Ender Crystal, destroy it
// If entity is an Ender Dragon or Ender Crystal, it is damaged.
if (
(a_EntityHit.IsMob() && (static_cast<cMonster &>(a_EntityHit).GetMobType() == mtEnderDragon)) ||
a_EntityHit.IsEnderCrystal()
)
{
TotalDamage = 1;
}
TrySpawnChicken(a_HitPos);
a_EntityHit.TakeDamage(dtRangedAttack, this, TotalDamage, 1);
@ -79,3 +86,7 @@ void cThrownEggEntity::TrySpawnChicken(const Vector3d & a_HitPos)
m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, mtChicken, false);
}
}