summaryrefslogtreecommitdiffstats
path: root/src/Entities/EntityEffects.h
blob: 26d2c92e5df6fc27b95d26edfa58da5ca56a9067 (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#pragma once

class cPawn;

// tolua_begin
class cEntityEffect {
public:
	
	/** All types of entity effects (numbers correspond to IDs) */
	enum eType
	{
		effNoEffect       = 0,
		effSpeed          = 1,
		effSlowness       = 2,
		effHaste          = 3,
		effMiningFatigue  = 4,
		effStrength       = 5,
		effInstantHealth  = 6,
		effInstantDamage  = 7,
		effJumpBoost      = 8,
		effNausea         = 9,
		effRegeneration   = 10,
		effResistance     = 11,
		effFireResistance = 12,
		effWaterBreathing = 13,
		effInvisibility   = 14,
		effBlindness      = 15,
		effNightVision    = 16,
		effHunger         = 17,
		effWeakness       = 18,
		effPoison         = 19,
		effWither         = 20,
		effHealthBoost    = 21,
		effAbsorption     = 22,
		effSaturation     = 23,
	} ;
	
	/** The duration of the effect */
	int m_Ticks;
	
	/** Returns how strong the effect will be applied */
	short GetIntensity() { return m_Intensity; }
	
	/** Returns the pawn that used this entity effect */
	cPawn *GetUser() { return m_User; }
	
	/** Returns the distance modifier for affecting potency */
	double GetDistanceModifier() { return m_DistanceModifier; }
	
	void SetIntensity(short a_Intensity)                { m_Intensity        = a_Intensity;        }
	void SetUser(cPawn *a_User)                         { m_User             = a_User;             }
	void SetDistanceModifier(double a_DistanceModifier) { m_DistanceModifier = a_DistanceModifier; }
	
	/**
	 *  An empty entity effect
	 */
	cEntityEffect();
	
	/**
	 *  An entity effect
	 *  @param a_Ticks            The duration of the effect
	 *  @param a_Intensity        How strong the effect will be applied
	 *  @param a_User             The pawn that used this entity effect
	 *  @param a_DistanceModifier The distance modifier for affecting potency, defaults to 1
	 */
	cEntityEffect(int a_Ticks, short a_Intensity, cPawn *a_User, double a_DistanceModifier = 1);
	
private:
	/** How strong the effect will be applied */
	short m_Intensity;
	
	/** The pawn that used this entity effect */
	cPawn *m_User;
	
	/** The distance modifier for affecting potency */
	double m_DistanceModifier;
};
// tolua_end