/
hero.cs
149 lines (135 loc) · 3.8 KB
/
hero.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
namespace Bureck___The_Game
{
public partial class MainWindow
{
//======================================================================================KLASA HERO=================================================================================
class hero
{
protected string name;
protected int str;
protected int mbl;
protected int wis;
protected int hp;
protected int armor;
protected int xp;
public hero()
{
name = "Ty";
str = 1;
mbl = 1;
wis = 1;
hp = 50;
armor = 0;
xp = -10;
}
public int Xp
{
get { return xp; }
set { xp = value; }
}
public int Hp
{
get { return hp; }
set { hp = value; }
}
public int Str
{
get { return str; }
set { str = value; }
}
public int Mbl
{
get { return mbl; }
set { mbl = value; }
}
public int Wis
{
get { return wis; }
set { wis = value; }
}
public int Armor
{
get { return armor; }
set { armor = value; }
}
public string Name
{
get { return name; }
}
public void enemy(details details)
{
this.name = details.name;
this.str = details.str;
this.mbl = details.mbl;
this.wis = details.wis;
this.hp = details.hp;
this.armor = details.armor;
this.xp = details.xp;
}
public void lvlup(int x)
{
switch (x)
{
case 1:
str += 1;
break;
case 2:
mbl += 1;
break;
case 3:
wis += 1;
break;
case 4:
hp += 1;
break;
}
}
public int retstat(int x)
{
int y;
switch (x)
{
case 1:
y = str;
break;
case 2:
y = mbl;
break;
case 3:
y = wis;
break;
case 4:
y = hp;
break;
case 5:
y = armor;
break;
default:
y = 0;
break;
}
return y;
}
public class details
{
public string name;
public int str;
public int mbl;
public int wis;
public int hp;
public int armor;
public int xp;
public details(string name, int str, int mbl, int wis, int hp, int armor, int xp)
{
this.name = name;
this.str = str;
this.mbl = mbl;
this.wis = wis;
this.hp = hp;
this.armor = armor;
this.xp = xp;
}
}
}
}
}