aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ControlledByPlayerGoal.h
blob: 25bd579c53524cac7855062d9c2b69b68510e808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#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();

private:
	bool isNoJumpTile(int tile);

public:
	bool isBoosting();
	void boost();
	bool canBoost();
};