-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmovimientos.cpp
93 lines (70 loc) · 2.37 KB
/
movimientos.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
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
#include "HeaderFiles/movimientos.h"
Movimiento::Movimiento(string nombre, int pp) : nombre(nombre), pp(pp) {}
string Movimiento::get_nombre() {
return nombre;
}
string Movimiento::get_clase() {
return clase;
}
//template <typename T> void Movimiento::movAtaque(T &jugador) {}
//template <typename T> void Movimiento::movStatus(T &jugador) {}
int Movimiento::get_danio() {};
Tipo Movimiento::get_tipo() {};
string Movimiento::get_f_orE() {};
int Movimiento::get_mejoraAtaque() {};
int Movimiento::get_mejoraDefensaF() {};
int Movimiento::get_mejoraDefensaE() {};
int Movimiento::get_mejoraVelocidad() {};
int Movimiento::get_curaVida() {};
Ataque::Ataque(string nombre, int pp, int danio, Tipo tipo, string f_orE) : Movimiento(nombre, pp), danio(danio), tipo(tipo), f_orE(f_orE) {
clase = "ataque";
}
int Ataque::get_danio() {
return danio;
}
Tipo Ataque::get_tipo() {
return tipo;
}
string Ataque::get_f_orE() {
return f_orE;
}
template <typename T> void Ataque::movAtaque(T &jugador) {
double multiplicador = getMatrixValue(jugador.get_tipo(), get_tipo()) / 2.0;
if (get_f_orE() == "Fis") {
jugador.quitarVida(get_danio()*multiplicador*jugador.get_bonus() - jugador.get_defensaF());
} else if (get_f_orE() == "Esp") {
jugador.quitarVida(get_danio()*multiplicador*jugador.get_bonus() - jugador.get_defensaE());
}
jugador.restartBonus();
if (multiplicador == 2) {
cout << "Fue super efectivo!" << endl;
}
else if (multiplicador == 0.5) {
cout << "No fue tan efectivo..." << endl;
}
}
Status::Status(string nombre, int pp, double mejoraAtaque, int mejoraDefensaF, int mejoraDefensaE, int mejoraVelocidad, int curaVida) : Movimiento(nombre, pp), mejoraAtaque(mejoraAtaque), mejoraDefensaF(mejoraDefensaF), mejoraDefensaE(mejoraDefensaE), mejoraVelocidad(mejoraVelocidad), curaVida(curaVida) {
clase = "status";
}
template <typename T> void Status::movStatus(T &jugador) {
jugador.aumentarVida(curaVida);
jugador.aumentarVelocidad(mejoraVelocidad);
jugador.aumentarDefensaF(mejoraDefensaF);
jugador.aumentarDefensaE(mejoraDefensaE);
jugador.masBonus(mejoraAtaque);
}
int Status::get_mejoraAtaque () {
return mejoraAtaque;
}
int Status::get_mejoraDefensaF () {
return mejoraDefensaF;
}
int Status::get_mejoraDefensaE () {
return mejoraDefensaE;
}
int Status::get_mejoraVelocidad () {
return mejoraVelocidad;
}
int Status::get_curaVida () {
return curaVida;
}