-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathavatar.cpp
More file actions
49 lines (42 loc) · 948 Bytes
/
avatar.cpp
File metadata and controls
49 lines (42 loc) · 948 Bytes
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
#include "avatar.h"
Avatar::Avatar(string _tipoAvatar){
tipoAvatar = _tipoAvatar;
if(tipoAvatar == "luchador"){
Poder = .7;
Mana = .6;
Vida = 4;
}else if(tipoAvatar == "tirador"){
Poder = 1;
Mana = .3;
Vida = 3;
}else if(tipoAvatar == "mago"){
Poder = .2;
Mana = 1;
Vida = 5;
}
}
/*!< Dara las caracteristicas iniciales dependiendo al tipo de avatar */
void Avatar::setVida(float _Vida){
Vida = _Vida;
}
/*!< Modifca la vida del avatar */
void Avatar::restarVida(float _DaNo){
Vida -= _DaNo;
}
/*!< Resta el daño recibido a la vida del avatar */
string Avatar::getTipo(){
return tipoAvatar;
}
/*!< Para obtener el tipo de avatar */
float Avatar::getPoder(){
return Poder;
}
/*!< Para obtener el poder del avatar */
float Avatar::getMana(){
return Mana;
}
/*!< Para obtener el mana del avatar */
float Avatar::getVida(){
return Vida;
}
/*!< Para obtener la vida actual del avatar */