aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Creeper.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/Creeper.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/Creeper.h')
-rw-r--r--Minecraft.World/Creeper.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/Minecraft.World/Creeper.h b/Minecraft.World/Creeper.h
new file mode 100644
index 00000000..a5da0e10
--- /dev/null
+++ b/Minecraft.World/Creeper.h
@@ -0,0 +1,59 @@
+#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 swell;
+ int oldSwell;
+
+ static const int MAX_SWELL = 30;
+
+ void _init();
+
+public:
+ Creeper(Level *level);
+
+ virtual bool useNewAi();
+ virtual int getMaxHealth();
+
+protected:
+ 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) ;
+};