Merge remote-tracking branch 'origin/SnowBall'
This commit is contained in:
commit
392fb7923b
@ -663,8 +663,6 @@ cThrownSnowballEntity::cThrownSnowballEntity(cEntity * a_Creator, double a_X, do
|
|||||||
|
|
||||||
void cThrownSnowballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
|
void cThrownSnowballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
|
||||||
{
|
{
|
||||||
// TODO: Apply damage to certain mobs (blaze etc.) and anger all mobs
|
|
||||||
|
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,6 +670,30 @@ void cThrownSnowballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFac
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void cThrownSnowballEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
|
||||||
|
{
|
||||||
|
int TotalDamage = 0;
|
||||||
|
if (a_EntityHit.IsMob())
|
||||||
|
{
|
||||||
|
cMonster::eType MobType = ((cMonster &) a_EntityHit).GetMobType();
|
||||||
|
if (MobType == cMonster::mtBlaze)
|
||||||
|
{
|
||||||
|
TotalDamage = 3;
|
||||||
|
}
|
||||||
|
else if (MobType == cMonster::mtEnderDragon)
|
||||||
|
{
|
||||||
|
TotalDamage = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a_EntityHit.TakeDamage(dtRangedAttack, this, TotalDamage, 1);
|
||||||
|
|
||||||
|
Destroy(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// cBottleOEnchantingEntity :
|
// cBottleOEnchantingEntity :
|
||||||
|
|
||||||
|
@ -259,6 +259,7 @@ protected:
|
|||||||
|
|
||||||
// cProjectileEntity overrides:
|
// cProjectileEntity overrides:
|
||||||
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
|
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
|
||||||
|
virtual void OnHitEntity (cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
|
||||||
|
|
||||||
// tolua_begin
|
// tolua_begin
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user