aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/WitherBoss.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/WitherBoss.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/WitherBoss.h')
-rw-r--r--Minecraft.World/WitherBoss.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/Minecraft.World/WitherBoss.h b/Minecraft.World/WitherBoss.h
new file mode 100644
index 00000000..47e2dff1
--- /dev/null
+++ b/Minecraft.World/WitherBoss.h
@@ -0,0 +1,109 @@
+#pragma once
+
+#include "Monster.h"
+#include "RangedAttackMob.h"
+#include "BossMob.h"
+
+class LivingEntitySelector : public EntitySelector
+{
+public:
+ virtual bool matches(shared_ptr<Entity> entity) const;
+};
+
+class WitherBoss : public Monster, public RangedAttackMob, public BossMob
+{
+public:
+ eINSTANCEOF GetType() { return eTYPE_WITHERBOSS; };
+ static Entity *create(Level *level) { return new WitherBoss(level); }
+
+private:
+ static const int DATA_TARGET_A = 17;
+ static const int DATA_TARGET_B = 18;
+ static const int DATA_TARGET_C = 19;
+ static const int DATA_ID_INV = 20;
+
+private:
+ static const int IDLE_HEAD_UPDATES_SIZE = 2;
+ float xRotHeads[2];
+ float yRotHeads[2];
+ float xRotOHeads[2];
+ float yRotOHeads[2];
+ int nextHeadUpdate[2];
+ int idleHeadUpdates[IDLE_HEAD_UPDATES_SIZE];
+ int destroyBlocksTick;
+
+ static EntitySelector *livingEntitySelector;
+
+public:
+ WitherBoss(Level *level);
+
+protected:
+ virtual void defineSynchedData();
+
+public:
+ virtual void addAdditonalSaveData(CompoundTag *entityTag);
+ virtual void readAdditionalSaveData(CompoundTag *tag);
+ virtual float getShadowHeightOffs();
+
+protected:
+ virtual int getAmbientSound();
+ virtual int getHurtSound();
+ virtual int getDeathSound();
+
+public:
+ virtual void aiStep();
+
+protected:
+ virtual void newServerAiStep();
+
+public:
+ virtual void makeInvulnerable();
+ virtual void makeStuckInWeb();
+ virtual int getArmorValue();
+
+private:
+ virtual double getHeadX(int index);
+ virtual double getHeadY(int index);
+ virtual double getHeadZ(int index);
+ virtual float rotlerp(float a, float b, float max);
+ virtual void performRangedAttack(int head, shared_ptr<LivingEntity> target);
+ virtual void performRangedAttack(int head, double tx, double ty, double tz, bool dangerous);
+
+public:
+ virtual void performRangedAttack(shared_ptr<LivingEntity> target, float power);
+ virtual bool hurt(DamageSource *source, float dmg);
+
+protected:
+ virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
+ virtual void checkDespawn();
+
+public:
+ virtual int getLightColor(float a);
+ virtual bool isPickable();
+
+protected:
+ virtual void causeFallDamage(float distance);
+
+public:
+ virtual void addEffect(MobEffectInstance *newEffect);
+
+protected:
+ virtual bool useNewAi();
+ virtual void registerAttributes();
+
+public:
+ virtual float getHeadYRot(int i);
+ virtual float getHeadXRot(int i);
+ virtual int getInvulnerableTicks();
+ virtual void setInvulnerableTicks(int invulnerableTicks);
+ virtual int getAlternativeTarget(int headIndex);
+ virtual void setAlternativeTarget(int headIndex, int entityId);
+ virtual bool isPowered();
+ virtual MobType getMobType();
+ virtual void ride(shared_ptr<Entity> e);
+
+ // 4J Stu - These are required for the BossMob interface
+ virtual float getMaxHealth() { return Monster::getMaxHealth(); };
+ virtual float getHealth() { return Monster::getHealth(); };
+ virtual wstring getAName() { return app.GetString(IDS_WITHER); };
+}; \ No newline at end of file