-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreature.cpp
82 lines (68 loc) · 1.87 KB
/
Creature.cpp
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
#include "Creature.h"
Creature::Creature() : hp(0), hpm(0), da(0), ha(0)
{
da.resize(0);
ha.resize(0);
}
void Creature::setHp(int h) {
hp = h;
//std::cout << "HP: " << std::to_string(hp) << std::endl;
//std::cout << "Creature::setHp" << std::endl;
}
void Creature::setHpMoves(int hpm) {
hpm = hpm;
//std::cout << "Creature::setHpMoves" << std::endl;
//std::cout << "HPMoves: " << std::to_string(hpm) << std::endl;
}
void Creature::setDeathAction(std::shared_ptr<CreatureAction> _da) {
//da.resize(da.size() + 1);
da.push_back(_da);
//std::cout << "Creature::setDeathAction" << std::endl;
}
void Creature::setHitAction(std::shared_ptr<CreatureAction> _ha) {
//ha.resize(ha.size() + 1);
ha.push_back(_ha);
//std::cout << "Creature::setHitAction" << std::endl;
}
void Creature::setName(std::string _name)
{
name = _name;
}
std::string Creature::getName()
{
return name;
}
Player::Player() : sword(0),armor(0), room(0), serial(0) {
//std::cout << "Player Constructor" << std::endl;
setName("Player");
}
void Player::setWeapon(std::shared_ptr<Item> _sword) {
sword = _sword;
//std::cout << "Player::setWeapon" << std::endl;
}
void Player::setArmor(std::shared_ptr<Item> _armor) {
armor = _armor;
//std::cout << "Player::setWeapon" << std::endl;
}
void Player::setID(int _room, int _serial) {
room = _room;
serial = _serial;
//std::cout << "Player::setID" << std::endl;
}
Monster::Monster()
{
room = 0;
serial = 0;
std::cout << "Monster Constructor" << std::endl;
}
//Make this a virtual base function so we can differentiate between monster and troll
/*void Monster::setName(std::string _name) {
name = _name;
//std::cout << "Monster::setName" << std::endl;
//std::cout << "Name: " << name << std::endl;
}*/
void Monster::setID(int _room, int _serial)
{
room = _room;
serial = _serial;
}