-
Notifications
You must be signed in to change notification settings - Fork 0
/
enemy.h
65 lines (40 loc) · 1.03 KB
/
enemy.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
#ifndef __ENEMY_H__
#define __ENEMY_H__
#include "character.h"
#include "player.h"
class Shade;
class Drow;
class Vampire;
class Goblin;
class Troll;
class Ghost;
class Subject;
class Enemy : public Character, public Observer {
protected:
bool nearPlayer;
public:
Enemy(int maxhp, int hp, int att, int def, Posn p, char icon);
SubscriptionType getSubType() const override;
void notify(Subject *whoNotified) override;
char getType() const override;
bool isNearPlayer() const;
void setNearPlayer(bool b);
virtual bool isHostile() const;
virtual ~Enemy() = default;
virtual void checkEnemyDead(Player *killer);
virtual int attack(Player *player) = 0;
virtual int attackedBy(Shade *e);
virtual int attackedBy(Drow *e);
virtual int attackedBy(Goblin *e);
virtual int attackedBy(Vampire *e);
virtual int attackedBy(Troll *e);
virtual int attackedBy(Ghost *e);
};
#include "elf.h"
#include "merchant.h"
#include "halfling.h"
#include "dragon.h"
#include "human.h"
#include "dwarf.h"
#include "orc.h"
#endif