2013-09-18 17:17:43 -04:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
|
|
|
#include "SnowGolem.h"
|
2013-12-22 14:40:07 -05:00
|
|
|
#include "../World.h"
|
2013-09-18 17:17:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cSnowGolem::cSnowGolem(void) :
|
2013-10-20 04:23:30 -04:00
|
|
|
super("SnowGolem", mtSnowGolem, "", "", 0.4, 1.8)
|
2013-09-18 17:17:43 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cSnowGolem::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
|
|
|
{
|
2014-02-24 09:38:38 -05:00
|
|
|
UNUSED(a_Killer);
|
2014-02-23 13:44:58 -05:00
|
|
|
AddRandomDropItem(a_Drops, 0, 15, E_ITEM_SNOWBALL);
|
2013-09-18 17:17:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-22 14:40:07 -05:00
|
|
|
|
|
|
|
void cSnowGolem::Tick(float a_Dt, cChunk & a_Chunk)
|
|
|
|
{
|
|
|
|
super::Tick(a_Dt, a_Chunk);
|
2014-07-21 09:19:48 -04:00
|
|
|
if (IsBiomeNoDownfall(m_World->GetBiomeAt((int) floor(GetPosX()), (int) floor(GetPosZ()))))
|
2013-12-22 14:40:07 -05:00
|
|
|
{
|
|
|
|
TakeDamage(*this);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-12-22 15:12:34 -05:00
|
|
|
BLOCKTYPE BlockBelow = m_World->GetBlock((int) floor(GetPosX()), (int) floor(GetPosY()) - 1, (int) floor(GetPosZ()));
|
|
|
|
BLOCKTYPE Block = m_World->GetBlock((int) floor(GetPosX()), (int) floor(GetPosY()), (int) floor(GetPosZ()));
|
2014-03-01 14:34:19 -05:00
|
|
|
if (Block == E_BLOCK_AIR && cBlockInfo::IsSolid(BlockBelow))
|
2013-12-22 14:40:07 -05:00
|
|
|
{
|
|
|
|
m_World->SetBlock((int) floor(GetPosX()), (int) floor(GetPosY()), (int) floor(GetPosZ()), E_BLOCK_SNOW, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|