summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors/BehaviorBreeder.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-09-08 16:52:30 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-09-08 16:52:30 +0200
commit40503ab8912c21c8f7913b190fcf835dd8ad18d1 (patch)
tree5ec63036a2c852704a92e8ce1b3f111a13ed8d0a /src/Mobs/Behaviors/BehaviorBreeder.h
parentmerge (diff)
downloadcuberite-mobs2.tar
cuberite-mobs2.tar.gz
cuberite-mobs2.tar.bz2
cuberite-mobs2.tar.lz
cuberite-mobs2.tar.xz
cuberite-mobs2.tar.zst
cuberite-mobs2.zip
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorBreeder.h')
-rw-r--r--src/Mobs/Behaviors/BehaviorBreeder.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Mobs/Behaviors/BehaviorBreeder.h b/src/Mobs/Behaviors/BehaviorBreeder.h
index a3d0b51af..59bd916f7 100644
--- a/src/Mobs/Behaviors/BehaviorBreeder.h
+++ b/src/Mobs/Behaviors/BehaviorBreeder.h
@@ -3,14 +3,25 @@
class cBehaviorBreeder;
#include "Behavior.h"
+#include "BehaviorPet.h"
-/** Grants breeding capabilities to the mob. */
+/** Grants breeding capabilities to the mob.
+Recommended combination with cBehaviorItemFollower.
+
+Connections to other behaviors:
+ - If the mob also has cBehaviorPet, this behavior is suppressed unless the mob has an owner.
+
+Special connections:
+ - Relies on the polymorphic cMonster::GetBreedingItems function to determine the breeding items.
+
+
+*/
class cBehaviorBreeder : public cBehavior
{
public:
cBehaviorBreeder();
- void AttachToMonster(cMonster & a_Parent);
+ void AttachToMonster(cMonster & a_Parent, cBehaviorPet * a_BehaviorPet = nullptr);
// Functions our host Monster should invoke:
bool IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
@@ -41,6 +52,9 @@ private:
/** The monster's breeding partner. */
cMonster * m_LovePartner;
+ /** The monster's pet behavior, if present. */
+ cMonster * m_BehaviorPet;
+
/** If above 0, the monster is in love mode, and will breed if a nearby monster is also in love mode. Decrements by 1 per tick till reaching zero. */
int m_LoveTimer;