-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpace22.cpp
137 lines (116 loc) · 2.83 KB
/
Space22.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* Program Name: Sword Quest
Author: Centaurus Team 1
Date: October 9, 2018
Description: Space 22 of 25 in the game
*/
#include "Space22.hpp"
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <stdio.h>
using namespace std;
Space22::Space22()
{
name = "volcano lvl. 2";
shortForm = "An old man sits in the middle of the path\n\n"
"The trail to the east continues up the volcano, the path slowly narrowing as it approaches Volcano Lvl. 3 \n"
"The path to the west dissapates behind you into an ominous fog. There is no turning back \n";
longForm = "The path continues upward. You can start to feel heat coming off the mountain. \n"
"An old man sits in the middle of the path \n\n"
"The trail to the east continues up the volcano, the path slowly narrowing as it approaches Volcano Lvl. 3 \n"
"The path to the west dissapates behind you into an ominous fog. There is no turning back \n";
id = 22;
obj = NULL;
combatEncounter = false;
visited = false;
answered = false;
correct = false;
}
Space22::~Space22()
{}
void Space22::look(const char* thing)
{
if (strcmp(thing, "old man") == 0)
{
cout << "He is clothed in rags. The old man is also bald with a long white beard. Why he" << endl;
cout << "is sitting cross legged in the middle of the path you have no idea" << endl;
}
if (strcmp(thing, "mountian") == 0 || strcmp(thing, "volcano") == 0)
{
cout << "With the heat you are feeling, it is becoming much more apparent that you are infact on a volcano \n" << endl;
cout << "but there is no turning back now. You must push on \n\n" << endl;
}
else
{
cout << "You can't do that" << endl;
}
}
void Space22::talk(const char* thing)
{
if (strcmp(thing, "to old man") == 0)
{
if(!answered)
{
cout <<"The old man speaks:" << endl;
cout <<"'The more of me you take, the more of me you leave behind. What am I?'" << endl;
}
else
{
if (!correct)
{
cout << "The old man silently frowns at you" << endl;
}
else
{
cout << "The old man silently smiles at you" << endl;
}
}
}
else
{
cout << "You can't do that" << endl;
}
}
void Space22::answer(const char* thing)
{
if (strcmp(thing, "footsteps") == 0)
{
if(!answered)
{
cout <<"The old man smiles, and snaps his fingers. You feel warmness come over your body" << endl;
answered = true;
correct = true;
}
else
{
if (!correct)
{
cout << "The old man silently frowns at you" << endl;
}
else
{
cout << "The old man silently smiles at you" << endl;
}
}
}
else
{
if (!answered)
{
cout << "The old man shakes his head" << endl;
answered = true;
}
else
{
if (!correct)
{
cout << "The old man silently frowns at you" << endl;
}
else
{
cout << "The old man silently smiles at you" << endl;
}
}
}
}