-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWizard.cs
More file actions
55 lines (50 loc) · 1.43 KB
/
Wizard.cs
File metadata and controls
55 lines (50 loc) · 1.43 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
namespace RPG
{
public class Wizard : Hero
{
Random random = new Random();
public Wizard()
: base()
{
typeClass = "Маг";
skills = new string[]{"Заворожение", "Метеор", "Столб огня"};
}
public override void Atack(out int damage)
{
damage = random.Next(1, Strength / 2);
}
public override void Skill(out string skillName, out int damage)
{
int probability = random.Next(0, 100);
if(probability <= 40 && sleepTime == 0)
{
skillName = "Заворожение";
}
else if(probability <= 80)
{
skillName = "Столб огня";
}
else
{
skillName = "Метеор";
}
switch(skillName)
{
case "Заворожение":
sleepTime = 2;
damage = 0;
break;
case "Метеор":
damage = (int)Math.Floor(Strength * 2.5);
break;
case "Столб огня":
damage = (int)Math.Floor(Strength * 1.8);
break;
default:
damage = 0;
break;
}
}
}
}