aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Creeper.h
blob: d5cd4cff8b3f6117b7fb58387948d134ced61bd5 (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
#pragma once
using namespace std;

#include "Monster.h"

class Level;
class DamageSource;

class Creeper : public Monster
{
public:
	eINSTANCEOF GetType() { return eTYPE_CREEPER; }
	static Entity *create(Level *level) { return new Creeper(level); }

private:
	static const int DATA_SWELL_DIR = 16;
	static const int DATA_IS_POWERED = 17;

	int oldSwell;
	int swell;
	int maxSwell;
	int explosionRadius;

	void _init();

public:
	Creeper(Level *level);

protected:
	void registerAttributes();

public:
	virtual bool useNewAi();

	virtual int getMaxFallDistance();

protected:
	virtual void causeFallDamage(float distance);
	virtual void defineSynchedData();

public:
	virtual void addAdditonalSaveData(CompoundTag *entityTag);
	virtual void readAdditionalSaveData(CompoundTag *tag);

protected:
	virtual void tick();

protected:
	virtual int getHurtSound();
	virtual int getDeathSound();

public:
	virtual void die(DamageSource *source);
	virtual bool doHurtTarget(shared_ptr<Entity> target);
	virtual bool isPowered();
	float getSwelling(float a);

protected:
	int getDeathLoot();

public:
	int getSwellDir();
	void setSwellDir(int dir);
	void thunderHit(const LightningBolt *lightningBolt) ;
};