2012-12-21 11:04:08 +00:00
|
|
|
|
2011-12-25 22:47:12 +00:00
|
|
|
#pragma once
|
|
|
|
|
2012-09-23 20:53:08 +00:00
|
|
|
#include "Monster.h"
|
2011-12-25 22:47:12 +00:00
|
|
|
|
2012-12-21 11:04:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cPassiveMonster :
|
|
|
|
public cMonster
|
2011-12-25 22:47:12 +00:00
|
|
|
{
|
2012-12-21 11:04:08 +00:00
|
|
|
typedef cMonster super;
|
|
|
|
|
2011-12-25 22:47:12 +00:00
|
|
|
public:
|
2014-09-17 17:40:10 +00:00
|
|
|
cPassiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
|
2012-12-21 11:04:08 +00:00
|
|
|
|
2015-01-11 21:12:26 +00:00
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2015-11-29 18:13:31 +00:00
|
|
|
virtual void OnRightClicked(cPlayer & a_Player) override;
|
2012-12-21 11:04:08 +00:00
|
|
|
|
2015-07-31 14:49:10 +00:00
|
|
|
/** When hit by someone, run away */
|
2014-04-25 22:32:30 +00:00
|
|
|
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
2015-07-31 14:49:10 +00:00
|
|
|
|
2015-11-14 15:42:26 +00:00
|
|
|
/** Returns the items that the animal of this class follows when a player holds it in hand. */
|
|
|
|
virtual void GetFollowedItems(cItems & a_Items) { }
|
2014-01-29 18:15:26 +00:00
|
|
|
|
2015-11-29 18:13:31 +00:00
|
|
|
/** 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); }
|
|
|
|
|
|
|
|
cPassiveMonster * GetPartner(void) const { return m_LovePartner; }
|
|
|
|
void EngageLoveMode(cPassiveMonster * a_Partner);
|
|
|
|
void ResetLoveMode();
|
|
|
|
|
|
|
|
bool IsInLove() const { return (m_LoveTimer > 0); }
|
|
|
|
bool IsInLoveCooldown() const { return (m_LoveCooldown > 0); }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
cPassiveMonster * m_LovePartner;
|
|
|
|
int m_LoveTimer;
|
|
|
|
int m_LoveCooldown;
|
|
|
|
int m_MatingTimer;
|
|
|
|
};
|
2012-12-21 11:04:08 +00:00
|
|
|
|
|
|
|
|
2011-12-25 22:47:12 +00:00
|
|
|
|
|
|
|
|