blob: 89760cd7c84afdcecb635e390cb8f57ac9862b6a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#pragma once
#include "Behaviors/BehaviorBreeder.h"
#include "Behaviors/BehaviorItemFollower.h"
#include "Behaviors/BehaviorCoward.h"
#include "Behaviors/BehaviorWanderer.h"
#include "Monster.h"
enum class eRabbitType : UInt8
{
Brown = 0,
White = 1,
Black = 2,
BlackAndWhite = 3,
Gold = 4,
SaltAndPepper = 5,
TheKillerBunny = 99
};
class cRabbit :
public cMonster
{
typedef cMonster super;
public:
cRabbit();
cRabbit(eRabbitType Type, int MoreCarrotTicks = 0);
CLASS_PROTODEF(cRabbit)
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
virtual void GetFollowedItems(cItems & a_Items) override
{
a_Items.Add(E_ITEM_CARROT);
a_Items.Add(E_ITEM_GOLDEN_CARROT);
a_Items.Add(E_BLOCK_DANDELION);
}
eRabbitType GetRabbitType() const { return m_Type; }
int GetMoreCarrotTicks() const { return m_MoreCarrotTicks; }
virtual cBehaviorBreeder * GetBehaviorBreeder() override;
virtual const cBehaviorBreeder * GetBehaviorBreeder() const override;
private:
// Tick controlling behaviors
cBehaviorBreeder m_BehaviorBreeder;
cBehaviorItemFollower m_BehaviorItemFollower;
cBehaviorCoward m_BehaviorCoward;
cBehaviorWanderer m_BehaviorWanderer;
eRabbitType m_Type;
int m_MoreCarrotTicks; // Ticks until the Rabbit eat planted Carrots
} ;
|