summaryrefslogtreecommitdiffstats
path: root/source/cSquid.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 21:57:12 +0100
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 21:57:12 +0100
commit9f77572fb0d045229556314ba9d7aa0f52ad5635 (patch)
tree67bf3cfaf013be8566e0d541c1a1b571719816f7 /source/cSquid.cpp
parent- improved ClosestPlayerDetection (Really the closest now ;)) (diff)
downloadcuberite-9f77572fb0d045229556314ba9d7aa0f52ad5635.tar
cuberite-9f77572fb0d045229556314ba9d7aa0f52ad5635.tar.gz
cuberite-9f77572fb0d045229556314ba9d7aa0f52ad5635.tar.bz2
cuberite-9f77572fb0d045229556314ba9d7aa0f52ad5635.tar.lz
cuberite-9f77572fb0d045229556314ba9d7aa0f52ad5635.tar.xz
cuberite-9f77572fb0d045229556314ba9d7aa0f52ad5635.tar.zst
cuberite-9f77572fb0d045229556314ba9d7aa0f52ad5635.zip
Diffstat (limited to 'source/cSquid.cpp')
-rw-r--r--source/cSquid.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/cSquid.cpp b/source/cSquid.cpp
index b2baf462b..af4b167f2 100644
--- a/source/cSquid.cpp
+++ b/source/cSquid.cpp
@@ -1,13 +1,16 @@
#include "cSquid.h"
+#include "Vector3d.h"
cSquid::cSquid()
{
m_MobType = 94;
GetMonsterConfig("Squid");
+ m_NoWater = 0.f;
}
cSquid::~cSquid()
{
+
}
bool cSquid::IsA( const char* a_EntityType )
@@ -23,3 +26,25 @@ void cSquid::KilledBy( cEntity* a_Killer )
cMonster::KilledBy( a_Killer );
}
+
+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);
+ }
+ }
+
+} \ No newline at end of file