2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "PathfinderMob.h"
|
|
|
|
|
|
|
|
|
|
class AgableMob : public PathfinderMob
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
static const int DATA_AGE_ID = 12;
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
public:
|
|
|
|
|
static const int BABY_START_AGE = -20 * 60 * 20;
|
|
|
|
|
|
|
|
|
|
private:
|
2026-03-01 12:16:08 +08:00
|
|
|
float registeredBBWidth;
|
|
|
|
|
float registeredBBHeight;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
AgableMob(Level *level);
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual bool mobInteract(shared_ptr<Player> player);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void defineSynchedData();
|
|
|
|
|
|
|
|
|
|
public:
|
2026-03-02 17:37:16 +07:00
|
|
|
virtual shared_ptr<AgableMob> getBreedOffspring(shared_ptr<AgableMob> target) = 0;
|
2026-03-01 12:16:08 +08:00
|
|
|
virtual int getAge();
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual void ageUp(int seconds);
|
2026-03-01 12:16:08 +08:00
|
|
|
virtual void setAge(int age);
|
|
|
|
|
virtual void addAdditonalSaveData(CompoundTag *tag);
|
|
|
|
|
virtual void readAdditionalSaveData(CompoundTag *tag);
|
|
|
|
|
virtual void aiStep();
|
|
|
|
|
virtual bool isBaby();
|
|
|
|
|
virtual void updateSize(bool isBaby);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void setSize(float w, float h);
|
|
|
|
|
void internalSetSize(float scale);
|
|
|
|
|
};
|