blob: 55b6cae2a4a27b405eec3134684cc03737f3d891 (
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
|
#pragma once
#include "Golem.h"
class Village;
class Level;
class VillagerGolem : public Golem
{
public:
eINSTANCEOF GetType() { return eTYPE_VILLAGERGOLEM; }
static Entity *create(Level *level) { return new VillagerGolem(level); }
protected:
static const int DATA_FLAGS_ID = 16;
private:
int villageUpdateInterval;
weak_ptr<Village> village;
int attackAnimationTick;
int offerFlowerTick;
public:
VillagerGolem(Level *level);
protected:
virtual void defineSynchedData();
public:
virtual bool useNewAi();
protected:
virtual void serverAiMobStep();
virtual void registerAttributes();
virtual int decreaseAirSupply(int currentSupply);
virtual void doPush(shared_ptr<Entity> e);
public:
virtual void aiStep();
virtual bool canAttackType(eINSTANCEOF targetType);
virtual void addAdditonalSaveData(CompoundTag *tag);
virtual void readAdditionalSaveData(CompoundTag *tag);
virtual bool doHurtTarget(shared_ptr<Entity> target);
virtual void handleEntityEvent(byte id);
virtual shared_ptr<Village> getVillage();
virtual int getAttackAnimationTick();
virtual void offerFlower(bool offer);
protected:
virtual int getAmbientSound();
virtual int getHurtSound();
virtual int getDeathSound();
virtual void playStepSound(int xt, int yt, int zt, int t);
virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
public:
virtual int getOfferFlowerTick();
virtual bool isPlayerCreated();
virtual void setPlayerCreated(bool value);
virtual void die(DamageSource *source);
virtual bool hurt(DamageSource *source, float dmg);
};
|