forked from Mici7120/code-legends
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathavatar.cpp
More file actions
70 lines (56 loc) · 1.07 KB
/
avatar.cpp
File metadata and controls
70 lines (56 loc) · 1.07 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "avatar.h"
/*
Avatar::Avatar(){
}
void Avatar::setTipo(string tipo){
Tipo = tipo;
if(tipo=="luchador"){
Poder = .7;
Mana = .6;
Vida = 4;
}else if(tipo=="tirador"){
Poder = 1;
Mana = .3;
Vida = 3;
}else if(tipo=="mago"){
Poder = .2;
Mana = 1;
Vida = 5;
}
} */
// Para modificar la vida
Avatar::Avatar(string tipo){
tipoAvatar = tipo;
if(tipoAvatar=="luchador"){
poder = 0.7;
mana = .6;
vida = 4;
}else if(tipoAvatar=="tirador"){
poder = 1.0;
mana = .3;
vida = 3;
}else if(tipoAvatar=="mago"){
poder = 0.2;
mana = 1;
vida = 5;
}
}
void Avatar::setVida(float nuevaVida){
vida=vida-nuevaVida;
}
//Para saber de que tipo es el avatar
string Avatar::getTipoAvatar(){
return tipoAvatar;
}
//Para obtener el poder del avatar dependiendo del tipo
float Avatar::getPoder(){
return poder;
}
//Para obtener el mana del avatar dependiendo del tipo
float Avatar::getMana(){
return mana;
}
//Para obtener el mana del avatar dependiendo del tipo
float Avatar::getVida(){
return vida;
}