18 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
virtual void Destroyed(void) override
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
When hit by someone, run away.
void EngageLoveMode(cPassiveMonster *a_Partner)
Start the mating process.
bool IsInLove() const
Returns whether the monster has just been fed and is ready to mate.
eMonsterType
Identifies individual monster type, as well as their network type-ID.
cPassiveMonster(const AString &a_ConfigName, eMonsterType a_MobType, const AString &a_SoundHurt, const AString &a_SoundDeath, double a_Width, double a_Height)
int m_LoveTimer
If above 0, the monster is in love mode, and will breed if a nearby monster is also in love mode...
void ResetLoveMode()
Finish the mating process.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void GetBreedingItems(cItems &a_Items)
Returns the items that make the animal breed - this is usually the same as the ones that make the ani...
virtual void InheritFromParents(cPassiveMonster *a_Parent1, cPassiveMonster *a_Parent2)
Called after the baby is born, allows the baby to inherit the parents' properties (color...
virtual void GetFollowedItems(cItems &a_Items)
Returns the items that the animal of this class follows when a player holds it in hand...
cPassiveMonster * m_LovePartner
The monster's breeding partner.
int m_LoveCooldown
If above 0, the monster is in cooldown mode and will refuse to breed.
int m_MatingTimer
The monster is engaged in mating, once this reaches zero, a baby will be born.
bool IsInLoveCooldown() const
Returns whether the monster is tired of breeding and is in the cooldown state.
cPassiveMonster * GetPartner(void) const
Returns the partner which the monster is currently mating with.
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
This class bridges a vector of cItem for safe access via Lua.