-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArtifact.cpp
More file actions
46 lines (38 loc) · 850 Bytes
/
Copy pathArtifact.cpp
File metadata and controls
46 lines (38 loc) · 850 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
#include "header/Artifact.hpp"
int rarity;
int lifepoints; // amount of lifepoints given
// constructor
Artifact ::Artifact()
{
rarity = 0;
lifepoints = 0;
tag = 111;
position.y = 0;
position.x = 0;
}
// constructor
Artifact ::Artifact(int rarity, int lifepoints, int posy, int posx, chtype tag) : Entity(position.y, position.x, tag)
{
this->lifepoints = lifepoints;
this->rarity = rarity;
this->position.y = posy;
this->position.x = posx;
this->tag = ' ';
}
// returns lifepoints
int Artifact ::getLifepoints()
{
return this->lifepoints;
}
//return rarity
int Artifact::getRarity(){
return this->rarity;
}
//set lifepoints within {1,3,5,7}
void Artifact::setLifepoints(int life){
this->lifepoints=life;
}
//set rarity from 1 to 4
void Artifact::setRarity(int rar){
this->rarity=rar;
}