-
Notifications
You must be signed in to change notification settings - Fork 0
/
EffectManager.cs
86 lines (75 loc) · 2.24 KB
/
EffectManager.cs
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
79
80
81
82
83
84
85
86
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RPG
{
class EffectManager
{
List<Effect> effectList = new List<Effect>();
public void LoadEffects()
{
#region Healing Effects
Effect smallHeal = new Effect(
1, //ID
2, //Type (1 - Attack | 2 - Heal)
100, //Heal Amount
0, //Damage Amount
"|| Restored 100 Health!" //UseText
);
effectList.Add(smallHeal);
//-----------------------------------
Effect mediumHeal = new Effect(
2, //ID
2, //Type (1 - Attack | 2 - Heal)
300, //Heal Amount
0, //Damage Amount
"|| Restored 300 Health!"
);
effectList.Add(mediumHeal);
//-----------------------------------
Effect highHeal = new Effect(
3, //ID
2, //Type (1 - Attack | 2 - Heal)
600, //Heal Amount
0, //Damage Amount
"|| Restored 600 Health!"
);
effectList.Add(highHeal);
//-----------------------------------
#endregion
}
public Effect GetEffect(int id)
{
Effect ef = new Effect();
for (int i = 0; i < effectList.Count; i++)
{
if (effectList[i].GetEffectID() == id)
{
ef = effectList[i];
}
}
return ef;
}
public int GetEffectType(int id)
{
Effect ef = new Effect();
for (int i = 0; i < effectList.Count; i++)
{
if (effectList[i].GetEffectID() == id)
{
ef = effectList[i];
}
}
return ef.GetEffectType();
}
public void UseHeal(int effectID, Player player)
{
if(GetEffectType(effectID) == 2)
{
player.AddHealth(GetEffect(effectID).GetHealAmount());
}
}
}
}