2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
#include "PathfinderMob.h"
|
|
|
|
|
#include "Enemy.h"
|
|
|
|
|
|
|
|
|
|
class Level;
|
|
|
|
|
class CompoundTag;
|
|
|
|
|
class DamageSource;
|
|
|
|
|
|
|
|
|
|
class Monster : public PathfinderMob, public Enemy
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
eINSTANCEOF GetType() { return eTYPE_MONSTER; }
|
|
|
|
|
static Entity *create(Level *level) { return NULL; }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int attackDamage;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void _init();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Monster(Level *level);
|
|
|
|
|
|
|
|
|
|
virtual void aiStep();
|
|
|
|
|
virtual void tick();
|
|
|
|
|
|
|
|
|
|
protected:
|
2026-03-02 15:58:20 +07:00
|
|
|
virtual std::shared_ptr<Entity> findAttackTarget();
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual bool hurt(DamageSource *source, int dmg);
|
2026-03-02 15:58:20 +07:00
|
|
|
virtual bool doHurtTarget(std::shared_ptr<Entity> target);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
protected:
|
2026-03-02 15:58:20 +07:00
|
|
|
virtual void checkHurtTarget(std::shared_ptr<Entity> target, float distance);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual float getWalkTargetValue(int x, int y, int z);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual bool isDarkEnoughToSpawn();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual bool canSpawn();
|
|
|
|
|
};
|
|
|
|
|
|