diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-08 16:52:30 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-08 16:52:30 +0200 |
commit | 40503ab8912c21c8f7913b190fcf835dd8ad18d1 (patch) | |
tree | 5ec63036a2c852704a92e8ce1b3f111a13ed8d0a /src/Mobs/Behaviors/BehaviorBreeder.h | |
parent | merge (diff) | |
download | cuberite-40503ab8912c21c8f7913b190fcf835dd8ad18d1.tar cuberite-40503ab8912c21c8f7913b190fcf835dd8ad18d1.tar.gz cuberite-40503ab8912c21c8f7913b190fcf835dd8ad18d1.tar.bz2 cuberite-40503ab8912c21c8f7913b190fcf835dd8ad18d1.tar.lz cuberite-40503ab8912c21c8f7913b190fcf835dd8ad18d1.tar.xz cuberite-40503ab8912c21c8f7913b190fcf835dd8ad18d1.tar.zst cuberite-40503ab8912c21c8f7913b190fcf835dd8ad18d1.zip |
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorBreeder.h')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorBreeder.h | 18 |
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; |