blob: 9b7183da7119e1579fa8359ae2e305d394b8e850 (
plain)
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
62
63
64
|
#pragma once
using namespace std;
#include "Animal.h"
class Player;
class LightningBolt;
class ControlledByPlayerGoal;
class Pig : public Animal
{
public:
eINSTANCEOF GetType() { return eTYPE_PIG; }
static Entity *create(Level *level) { return new Pig(level); }
private:
static const int DATA_SADDLE_ID = 16;
ControlledByPlayerGoal *controlGoal;
public:
Pig(Level *level);
virtual bool useNewAi();
protected:
virtual void registerAttributes();
virtual void newServerAiStep();
public:
virtual bool canBeControlledByRider();
protected:
virtual void defineSynchedData();
public:
virtual void addAdditonalSaveData(CompoundTag *tag);
virtual void readAdditionalSaveData(CompoundTag *tag);
protected:
virtual int getAmbientSound();
virtual int getHurtSound();
virtual int getDeathSound();
virtual void playStepSound(int xt, int yt, int zt, int t);
public:
virtual bool mobInteract(shared_ptr<Player> player);
protected:
virtual int getDeathLoot();
virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
public:
bool hasSaddle();
void setSaddle(bool value);
virtual void thunderHit(const LightningBolt *lightningBolt);
protected:
virtual void causeFallDamage(float distance);
public:
virtual shared_ptr<AgableMob> getBreedOffspring(shared_ptr<AgableMob> target);
bool isFood(shared_ptr<ItemInstance> itemInstance);
ControlledByPlayerGoal *getControlGoal();
};
|