aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Wolf.h
blob: 52f2a23b668de07ac232c5a443006dc79570759d (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#pragma once

using namespace std;

#include "TamableAnimal.h"
class DamageSource;

class Wolf : public TamableAnimal
{
public:
	eINSTANCEOF GetType() { return eTYPE_WOLF; }
	static Entity *create(Level *level) { return new Wolf(level); }
private:
	// synch health in a separate field to show tame wolves' health
    static const int DATA_HEALTH_ID = 18;
	static const int DATA_INTERESTED_ID = 19;
	static const int DATA_COLLAR_COLOR = 20;
    static const int START_HEALTH = 8;
    static const int MAX_HEALTH = 20;
    static const int TAME_HEALTH = 20;

	float interestedAngle, interestedAngleO;
	bool m_isWet, isShaking;
	float shakeAnim, shakeAnimO;

public:
	Wolf(Level *level);
	virtual bool useNewAi();
	virtual void setTarget(shared_ptr<Mob> target);

protected:
	virtual void serverAiMobStep();

public:
	virtual int getMaxHealth();

protected:
	virtual void defineSynchedData();
	virtual bool makeStepSound();

public:
	virtual int getTexture();		// 4J - changed from wstring to ing
	virtual void addAdditonalSaveData(CompoundTag *tag);
	virtual void readAdditionalSaveData(CompoundTag *tag);

protected:
	virtual bool removeWhenFarAway();
	virtual int getAmbientSound();
	virtual int getHurtSound();
	virtual int getDeathSound();
	virtual float getSoundVolume();
	virtual int getDeathLoot();

public:
	virtual void aiStep();
	virtual void tick();
	bool isWet();
	float getWetShade(float a);
	float getBodyRollAngle(float a, float offset);
	float getHeadRollAngle(float a);
	float getHeadHeight();
	int getMaxHeadXRot();
	virtual bool hurt(DamageSource *source, int dmg);
	virtual bool doHurtTarget(shared_ptr<Entity> target);
	virtual bool interact(shared_ptr<Player> player);
	virtual void handleEntityEvent(byte id);
	float getTailAngle();
	virtual bool isFood(shared_ptr<ItemInstance> item);
	virtual int getMaxSpawnClusterSize();
	bool isAngry();
	void setAngry(bool value);
	int getCollarColor();
	void setCollarColor(int color);
	void tame(const wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool bSetSitting);

	// For tooltips
	int GetSynchedHealth();

protected:
	virtual shared_ptr<AgableMob> getBreedOffspring(shared_ptr<AgableMob> target);

public:
	virtual void setIsInterested(bool isInterested);
	virtual bool canMate(shared_ptr<Animal> animal);
	bool isInterested();
};