From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/ControlledByPlayerGoal.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Minecraft.World/ControlledByPlayerGoal.h (limited to 'Minecraft.World/ControlledByPlayerGoal.h') diff --git a/Minecraft.World/ControlledByPlayerGoal.h b/Minecraft.World/ControlledByPlayerGoal.h new file mode 100644 index 00000000..f49eaaf1 --- /dev/null +++ b/Minecraft.World/ControlledByPlayerGoal.h @@ -0,0 +1,32 @@ +#pragma once + +#include "Goal.h" +#include "..\Minecraft.World\SharedConstants.h" + +class Mob; + +class ControlledByPlayerGoal : public Goal +{ +private: + static const int MIN_BOOST_TIME = SharedConstants::TICKS_PER_SECOND * 7; + static const int MAX_BOOST_TIME = SharedConstants::TICKS_PER_SECOND * 35; + + Mob *mob; // Owner of this goal + float maxSpeed; + float walkSpeed; + float speed; + bool boosting; + int boostTime; + int boostTimeTotal; + +public: + ControlledByPlayerGoal(Mob *mob, float maxSpeed, float walkSpeed); // 4J Added walkSpeed param + + void start(); + void stop(); + bool canUse(); + void tick(); + bool isBoosting(); + void boost(); + bool canBoost(); +}; \ No newline at end of file -- cgit v1.2.3