-
Notifications
You must be signed in to change notification settings - Fork 0
/
8.cpp
63 lines (60 loc) · 824 Bytes
/
8.cpp
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
#include <iostream>
using namespace std;
class Bot {
public:
double HP, MP, energy, attack;
void getHP() {
cout << HP << endl;
}
};
class upLVL {
public:
int power;
};
class Human : public Bot {
public:
Human () {
HP = 1000;
MP = 10;
energy = 10;
attack = 20;
}
};
class Elf : public Bot {
protected:
int speed;
public:
Elf() {
HP = 20;
MP = 10;
energy = 50;
attack = 10;
speed = 30;
}
void kick (Human &p) {
p.HP -= attack*1.2*speed*energy*0.005;
}
};
class BotMax : public upLVL, public Bot {
public:
BotMax () {
HP = 1000;
MP = 10;
energy = 10;
attack = 20;
power = 10;
}
void kick (Elf &p) {
p.HP -= attack*1.2*power*energy*0.005;
}
};
int main () {
Human Jorj;
Elf Patrick;
BotMax Volodya;
Volodya.kick(Patrick);
Patrick.kick(Jorj);
Jorj.getHP();
Patrick.getHP();
return 0;
}