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