2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Monster.h"
|
|
|
|
|
|
|
|
|
|
class EnderMan : public Monster
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
eINSTANCEOF GetType() { return eTYPE_ENDERMAN; }
|
|
|
|
|
static Entity *create(Level *level) { return new EnderMan(level); }
|
|
|
|
|
public:
|
|
|
|
|
static void staticCtor();
|
|
|
|
|
private:
|
2026-03-03 03:04:10 +08:00
|
|
|
static AttributeModifier *SPEED_MODIFIER_ATTACKING;
|
|
|
|
|
|
2026-03-01 12:16:08 +08:00
|
|
|
static bool MAY_TAKE[256];
|
|
|
|
|
|
|
|
|
|
static const int DATA_CARRY_ITEM_ID = 16;
|
|
|
|
|
static const int DATA_CARRY_ITEM_DATA = 17;
|
|
|
|
|
static const int DATA_CREEPY = 18;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int teleportTime;
|
|
|
|
|
int aggroTime;
|
2026-03-03 03:04:10 +08:00
|
|
|
shared_ptr<Entity> lastAttackTarget;
|
|
|
|
|
bool aggroedByPlayer;
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
EnderMan(Level *level);
|
|
|
|
|
|
|
|
|
|
protected:
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual void registerAttributes();
|
2026-03-01 12:16:08 +08:00
|
|
|
virtual void defineSynchedData();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual void addAdditonalSaveData(CompoundTag *tag);
|
|
|
|
|
virtual void readAdditionalSaveData(CompoundTag *tag);
|
|
|
|
|
|
|
|
|
|
protected:
|
2026-03-02 17:37:16 +07:00
|
|
|
virtual shared_ptr<Entity> findAttackTarget();
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
private:
|
2026-03-02 17:37:16 +07:00
|
|
|
bool isLookingAtMe(shared_ptr<Player> player);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual void aiStep();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool teleport();
|
2026-03-02 17:37:16 +07:00
|
|
|
bool teleportTowards(shared_ptr<Entity> e);
|
2026-03-01 12:16:08 +08:00
|
|
|
bool teleport(double xx, double yy, double zz);
|
|
|
|
|
|
|
|
|
|
virtual int getAmbientSound();
|
|
|
|
|
virtual int getHurtSound();
|
|
|
|
|
virtual int getDeathSound();
|
|
|
|
|
virtual int getDeathLoot();
|
|
|
|
|
virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void setCarryingTile(int carryingTile);
|
|
|
|
|
int getCarryingTile();
|
|
|
|
|
void setCarryingData(int carryingData);
|
|
|
|
|
int getCarryingData();
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual bool hurt(DamageSource *source, float damage);
|
2026-03-01 12:16:08 +08:00
|
|
|
bool isCreepy();
|
|
|
|
|
void setCreepy(bool creepy);
|
|
|
|
|
};
|