aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/EnderDragon.h
diff options
context:
space:
mode:
authordaoge <3523206925@qq.com>2026-03-03 03:04:10 +0800
committerGitHub <noreply@github.com>2026-03-03 03:04:10 +0800
commitb3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch)
tree267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.World/EnderDragon.h
parent84c31a2331f7a0ec85b9d438992e244f60e5020f (diff)
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.World/EnderDragon.h')
-rw-r--r--Minecraft.World/EnderDragon.h48
1 files changed, 30 insertions, 18 deletions
diff --git a/Minecraft.World/EnderDragon.h b/Minecraft.World/EnderDragon.h
index 8a12c08c..a13ecaa2 100644
--- a/Minecraft.World/EnderDragon.h
+++ b/Minecraft.World/EnderDragon.h
@@ -1,22 +1,22 @@
#pragma once
using namespace std;
#include "BossMob.h"
+#include "MultiEntityMob.h"
+#include "Enemy.h"
-class BossMobPart;
+class MultiEntityMobPart;
class EnderCrystal;
class Node;
class BinaryHeap;
class Path;
-class EnderDragon : public BossMob
+class EnderDragon : public Mob, public BossMob, public MultiEntityMob, public Enemy
{
public:
eINSTANCEOF GetType() { return eTYPE_ENDERDRAGON; };
static Entity *create(Level *level) { return new EnderDragon(level); }
-private:
- static const int DATA_ID_SYNCHED_HEALTH = 16;
-
+private:
// 4J Added for new behaviours
static const int DATA_ID_SYNCHED_ACTION = 17;
@@ -27,16 +27,16 @@ public:
double positions[positionsLength][3];
int posPointer;
- //BossMobPart[] subEntities;
+ //MultiEntityMobPart[] subEntities;
vector<shared_ptr<Entity> > subEntities;
- shared_ptr<BossMobPart> head;
- shared_ptr<BossMobPart> neck; // 4J Added
- shared_ptr<BossMobPart> body;
- shared_ptr<BossMobPart> tail1;
- shared_ptr<BossMobPart> tail2;
- shared_ptr<BossMobPart> tail3;
- shared_ptr<BossMobPart> wing1;
- shared_ptr<BossMobPart> wing2;
+ shared_ptr<MultiEntityMobPart> head;
+ shared_ptr<MultiEntityMobPart> neck; // 4J Added
+ shared_ptr<MultiEntityMobPart> body;
+ shared_ptr<MultiEntityMobPart> tail1;
+ shared_ptr<MultiEntityMobPart> tail2;
+ shared_ptr<MultiEntityMobPart> tail3;
+ shared_ptr<MultiEntityMobPart> wing1;
+ shared_ptr<MultiEntityMobPart> wing2;
float oFlapTime;
float flapTime;
@@ -112,9 +112,11 @@ private:
public:
EnderDragon(Level *level);
+ void AddParts();
virtual ~EnderDragon();
protected:
+ virtual void registerAttributes();
virtual void defineSynchedData();
public:
@@ -122,7 +124,7 @@ public:
virtual void aiStep();
private:
- using BossMob::hurt;
+ using MultiEntityMob::hurt;
void checkCrystals();
void checkAttack();
@@ -133,9 +135,11 @@ private:
bool checkWalls(AABB *bb);
public:
- virtual bool hurt(shared_ptr<BossMobPart> bossMobPart, DamageSource *source, int damage);
+ virtual bool hurt(shared_ptr<MultiEntityMobPart> MultiEntityMobPart, DamageSource *source, float damage);
+ virtual bool hurt(DamageSource *source, float damage);
protected:
+ virtual bool reallyHurt(DamageSource *source, float damage);
virtual void tickDeath();
private:
@@ -143,11 +147,15 @@ private:
protected:
virtual void checkDespawn();
- virtual int getHurtSound();
public:
virtual vector<shared_ptr<Entity> > *getSubEntities();
virtual bool isPickable();
- virtual int getSynchedHealth();
+ Level *getLevel();
+
+protected:
+ int getAmbientSound();
+ int getHurtSound();
+ float getSoundVolume();
private:
// 4J added for new dragon behaviour
@@ -174,4 +182,8 @@ public:
double getHeadPartYOffset(int partIndex, doubleArray bodyPos, doubleArray partPos);
double getHeadPartYRotDiff(int partIndex, doubleArray bodyPos, doubleArray partPos);
Vec3 *getHeadLookVector(float a);
+
+ virtual wstring getAName() { return app.GetString(IDS_ENDERDRAGON); };
+ virtual float getHealth() { return LivingEntity::getHealth(); };
+ virtual float getMaxHealth() { return LivingEntity::getMaxHealth(); };
};