-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCharacter.hpp
52 lines (39 loc) · 1.38 KB
/
Character.hpp
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
#pragma once
#include <string>
#include <vector>
#include "./ElementalAttribute.hpp"
#include "./AttackMethod.hpp"
class Character {
protected:
std::string name;
ElementalAttribute elementalAttribute;
int hp, maxhp, atk, def, spd;
int level;
int maxLevel = 100;
std::vector<AttackMethod> attackMethod;
AttackMethod selectedAttackMethod;
private:
double calcDamageMagnification(Character& attacker);
std::string colorHp();
public:
Character() {};
Character(std::string name, ElementalAttribute element, int maxhp, int atk, int def, int spd);
virtual ~Character() {};
void showStatus();
virtual void attack() = 0;
virtual void damagedBy(Character& attacker);
virtual void damagedMessage(int const damagePoint) {};
void dead();
virtual void deadMessage() {};
// getter, setter
std::string getName() { return name; }
ElementalAttribute getElementalAttribute() { return elementalAttribute; }
int getHp() { return hp; }
int getAtk() { return atk; }
int getDef() { return def; }
int getSpd() { return spd; }
int getLevel() { return level; }
bool isAlive() { return hp != 0; }
std::vector<AttackMethod> getAttackMethod();
AttackMethod getSelectedAttackMethod();
};