2011-10-25 19:46:01 -04:00
|
|
|
#include "cSquid.h"
|
2011-12-26 15:57:12 -05:00
|
|
|
#include "Vector3d.h"
|
2011-10-25 19:46:01 -04:00
|
|
|
|
|
|
|
cSquid::cSquid()
|
|
|
|
{
|
|
|
|
m_MobType = 94;
|
|
|
|
GetMonsterConfig("Squid");
|
2011-12-26 15:57:12 -05:00
|
|
|
m_NoWater = 0.f;
|
2011-10-25 19:46:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
cSquid::~cSquid()
|
|
|
|
{
|
2011-12-26 15:57:12 -05:00
|
|
|
|
2011-10-25 19:46:01 -04: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 15:42:34 -05:00
|
|
|
//Drops 0-3 Ink Sacs
|
|
|
|
cMonster::RandomDropItem(E_ITEM_DYE, 0, 3);
|
|
|
|
|
2011-10-25 19:46:01 -04:00
|
|
|
cMonster::KilledBy( a_Killer );
|
|
|
|
}
|
2011-12-26 15:57:12 -05:00
|
|
|
|
|
|
|
void cSquid::Tick(float a_Dt)
|
|
|
|
{
|
|
|
|
cPassiveMonster::Tick(a_Dt);
|
|
|
|
|
|
|
|
Vector3d Pos = GetPosition();
|
|
|
|
|
|
|
|
|
|
|
|
//TODO Not a real behavior, but cool :D
|
|
|
|
if(!IsBlockWater(GetWorld()->GetBlock(Pos.x, Pos.y, Pos.z)))
|
|
|
|
{
|
|
|
|
//Die slowly Muhahaha :D (To prevent all this squids on the land :D)
|
|
|
|
m_NoWater += a_Dt;
|
|
|
|
|
|
|
|
if(m_NoWater > 1000.f)
|
|
|
|
{
|
|
|
|
m_NoWater -= 1000.f;
|
|
|
|
TakeDamage(1, this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|