2014-04-27 00:41:07 +00:00
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
2014-04-28 00:03:06 +00:00
|
|
|
#include "GhastFireballEntity.h"
|
2014-04-27 00:41:07 +00:00
|
|
|
#include "../World.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-29 12:59:24 +00:00
|
|
|
cGhastFireballEntity::cGhastFireballEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
2020-04-13 16:38:06 +00:00
|
|
|
Super(pkGhastFireball, a_Creator, a_Pos, 1, 1)
|
2014-04-27 00:41:07 +00:00
|
|
|
{
|
|
|
|
SetSpeed(a_Speed);
|
|
|
|
SetGravity(0);
|
2015-03-30 23:42:32 +00:00
|
|
|
SetAirDrag(0);
|
2014-04-27 00:41:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-24 11:56:56 +00:00
|
|
|
void cGhastFireballEntity::Explode(Vector3i a_Block)
|
2014-04-27 00:41:07 +00:00
|
|
|
{
|
2015-05-24 11:56:56 +00:00
|
|
|
m_World->DoExplosionAt(1, a_Block.x, a_Block.y, a_Block.z, true, esGhastFireball, this);
|
2014-04-27 00:41:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-07 08:25:34 +00:00
|
|
|
void cGhastFireballEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
|
2014-04-27 00:41:07 +00:00
|
|
|
{
|
|
|
|
Destroy();
|
2015-05-24 11:56:56 +00:00
|
|
|
Explode(a_HitPos.Floor());
|
2014-04-27 00:41:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-07 08:25:34 +00:00
|
|
|
void cGhastFireballEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
|
2014-04-27 00:41:07 +00:00
|
|
|
{
|
|
|
|
Destroy();
|
2015-05-24 11:56:56 +00:00
|
|
|
Explode(a_HitPos.Floor());
|
2014-04-27 16:42:31 +00:00
|
|
|
}
|