Game now keeps track of deaths, rounds, streaks and other fun stuff. You can also die finally.
This commit is contained in:
parent
a13704fe33
commit
9a012813ae
5 changed files with 100 additions and 68 deletions
|
@ -8,6 +8,38 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
|
||||
class GameEngine {
|
||||
map<string, int> damage_types{
|
||||
{"error", 4},
|
||||
{"warning", 1},
|
||||
{"note", 1},
|
||||
};
|
||||
|
||||
public:
|
||||
int starting_hp = 0;
|
||||
int hit_points = 0;
|
||||
int hits_taken = 0;
|
||||
int rounds = 0;
|
||||
int streak = 0;
|
||||
|
||||
GameEngine(int hp);
|
||||
|
||||
int determine_damage(string &type);
|
||||
|
||||
void start_round();
|
||||
|
||||
void end_round();
|
||||
|
||||
bool hit(string &type);
|
||||
|
||||
bool is_dead();
|
||||
|
||||
void heal();
|
||||
|
||||
void reset();
|
||||
};
|
||||
|
||||
class Brainfucker {
|
||||
|
||||
public:
|
||||
|
@ -26,29 +58,3 @@ class Brainfucker {
|
|||
void jump_forward();
|
||||
string to_string();
|
||||
};
|
||||
|
||||
class GameEngine {
|
||||
map<string, int> damage_types{
|
||||
{"error", 4},
|
||||
{"warning", 1},
|
||||
{"note", 1},
|
||||
};
|
||||
|
||||
public:
|
||||
int hit_points = 0;
|
||||
int hits_taken = 0;
|
||||
|
||||
GameEngine(int hp);
|
||||
|
||||
int determine_damage(string &type);
|
||||
|
||||
void start_round();
|
||||
|
||||
void end_round();
|
||||
|
||||
bool hit(string &type);
|
||||
|
||||
bool is_dead();
|
||||
|
||||
void heal();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue