This repository was archived by the owner on Feb 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCharacter.h
100 lines (93 loc) · 2.25 KB
/
Character.h
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
94
95
96
97
98
99
100
//==============================================================================
// File name : Character.h
// Author : Jeffrey Thor
// Date : 10/12/2015
// Description : Character Class - Game of Legends
// Collaborators: David Thor
//==============================================================================
#ifndef CHARACTER_H
#define CHARACTER_H
#include <string>
#include <vector>
using namespace std;
class Character{
protected:
string name;
string characterType;
int experience;
int level;
int health;
int maxHealth;
int gold;
bool alive;
int criticalPoint;
int missPoint;
float damageMultiplier;
string specialAttackName;
std::vector<string> shopItems;
std::vector<int> shopPrices;
public:
//default constructor
Character();
//overload constructor
Character(string, string);
//destructor
~Character();
//get methods
string getName() const;
string getCharacterType() const;
int getExperience() const;
int getLevel() const;
int getHealth() const;
int getMaxHealth() const;
int getGold() const;
bool getAlive() const;
string getSpecialAttackName() const;
//set methods
void setStats(string, string, int, int, int, int, int, bool);
void setName(string);
void setCharacterType(string);
void setExperience(int);
void setLevel(int);
void setHealth(int);
void setMaxHealth(int);
void setGold(int);
void setAlive(bool);
//saves the player stats
void saveState(const string SAVES);
//prints the player stats
void printStats();
//prints the players attack options
void printAttacks();
//executes the players primary attack
int primaryAttack();
//characters special attack
virtual int specialAttack();
//adds item to inventory
void addItem(string item);
//uses an item from the inventory
void useItem(string item, int position);
//displays the inventory
void inventory();
//items vector
std::vector<string> items;
};
//Warrior subclass.
class Warrior: public Character{
public:
Warrior(string name, string characterType);
int specialAttack();
};
//Wizard sublcass.
class Wizard: public Character{
public:
Wizard(string name, string characterType);
int specialAttack();
};
//Looter subclass.
class Looter: public Character{
public:
Looter(string name, string characterType);
int specialAttack();
};
#endif //CHARACTER_H