-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactors.h
95 lines (79 loc) · 1.87 KB
/
actors.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
#ifndef ACTORS_H
#define ACTORS_H
#include<vector>
#include<string>
#include<iostream>
#include<map>
namespace textAdventure{
class katana{
int strengthPoints = 10;
public:
katana(){}
int getStrength();
};
class Weapon{
int damagePoints = 0;
std::string weaponName;
public:
Weapon(const std::string& wName);
std::string useWeapon();
int getWeaponStrength();
std::string getName();
};
class healthPack{
int hpStrength = 0;
public:
healthPack(int hp);
int getHealthValue();
};
class inventory{
typedef std::map<std::string, Weapon*> WeaponsContainer;
typedef std::pair<std::string, Weapon*> MyPair;
WeaponsContainer weapons;
std::vector<healthPack*> healthPacks;
public:
void discardHealthPack(healthPack* hp);
void addHealthPack(healthPack* anHp);
void addWeapon(Weapon* aWeapon);
void displayWeapons();
void displayhealthPacks();
std::vector<healthPack*> getHealthPacks();
Weapon* selectWeapon(std::string weaponName);
};
class enemy{
std::string enemyName;
double battleRatio;
int currentHP;
int enemyStrength;
Weapon* enemyWeapon;
public:
enemy(const std::string& eName);
std::string getEnemyName();
int getEnemyStrength();
void setStrength(int battleRatio);
void setWeapon(Weapon* aWeapon);
int enemyWeaponStrength();
bool dead = false;
};
class mainActor{
std::string actorName;
int battleRatio = 0;
int currentHP = 100;
inventory* userInventory;
int effectivness;
public:
mainActor(const std::string& nName , inventory* startInventory);
std::string getActorName();
void destroyHP(healthPack* hp);
void setStrength(int battleRatio);
void changeHP(int hp);
int getActorHealth();
void pickUpHP(healthPack* hp);
void displayInventory();
void pickUpWeapon(Weapon* weapon);
void applyHealth();
Weapon* selectWeapon(std::string weaponName);
bool dead = false;
};
}
#endif