Files
cuberite-2a/source/cSquid.cpp
T

50 lines
877 B
C++
Raw Normal View History

#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "cSquid.h"
2011-12-26 20:57:12 +00:00
#include "Vector3d.h"
cSquid::cSquid()
{
m_MobType = 94;
GetMonsterConfig("Squid");
2011-12-26 20:57:12 +00:00
m_NoWater = 0.f;
}
cSquid::~cSquid()
{
2011-12-26 20:57:12 +00:00
}
bool cSquid::IsA( const char* a_EntityType )
{
if( strcmp( a_EntityType, "cSquid" ) == 0 ) return true;
return cMonster::IsA( a_EntityType );
}
void cSquid::KilledBy( cEntity* a_Killer )
{
2011-12-21 20:42:34 +00:00
//Drops 0-3 Ink Sacs
cMonster::RandomDropItem(E_ITEM_DYE, 0, 3);
cMonster::KilledBy( a_Killer );
}
2011-12-26 20:57:12 +00:00
void cSquid::Tick(float a_Dt)
{
cPassiveMonster::Tick(a_Dt);
Vector3d Pos = GetPosition();
//TODO Not a real behavior, but cool :D
2011-12-28 02:10:05 +00:00
if(!IsBlockWater(GetWorld()->GetBlock((int) Pos.x, (int) Pos.y, (int) Pos.z)) && GetMetaData() != BURNING)
2011-12-26 20:57:12 +00:00
{
2011-12-28 02:10:05 +00:00
SetMetaData(BURNING);
2011-12-26 20:57:12 +00:00
}
}