2013-09-18 17:17:43 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2013-10-08 17:21:55 -04:00
|
|
|
#include "PassiveMonster.h"
|
2018-08-28 20:51:25 -04:00
|
|
|
#include "../UI/WindowOwner.h"
|
2013-09-18 17:17:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-13 12:38:06 -04:00
|
|
|
class cHorse:
|
2017-10-21 12:56:09 -04:00
|
|
|
public cPassiveMonster,
|
|
|
|
public cEntityWindowOwner
|
2013-09-18 17:17:43 -04:00
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
using Super = cPassiveMonster;
|
2015-12-22 00:43:50 -05:00
|
|
|
|
2013-09-18 17:17:43 -04:00
|
|
|
public:
|
2020-04-13 12:38:06 -04:00
|
|
|
|
2013-10-08 14:20:49 -04:00
|
|
|
cHorse(int Type, int Color, int Style, int TameTimes);
|
2017-10-21 12:56:09 -04:00
|
|
|
virtual ~cHorse() override;
|
2013-09-18 17:17:43 -04:00
|
|
|
|
2014-07-22 18:36:13 -04:00
|
|
|
CLASS_PROTODEF(cHorse)
|
2015-12-22 00:43:50 -05:00
|
|
|
|
2014-10-20 16:55:07 -04:00
|
|
|
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
|
2015-12-22 00:43:50 -05:00
|
|
|
virtual void InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2015-12-15 15:11:58 -05:00
|
|
|
virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways) override;
|
2015-01-11 16:12:26 -05:00
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2013-10-08 14:20:49 -04:00
|
|
|
virtual void OnRightClicked(cPlayer & a_Player) override;
|
2013-10-09 16:02:59 -04:00
|
|
|
|
2017-10-21 12:56:09 -04:00
|
|
|
bool IsSaddled (void) const {return !m_Saddle.IsEmpty(); }
|
2013-10-10 20:00:16 -04:00
|
|
|
bool IsChested (void) const {return m_bHasChest; }
|
|
|
|
bool IsEating (void) const {return m_bIsEating; }
|
|
|
|
bool IsRearing (void) const {return m_bIsRearing; }
|
|
|
|
bool IsMthOpen (void) const {return m_bIsMouthOpen; }
|
2015-05-23 07:56:08 -04:00
|
|
|
bool IsTame (void) const override {return m_bIsTame; }
|
2013-10-10 20:00:16 -04:00
|
|
|
int GetHorseType (void) const {return m_Type; }
|
|
|
|
int GetHorseColor (void) const {return m_Color; }
|
|
|
|
int GetHorseStyle (void) const {return m_Style; }
|
2017-10-21 12:56:09 -04:00
|
|
|
int GetHorseArmour (void) const;
|
|
|
|
|
|
|
|
/** Set the horse's saddle to the given item.
|
|
|
|
@param a_SaddleItem should be either a saddle or empty. */
|
|
|
|
void SetHorseSaddle(cItem a_SaddleItem);
|
|
|
|
|
|
|
|
/** Set the horse's armor slot to the given item.
|
|
|
|
@param a_SaddleItem should be either a type of horse armor or empty. */
|
|
|
|
void SetHorseArmor(cItem a_ArmorItem);
|
|
|
|
|
|
|
|
const cItem & GetHorseSaddle() const { return m_Saddle; }
|
|
|
|
const cItem & GetHorseArmorItem() const { return m_Armor; }
|
2013-10-08 14:20:49 -04:00
|
|
|
|
2015-11-29 13:13:31 -05:00
|
|
|
virtual void GetBreedingItems(cItems & a_Items) override
|
|
|
|
{
|
|
|
|
a_Items.Add(E_ITEM_GOLDEN_CARROT);
|
|
|
|
a_Items.Add(E_ITEM_GOLDEN_APPLE);
|
|
|
|
}
|
|
|
|
|
2017-10-21 12:56:09 -04:00
|
|
|
void PlayerOpenWindow(cPlayer & a_Player);
|
|
|
|
|
2013-10-08 14:20:49 -04:00
|
|
|
private:
|
|
|
|
|
2017-10-21 12:56:09 -04:00
|
|
|
bool m_bHasChest, m_bIsEating, m_bIsRearing, m_bIsMouthOpen, m_bIsTame;
|
|
|
|
int m_Type, m_Color, m_Style, m_TimesToTame, m_TameAttemptTimes, m_RearTickCount;
|
2017-05-20 02:16:28 -04:00
|
|
|
float m_MaxSpeed;
|
2017-10-21 12:56:09 -04:00
|
|
|
cItem m_Saddle;
|
|
|
|
cItem m_Armor;
|
2013-10-08 14:20:49 -04:00
|
|
|
|
2013-09-18 17:17:43 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|