summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-24 09:25:50 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-24 09:25:50 +0200
commit4e5baf3f39c6972fb525b0d4aed58f59de3005bd (patch)
tree4bdf3c28f92ea2fdd469f0ec9c404df96fd6b78f /src/Mobs/Behaviors
parentInitial Monster Behavior vector logic (diff)
downloadcuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar
cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.gz
cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.bz2
cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.lz
cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.xz
cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.zst
cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.zip
Diffstat (limited to 'src/Mobs/Behaviors')
-rw-r--r--src/Mobs/Behaviors/BehaviorAggressive.cpp2
-rw-r--r--src/Mobs/Behaviors/BehaviorBreeder.cpp12
-rw-r--r--src/Mobs/Behaviors/BehaviorChaser.cpp10
-rw-r--r--src/Mobs/Behaviors/BehaviorCoward.cpp8
-rw-r--r--src/Mobs/Behaviors/BehaviorDayLightBurner.cpp2
-rw-r--r--src/Mobs/Behaviors/BehaviorItemFollower.cpp8
6 files changed, 31 insertions, 11 deletions
diff --git a/src/Mobs/Behaviors/BehaviorAggressive.cpp b/src/Mobs/Behaviors/BehaviorAggressive.cpp
index d629d83ac..f7c553f52 100644
--- a/src/Mobs/Behaviors/BehaviorAggressive.cpp
+++ b/src/Mobs/Behaviors/BehaviorAggressive.cpp
@@ -19,7 +19,7 @@ cBehaviorAggressive::cBehaviorAggressive(cMonster * a_Parent) : m_Parent(a_Paren
-void cBehaviorAggressive::PreTick()
+void cBehaviorAggressive::PreTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
// Target something new if we have no target
if (m_ParentChaser->GetTarget() == nullptr)
diff --git a/src/Mobs/Behaviors/BehaviorBreeder.cpp b/src/Mobs/Behaviors/BehaviorBreeder.cpp
index 219846367..b2bd8da5d 100644
--- a/src/Mobs/Behaviors/BehaviorBreeder.cpp
+++ b/src/Mobs/Behaviors/BehaviorBreeder.cpp
@@ -24,8 +24,10 @@ cBehaviorBreeder::cBehaviorBreeder(cMonster * a_Parent) :
-void cBehaviorBreeder::Tick()
+void cBehaviorBreeder::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
cWorld * World = m_Parent->GetWorld();
// if we have a partner, mate
if (m_LovePartner != nullptr)
@@ -74,8 +76,10 @@ void cBehaviorBreeder::Tick()
-void cBehaviorBreeder::PostTick()
+void cBehaviorBreeder::PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
if (m_MatingTimer > 0)
{
m_MatingTimer--;
@@ -94,8 +98,10 @@ void cBehaviorBreeder::PostTick()
-bool cBehaviorBreeder::IsControlDesired()
+bool cBehaviorBreeder::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
cWorld * World = m_Parent->GetWorld();
// if we have a love partner, we should control the mob
diff --git a/src/Mobs/Behaviors/BehaviorChaser.cpp b/src/Mobs/Behaviors/BehaviorChaser.cpp
index c486c049a..025c60dd0 100644
--- a/src/Mobs/Behaviors/BehaviorChaser.cpp
+++ b/src/Mobs/Behaviors/BehaviorChaser.cpp
@@ -23,8 +23,10 @@ cBehaviorChaser::cBehaviorChaser(cMonster * a_Parent) :
-bool cBehaviorChaser::IsControlDesired()
+bool cBehaviorChaser::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
// If we have a target, we have something to do! Return true and control the mob Ticks.
// Otherwise return false.
return (GetTarget() != nullptr);
@@ -34,8 +36,10 @@ bool cBehaviorChaser::IsControlDesired()
-void cBehaviorChaser::Tick()
+void cBehaviorChaser::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
/*
* if ((GetTarget() != nullptr))
{
@@ -83,7 +87,7 @@ void cBehaviorChaser::ApproachTarget()
-void cBehaviorChaser::PostTick()
+void cBehaviorChaser::PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
if (m_TicksSinceLastDamaged < 100)
{
diff --git a/src/Mobs/Behaviors/BehaviorCoward.cpp b/src/Mobs/Behaviors/BehaviorCoward.cpp
index 31927a5e8..43be5c49c 100644
--- a/src/Mobs/Behaviors/BehaviorCoward.cpp
+++ b/src/Mobs/Behaviors/BehaviorCoward.cpp
@@ -16,8 +16,10 @@ cBehaviorCoward::cBehaviorCoward(cMonster * a_Parent) :
-bool cBehaviorCoward::IsControlDesired()
+bool cBehaviorCoward::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
return (m_Attacker != nullptr); //mobTodo probably not so safe pointer (and cChaser m_Target too)
}
@@ -25,8 +27,10 @@ bool cBehaviorCoward::IsControlDesired()
-void cBehaviorCoward::Tick()
+void cBehaviorCoward::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
if (m_Attacker == nullptr)
{
return;
diff --git a/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp b/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp
index 81307f36a..b28c3c49c 100644
--- a/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp
+++ b/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp
@@ -15,6 +15,8 @@ cBehaviorDayLightBurner::cBehaviorDayLightBurner(cMonster * a_Parent) : m_Parent
void cBehaviorDayLightBurner::PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
// mobTodo WouldBurn
+ bool WouldBurn = false; // TEMP
+
int RelY = static_cast<int>(m_Parent->GetPosY());
if ((RelY < 0) || (RelY >= cChunkDef::Height))
{
diff --git a/src/Mobs/Behaviors/BehaviorItemFollower.cpp b/src/Mobs/Behaviors/BehaviorItemFollower.cpp
index 22c20d6b4..c6cb0df04 100644
--- a/src/Mobs/Behaviors/BehaviorItemFollower.cpp
+++ b/src/Mobs/Behaviors/BehaviorItemFollower.cpp
@@ -17,8 +17,10 @@ cBehaviorItemFollower::cBehaviorItemFollower(cMonster * a_Parent) :
-bool cBehaviorItemFollower::IsControlDesired()
+bool cBehaviorItemFollower::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
cItems FollowedItems;
m_Parent->GetFollowedItems(FollowedItems);
if (FollowedItems.Size() > 0)
@@ -40,8 +42,10 @@ bool cBehaviorItemFollower::IsControlDesired()
-void cBehaviorItemFollower::Tick()
+void cBehaviorItemFollower::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
cItems FollowedItems;
m_Parent->GetFollowedItems(FollowedItems);
if (FollowedItems.Size() > 0)