-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprops.cpp
More file actions
38 lines (37 loc) · 936 Bytes
/
Copy pathprops.cpp
File metadata and controls
38 lines (37 loc) · 936 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
#include "props.h"
#include"room.h"
#include"object.h"
#include"player.h"
using namespace std;
props::props(string nam,string des,string ke,object* hidden,bool stat,room* cur)
{
name=nam;
desc=des;
key=ke;
hidden_value=hidden;
state=stat;
cur->cur_props.push_back(this);
}
props::props(string nam ,string des,string ke ,object* hidden,bool stat)
{
name=nam;
desc=des;
key=ke;
hidden_value=hidden;
state=stat;
}
bool props::act(agent* mons,bool flag)
{
if(name==mons->getweapontokill())
{
cout<<"You can kill "<<mons->getname()<<" by typing it's lethal weapon name ( "<<mons->getweapontokill()<<" ). But be be careful you have only one chance."<<endl;
string str;
cin>>str;
if(str==name)
{
cout<<mons->getname()<<" is dead !"<<endl;
return true;
}
}
return false;
}