-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonster.h
More file actions
46 lines (36 loc) · 898 Bytes
/
Monster.h
File metadata and controls
46 lines (36 loc) · 898 Bytes
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
#ifndef MONSTER_H
#define MONSTER_H
#include "json.hpp"
#include "types.h"
#include "Unit.h"
using json = nlohmann::json;
using namespace std;
class Monster : public Unit {
public:
Monster();
/*
* constructor for creating monsters from map JSONs
*/
Monster(json j);
/*
* manual constructor
*/
Monster(string name, int health, int speed, int stance, int attack, node_id_t location, DeathEffects effects);
/*
* Overridden methods from Unit
*/
bool is_player();
bool is_monster();
string get_string();
json to_json();
void attack(Unit* other);
/*
* overridden from Unit class -- brings the monster back to life if it is time for it to respawn
*/
void decrement_movement_counter();
private:
// health the monster regenerates to whenever it respawns
int _base_health;
int _attack;
};
#endif