From 32ee1708a24836b26cd700eb42ad8264a3ecae83 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Fri, 9 Oct 2020 22:49:25 +0200 Subject: Adding wolf breading and moving breeding functionality to cMonster (#4951) * added wolf breading * mpoved breeding to monster * checkstyle * fixed my IDE "helping" * removed magic number and fixed faster aging * added flooring to age manipulation * fixed copiler error * fixed typo * moved tps to Defines.h * removed the TPS constant from the lua API exposure * added inline constexpr added explanation * fixed broken build * "fixed" build Co-authored-by: 12xx12 <12xx12100@gmail.com> --- src/Mobs/PassiveMonster.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'src/Mobs/PassiveMonster.h') diff --git a/src/Mobs/PassiveMonster.h b/src/Mobs/PassiveMonster.h index 67d7399d8..15900a95d 100644 --- a/src/Mobs/PassiveMonster.h +++ b/src/Mobs/PassiveMonster.h @@ -31,47 +31,7 @@ public: /** When hit by someone, run away */ virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override; - /** Returns the items that the animal of this class follows when a player holds it in hand. */ - virtual void GetFollowedItems(cItems & a_Items) { } - - /** Returns the items that make the animal breed - this is usually the same as the ones that make the animal follow, but not necessarily. */ - virtual void GetBreedingItems(cItems & a_Items) { GetFollowedItems(a_Items); } - - /** Called after the baby is born, allows the baby to inherit the parents' properties (color, etc.) */ - virtual void InheritFromParents(cPassiveMonster * a_Parent1, cPassiveMonster * a_Parent2) { } - - /** Returns the partner which the monster is currently mating with. */ - cPassiveMonster * GetPartner(void) const { return m_LovePartner; } - - /** Start the mating process. Causes the monster to keep bumping into the partner until m_MatingTimer reaches zero. */ - void EngageLoveMode(cPassiveMonster * a_Partner); - - /** Finish the mating process. Called after a baby is born. Resets all breeding related timers and sets m_LoveCooldown to 20 minutes. */ - void ResetLoveMode(); - - /** Returns whether the monster has just been fed and is ready to mate. If this is "true" and GetPartner isn't "nullptr", then the monster is mating. */ - bool IsInLove() const { return (m_LoveTimer > 0); } - - /** Returns whether the monster is tired of breeding and is in the cooldown state. */ - bool IsInLoveCooldown() const { return (m_LoveCooldown > 0); } - virtual void Destroyed(void) override; - -protected: - /** The monster's breeding partner. */ - cPassiveMonster * m_LovePartner; - - /** Remembers the player is was last fed by for statistics tracking */ - cUUID m_Feeder; - - /** 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; - - /** If above 0, the monster is in cooldown mode and will refuse to breed. Decrements by 1 per tick till reaching zero. */ - int m_LoveCooldown; - - /** The monster is engaged in mating, once this reaches zero, a baby will be born. Decrements by 1 per tick till reaching zero, then a baby is made and ResetLoveMode() is called. */ - int m_MatingTimer; }; -- cgit v1.2.3