aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MobEffectInstance.h
blob: bfecc612536aee206ed8c37bbb1f681207e4fd05 (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
38
39
40
41
42
#pragma once

class Mob;

class MobEffectInstance
{
private:
	// sent as byte
	int id;
	// sent as short
	int duration;
	// sent as byte
	int amplifier;

	void _init(int id, int duration, int amplifier);

public:
	MobEffectInstance(int id);
	MobEffectInstance(int id, int duration);
	MobEffectInstance(int id, int duration, int amplifier);
	MobEffectInstance(MobEffectInstance *copy);

	void update(MobEffectInstance *takeOver);
	int getId();
	int getDuration();
	int getAmplifier();
	bool tick(std::shared_ptr<Mob> target);

private:
	int tickDownDuration();

public:
	void applyEffect(std::shared_ptr<Mob> mob);
	int getDescriptionId();
	int getPostfixDescriptionId(); // 4J Added
	int hashCode();

	wstring toString();

	// Was bool equals(Object obj)
	bool equals(MobEffectInstance *obj);
};