-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpace8.cpp
90 lines (81 loc) · 2.12 KB
/
Space8.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
83
84
85
86
87
88
89
90
/* Program Name: Sword Quest
Author: Centaurus Team 1
Date: October 9, 2018
Description: Space 8 of 25 in the game
*/
#include "Space8.hpp"
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <stdio.h>
using namespace std;
Space8::Space8()
{
name = "guard quarters";
shortForm = "There are papers strewn across the desk. There are a collection of lockers along the west wall\n\n"
"To the north is a door labeled 'Sewers' \n"
"To the east is a door labeled Maintenance \n"
"To the south is a pair of stairs leading up to the Sanctuary\n";
longForm = "You find an office of some sort, moldy from the dampness that hangs in the air. \n"
"There are papers strewn across the desk. There are a collection of lockers along the west wall \n\n"
"To the north is a door labeled 'Sewers' \n"
"To the east is a door labeled Maintenance \n"
"To the south is a pair of stairs leading up to the Sanctuary\n";
id = 8;
obj = new Two_Handed_Bronze_Sword();
combatEncounter = false;
visited = false;
swordFound = false;
taken = false;
}
Space8::~Space8()
{
if (obj != NULL)
{
delete obj;
}
}
void Space8::look(const char* thing)
{
if (strcmp(thing, "papers") == 0 || strcmp(thing, "desk") == 0)
{
cout << "The papers strewn across the desk seem to be schedules for the guards," << endl;
cout << "albeit very very old ones. It seems recently that there was only" << endl;
cout << "one guard that was off duty. Bob - locker 13" << endl;
}
else if (strcmp(thing, "lockers" ) == 0)
{
cout << "A large number of small lockers. Around 30. Luckily they don't have locks!" << endl;
}
else
{
cout << "You can't do that" << endl;
}
}
void Space8::search(const char* thing)
{
if (strcmp(thing, "lockers") == 0)
{
cout << "But which locker do you want to search?" << endl;
}
else if (strcmp(thing, "locker 1") == 0)
{
cout << "Nothing here" << endl;
}
else if (strcmp(thing, "locker 13") == 0)
{
if (taken == false) {
cout << "You find a bronze sword" << endl;
swordFound = true;
}
else
{
cout << "Nothing here" << endl;
}
}
else
{
cout << "You can't do that" << endl;
}
}