2012-12-21 06:04:08 -05:00
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
#pragma once
|
|
|
|
|
2012-09-23 16:53:08 -04:00
|
|
|
#include "PassiveMonster.h"
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2012-12-21 06:04:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-13 12:38:06 -04:00
|
|
|
class cSheep:
|
2012-12-21 06:04:08 -05:00
|
|
|
public cPassiveMonster
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
using Super = cPassiveMonster;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
public:
|
2014-06-30 14:23:17 -04:00
|
|
|
|
2014-07-01 14:42:23 -04:00
|
|
|
/** The number is the color of the sheep.
|
2014-07-12 19:04:43 -04:00
|
|
|
Use E_META_WOOL_* constants for the wool color.
|
|
|
|
If you type -1, the server will generate a random color
|
|
|
|
with the GenerateNaturalRandomColor() function. */
|
2014-06-28 06:59:09 -04:00
|
|
|
cSheep(int a_Color = -1);
|
2014-06-30 14:23:17 -04:00
|
|
|
|
2014-07-22 18:36:13 -04:00
|
|
|
CLASS_PROTODEF(cSheep)
|
2014-06-30 14:23:17 -04:00
|
|
|
|
2014-10-20 16:55:07 -04:00
|
|
|
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
|
2013-10-08 14:20:49 -04:00
|
|
|
virtual void OnRightClicked(cPlayer & a_Player) override;
|
2015-01-11 16:12:26 -05:00
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2015-12-12 14:55:58 -05:00
|
|
|
virtual void InheritFromParents(cPassiveMonster * a_Parent1, cPassiveMonster * a_Parent2) override;
|
2014-01-25 15:19:52 -05:00
|
|
|
|
2015-11-14 10:42:26 -05:00
|
|
|
virtual void GetFollowedItems(cItems & a_Items) override
|
|
|
|
{
|
|
|
|
a_Items.Add(E_ITEM_WHEAT);
|
|
|
|
}
|
2014-01-29 13:15:26 -05:00
|
|
|
|
2014-07-12 19:04:43 -04:00
|
|
|
/** Generates a random color for the sheep like the vanilla server.
|
2017-08-24 05:19:40 -04:00
|
|
|
The percent's where used are from the wiki: https://minecraft.gamepedia.com/Sheep#Breeding */
|
2014-06-30 14:23:17 -04:00
|
|
|
static NIBBLETYPE GenerateNaturalRandomColor(void);
|
|
|
|
|
2013-10-08 14:20:49 -04:00
|
|
|
bool IsSheared(void) const { return m_IsSheared; }
|
2014-06-28 07:19:32 -04:00
|
|
|
void SetSheared(bool a_IsSheared) { m_IsSheared = a_IsSheared; }
|
|
|
|
|
2013-10-08 14:20:49 -04:00
|
|
|
int GetFurColor(void) const { return m_WoolColor; }
|
2014-06-30 14:23:17 -04:00
|
|
|
void SetFurColor(int a_WoolColor) { m_WoolColor = a_WoolColor; }
|
2013-10-08 14:20:49 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_IsSheared;
|
|
|
|
int m_WoolColor;
|
2014-01-25 15:19:52 -05:00
|
|
|
int m_TimeToStopEating;
|
2013-10-08 14:20:49 -04:00
|
|
|
|
2012-12-21 06:04:08 -05:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
|