-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKnight.cs
More file actions
38 lines (34 loc) · 1.23 KB
/
Knight.cs
File metadata and controls
38 lines (34 loc) · 1.23 KB
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
using System;
namespace RPG
{
public class Knight : Hero
{
Random random = new Random();
public Knight()
: base()
{
typeClass = "Рыцарь";
skills = new string[]{"Удар возмездия", "Удар возмездия", "Удар возмездия", "Удар с размаху", "Удар с размаху", "Раскол земли"};
}
public override void Skill(out string skillName, out int damage)
{
skillName = skills[(int)Math.Floor(random.NextDouble()*skills.Length)]; // Взвешенная вероятность
switch(skillName)
{
case "Удар возмездия":
damage = (int)Math.Floor(Strength * 1.5);
break;
case "Удар с размаху":
damage = (int)Math.Floor(Strength * 1.3);
break;
case "Раскол земли":
sleepTime = 3;
damage = (int)Math.Floor(Strength * 2.5);
break;
default:
damage = 0;
break;
}
}
}
}