2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "PassiveMonster.h"
|
2017-08-25 08:43:18 -04:00
|
|
|
#include "../UUID.h"
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-13 12:38:06 -04:00
|
|
|
class cOcelot:
|
2013-07-29 07:13:03 -04:00
|
|
|
public cPassiveMonster
|
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
using Super = cPassiveMonster;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
public:
|
2017-07-12 06:42:02 -04:00
|
|
|
|
|
|
|
enum eCatType
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
2017-07-12 06:42:02 -04:00
|
|
|
ctWildOcelot,
|
|
|
|
ctTuxedo,
|
|
|
|
ctTabby,
|
|
|
|
ctSiamese,
|
|
|
|
} ;
|
|
|
|
|
|
|
|
cOcelot(void);
|
2013-07-29 07:13:03 -04:00
|
|
|
|
2017-07-12 06:42:02 -04:00
|
|
|
CLASS_PROTODEF(cOcelot)
|
|
|
|
|
|
|
|
virtual void OnRightClicked(cPlayer & a_Player) override;
|
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
|
|
|
virtual void TickFollowPlayer();
|
2015-11-29 13:13:31 -05:00
|
|
|
virtual void GetBreedingItems(cItems & a_Items) override
|
|
|
|
{
|
|
|
|
a_Items.Add(E_ITEM_RAW_FISH);
|
|
|
|
}
|
2018-02-04 15:53:35 -05:00
|
|
|
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
2015-11-29 13:13:31 -05:00
|
|
|
|
2017-07-12 06:42:02 -04:00
|
|
|
// Get functions
|
|
|
|
bool IsSitting (void) const override { return m_IsSitting; }
|
|
|
|
bool IsTame (void) const override { return m_IsTame; }
|
|
|
|
bool IsBegging (void) const { return m_IsBegging; }
|
|
|
|
AString GetOwnerName (void) const { return m_OwnerName; }
|
2017-08-25 08:43:18 -04:00
|
|
|
cUUID GetOwnerUUID (void) const { return m_OwnerUUID; }
|
2017-07-12 06:42:02 -04:00
|
|
|
eCatType GetOcelotType (void) const { return m_CatType; }
|
|
|
|
|
|
|
|
// Set functions
|
|
|
|
void SetIsSitting (bool a_IsSitting) { m_IsSitting = a_IsSitting; }
|
|
|
|
void SetIsTame (bool a_IsTame) { m_IsTame = a_IsTame; }
|
|
|
|
void SetIsBegging (bool a_IsBegging) { m_IsBegging = a_IsBegging; }
|
2017-08-25 08:43:18 -04:00
|
|
|
void SetOwner (const AString & a_NewOwnerName, const cUUID & a_NewOwnerUUID)
|
2017-07-12 06:42:02 -04:00
|
|
|
{
|
|
|
|
m_OwnerName = a_NewOwnerName;
|
|
|
|
m_OwnerUUID = a_NewOwnerUUID;
|
|
|
|
}
|
|
|
|
void SetCatType (eCatType a_CatType) { m_CatType = a_CatType; }
|
|
|
|
|
2017-08-17 10:29:43 -04:00
|
|
|
/** Returns true if there's a cat sitting above the given position */
|
|
|
|
static bool IsCatSittingOnBlock(cWorld * a_World, Vector3d a_BlockPosition);
|
|
|
|
|
2017-07-12 06:42:02 -04:00
|
|
|
protected:
|
|
|
|
|
|
|
|
bool m_IsSitting;
|
|
|
|
bool m_IsTame;
|
|
|
|
bool m_IsBegging;
|
|
|
|
eCatType m_CatType;
|
|
|
|
/** Only check for a nearby player holding the breeding items every 23 ticks. */
|
|
|
|
int m_CheckPlayerTickCount;
|
|
|
|
AString m_OwnerName;
|
2017-08-25 08:43:18 -04:00
|
|
|
cUUID m_OwnerUUID;
|
2013-07-29 07:13:03 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|