Code for Text-Based Adventure Game:
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
using namespace std;
// Classes
class object {
public:
string name;
string inv_desc;
string env_desc;
int location;
};
class locs {
public:
string name;
string look_desc;
int location;
};
class puzzle {
public:
string name;
bool completed;
};
// Function Declarations
vector<object> get(string a, int b, vector<object> c);
vector<object> drop(string a, int b, vector<object> c);
void look(string a, int b, vector<object> c);
int go(int a, string b, vector<locs> c, vector<puzzle> d, vector<object> e);
void check(string a, vector<object> b);
vector<puzzle> red_room(vector<puzzle> a);
vector<object> red_outcome(vector<object> a, vector<puzzle> b);
vector<puzzle> blue_room(vector<puzzle> a);
vector<object> blue_outcome(vector<object> a, vector<puzzle> b);
vector<puzzle> puzzle_update(vector<puzzle> a, vector<object> b);
vector<puzzle> give(string a, vector<object> b, string c, vector<puzzle> d);
// Variables
string player;
int char_loc = 0;
bool error_message = false;
vector<object> items = {
{"rock", "The rock rests at the bottom of your bag.",
"The rock is slightly larger than your hand.", 0},
{"large mushroom", "The large mushroom rests at the bottom of your bag.",
"The mushroom is dark blue with white spots. How strange!", 2},
{"red orb","The red orb casts a glow on all its surroundings.",
"Red light dances across the surface of the perfect sphere",-2},
{"blue orb","The blue orb glows quietly in the dark. What power could it possess?",
"Blue light dances across the surface of the magic device.",-2}
};
vector<locs> all_locs = {
{"The Gray Field", "You are in a foggy field with knee high grass in all directions.\nThere is a hill to the north with a smoldering tree on top of it.\n>",
0},
{"Scorched Hill",
"You approach the smoldering tree. You wonder how it could have even\ncaught on fire in the first place. There were no storms last night but\nthe entire hill appears badly burned. There is a large hole\nat the base of the tree. Loose tree roots surround the hole. Upon\ncloser examination you can hear someone calling out from inside!\n>",
1},
{"The Hall of Roots",
"You betray your better judgment, get on your hands and knees, and \ncrawl into the hole. It is very dark. You hold your hand in front \nof your face and see nothing. Something, presumably tree roots, \nscrapes your arms and neck. Finally, some light. You see a large \nmushroom where the dirt tunnel meets the top of a marble ledge. \nBeyond here is a steep drop into a large extravagant room. \n>",
2},
{"The Dining Hall",
"You drop down from the ledge and fall over. After getting off the\nground you step forward onto the marble tiles. This room has high\nvaulted ceilings with stained glass windows. Some of the panes are\nbroken with mounds of dirt below them from outside. There is a large\ndoor to your left, another on your right, and one in front of you at\nthe far end of the room. There is a long table in the center of the\nroom. Several glass lanterns hang from the ceiling.\n>",
3},
{"The Red Room" ,
"You open the large door on the left side of the dining hall and \nenter a small dark room. There are small lanterns gleaming through \nred stained glass. Who keeps all these lanterns burning? In the \ncorner of the room there is a gold ruby encrusted altar with three \nlevers.\n>",
4},
{"The Blue Room" ,
"You open the large door on the right side of the dining hall and \nenter a small dark room. There are small lanterns gleaming through \nblue stained glass. The light of the lanterns reflects off of \nthe floor which is entirely covered by a shallow layer of water. In\nthe corner of the room there is a silver saphire encrusted altar with\nthree levers.\n>",
5},
{"The Green Room",
"The orbs glow brightly in your bag as you open the moss covered door at\nthe far end of the room. Inside many mushrooms glow bright green.\nYou notice a foul odor as the door slams shut behind you.\nTurning around you make eye contact with a tall creature covered \nin mold. The fungal beast lets out a low gurgling noise as it staggers\ntoward you.\n>",
6}
};
vector<puzzle> all_puzzles = {
{"Red Room", false},
{"Blue Room", false},
{"Holding both orbs", false},
{"Green Room", false}
};
int main()
{
// Give your character a name
cout << "Please enter your character's name: ";
getline(cin, player);
cout << "\nWelcome to \"Fever Dream\", " << player << "!\n"
<< "Good luck!\n\n";
cin.clear();
// Introduction message
cout << "***************Now Entering: " << all_locs.at(0).name << "***************\n"
<< "You are in a foggy field with knee high grass in all directions.\n"
<< "There is a hill to the north with a smoldering tree on top of it.\n"
<< "You see a rock on the ground.\n"
<< ">";
while(true){
if(error_message == true)
return 0;
if(all_puzzles.at(3).completed == true)
return 0;
all_puzzles = puzzle_update(all_puzzles, items);
string line;
getline(cin, line);
/* Filtering out all instances of "the", "on", and "with".
* If I filter out "in" one of my commands "go inside" won't
* work correctly.
*/
while(line.find("the") < line.length() ||
line.find("on") < line.length() ||
line.find("with")< line.length() ||
line.find("in") < line.length())
{
if(line.find(" the") < line.length())
line.erase(line.find(" the"), 4);
else if(line.find("the") < line.length())
line.erase(line.find("the"), 3);
else if(line.find(" on") < line.length())
line.erase(line.find(" on"), 3);
else if(line.find("on") < line.length())
line.erase(line.find("on"), 2);
else if(line.find(" with") < line.length())
line.erase(line.find(" with"), 5);
else if(line.find("with") < line.length())
line.erase(line.find("with"), 4);
else
break;
}
char space = line.find(" ");
string verb = line.substr(0, space);
string noun = line.substr(space + 1, + 1000000);
if(verb == "get")
{
items = get(noun, char_loc, items);
}
else if(verb == "drop")
{
items = drop(noun, char_loc, items);
}
else if(verb == "look")
{
look(noun, char_loc, items);
}
else if(verb == "go")
{
char_loc = go(char_loc, noun, all_locs, all_puzzles, items);
}
else if(verb == "check")
{
check(noun, items);
}
else if(verb == "use" && noun == "levers" && char_loc == 4)
{
all_puzzles = red_room(all_puzzles);
items = red_outcome(items, all_puzzles);
}
else if(verb == "use" && noun == "levers" && char_loc == 5)
{
all_puzzles = blue_room(all_puzzles);
items = blue_outcome(items, all_puzzles);
}
else if(verb == "give" && char_loc == 6)
{
all_puzzles = give(noun, items, player, all_puzzles);
}
else if(verb == "give" && char_loc !=6)
{
cout << "There's no one to give anything to.\n"
<< ">";
}
else if(verb == "quit")
return 0;
else{
cout << "You dont know how to do that."
<< '\n' << ">";
}
}
}
// Function Definitions
vector<object> get(string a, int b, vector<object> c)
{
int i = 0;
while(i <= c.size() - 1){
try{
if(a == c.at(i).name && c.at(i).location == b) {
cout << "Taken.\n"
<< ">";
c.at(i).location = -1;
return c;
}
++i;
}
catch(out_of_range&){
cout << "Out of Range Error";
error_message = true;
}
}
if(a.at(0) == 'a' || a.at(0) == 'e' || a.at(0) == 'i' ||
a.at(0) == 'o' || a.at(0) == 'u'){
cout << "You don't see an " << a << ".\n"
<< ">";
return c;
}
else{
cout << "You don't see a " << a << ".\n"
<< ">";
return c;
}
}
vector<object> drop(string a, int b, vector<object> c)
{
int i = 0;
while(i <= c.size() - 1){
try{
if(a == c.at(i).name && c.at(i).location == -1) {
cout << "You drop the " << a << ".\n"
<< ">";
c.at(i).location = b;
return c;
}
++i;
}
catch(out_of_range&){
cout << "Out of Range Error";
error_message = true;
}
}
if(a.at(0) == 'a' || a.at(0) == 'e' || a.at(0) == 'i' ||
a.at(0) == 'o' || a.at(0) == 'u'){
cout << "You don't have an " << a << ".\n"
<< ">";
return c;
}
else
cout << "You don't have a " << a << ".\n"
<< ">";
return c;
}
void look(string a, int b, vector<object> c)
{
if(a == "rock" && c.at(0).location == b){
cout << "The rock is slightly larger than your hand.\n"
<< ">";
}
else if(a == "rock" && c.at(0).location == -1){
cout << "The rock rests at the bottom of your bag.\n"
<< ">";
}
else if(a == "large mushroom" && c.at(1).location == b){
cout << "The mushroom is dark blue with white spots. How strange!\n"
<< ">";
}
else if(a == "large mushroom" && c.at(1).location == -1){
cout << "The large mushroom rests at the bottom of your bag.\n"
<< ">";
}
else if(a == "red orb" && c.at(2).location == b){
cout << "The red orb casts a glow on all its surroundings.\n"
<< ">";
}
else if(a == "red orb" && c.at(2).location == -1){
cout << "Red light dances across the surface of the perfect sphere.\n"
<< ">";
}
else if(a == "blue orb" && c.at(3).location == b){
cout << "The blue orb glows quietly in the dark. What power could it possess?\n"
<< ">";
}
else if(a == "blue orb" && c.at(3).location == -1){
cout << "Blue light dances across the surface of the magic device.\n"
<< ">";
}
else if(a == "tree" && b == 0){
cout << "That used to be a massive oak tree, but nobody would ever \n"
<< "guess that by looking at it now.\n"
<< ">";
}
else if(a == "hill" && b == 0){
cout << "The grass that used to cover this hill has been reduced to ash.\n"
<< ">";
}
else if(a == "" && b == 0){
cout << "You are in a foggy field with knee high grass in all directions.\nThere is a hill to the north with a smoldering tree on top of it.\n"
<< ">";
if(c.at(0).location == 0)
cout << "\bYou see a rock on the ground.\n>";
}
else if(a == "look" && b == 0){
cout << "You are in a foggy field with knee high grass in all directions.\nThere is a hill to the north with a smoldering tree on top of it.\n"
<< ">";
if(c.at(0).location == 0)
cout << "\bYou see a rock on the ground.\n>";
}
else if(a == "tree" && b == 1){
cout << "The tree crackles as smoke steadily rises up to the morning \n"
<< "sky. It looks as though it could collapse at any moment.\n"
<< ">";
}
else if(a == "hill" && b == 1){
cout << "The hill is completely charred at the top. From up here you can\n"
<< "see that the ash has also covered the area at the base of the hill.\n"
<< ">";
}
else if(a == "hole" && b == 1){
cout << "The hole is huge! Could it have been created by lightning?\n"
<< ">";
}
else if(a == "" && b == 1){
cout << "In front of you is a smoldering tree. This entire hill has been badly\nburned. There is a large hole with roots surrounding it at the base\nof the tree.\n"
<< ">";
if(c.at(0).location == 1)
cout << "\bYou see a rock on the ground.\n>";
}
else if(a == "look" && b == 1){
cout << "In front of you is a smoldering tree. This entire hill has been badly\nburned. There is a large hole with roots surrounding it at the base\nof the tree.\n"
<< ">";
if(c.at(0).location == 1)
cout << "\bYou see a rock on the ground.\n>";
}
else if(a == "" && b == 2){
cout << "Thick tree roots stick out of the damp earth all around you.\n"
<< ">";
if(c.at(0).location == 2)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 2)
cout << "\bThere is a large mushroom in front of you.\n>";
}
else if(a == "look" && b == 2){
cout << "Thick tree roots stick out of the damp earth all around you.\n"
<< ">";
if(c.at(0).location == 2)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 2)
cout << "\bThere is a large mushroom in front of you.\n>";
}
else if(a == "" && b == 3){
cout << "This room has high vaulted ceilings, a marble floor, and stained\nglass windows. Some of the panes are broken with mounds of dirt below\nthem from outside. There is a large door to your left, another on\nyour right, and one in front of you at the far end of the room.\nThere is a long table in the center of the room. Several glass\nlanterns hang from the ceiling.\n"
<< ">";
if(c.at(0).location == 3)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 3)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 3)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 3)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else if(a == "look" && b == 3){
cout << "This room has high vaulted ceilings, a marble floor, and stained\nglass windows. Some of the panes are broken with mounds of dirt below\nthem from outside. There is a large door to your left, another on\nyour right, and one in front of you at the far end of the room.\nThere is a long table in the center of the room. Several glass\nlanterns hang from the ceiling.\n"
<< ">";
if(c.at(0).location == 3)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 3)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 3)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 3)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else if(a == "gold ruby encrusted altar" && b == 4){
cout << "What is this contraption? It looks valuable.\n"
<< ">";
}
else if(a == "" && b == 4){
cout << "This room is much smaller than the one you just left. There are\nsmall lanterns gleaming through red stained glass. Who keeps\nall these lanterns burning? In the corner of the room there is\na gold ruby encrusted altar with three levers.\n"
<< ">";
if(c.at(0).location == 4)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 4)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 4)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 4)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else if(a == "look" && b == 4){
cout << "This room is much smaller than the one you just left. There are\nsmall lanterns gleaming through red stained glass. Who keeps\nall these lanterns burning? In the corner of the room there is\na gold ruby encrusted altar with three levers.\n"
<< ">";
if(c.at(0).location == 4)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 4)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 4)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 4)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else if(a == "silver saphire encrusted altar" && b == 5){
cout << "Blue light reflects off of the mysterious altar.\n"
<< ">";
}
else if(a == "" && b == 5){
cout << "There are many small lanterns gleaming through blue stained glass.\nThe light from the lanterns is reflecting off of the floor which is\nentirely covered by a shallow layer of water. In the corner of the\nroom there is a silver saphire encrusted altar with three levers.\n"
<< ">";
if(c.at(0).location == 5)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 5)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 5)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 5)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else if(a == "look" && b == 5){
cout << "There are many small lanterns gleaming through blue stained glass.\nThe light from the lanterns is reflecting off of the floor which is\nentirely covered by a shallow layer of water. In the corner of the\nroom there is a silver saphire encrusted altar with three levers.\n"
<< ">";
if(c.at(0).location == 5)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 5)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 5)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 5)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else if(a == "fungal beast" && b == 6){
cout << "Looking at the creature causes you to freeze in horror.\n"
<< "Was this a human?\n"
<< ">";
}
else if(a == "" && b == 6){
cout << "You force yourself to look at something besides the embodiment of all\nthat is evil before you...\nThere are many green mushrooms casting their light on the damp walls\nof the room. Moisture drips from the cieling.\n"
<< ">";
if(c.at(0).location == 6)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 6)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 6)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 6)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else if(a == "look" && b == 6){
cout << "You force yourself to look at something besides the embodiment of all\nthat is evil before you...\nThere are many green mushrooms casting their light on the damp walls\nof the room. Moisture drips from the cieling.\n"
<< ">";
if(c.at(0).location == 6)
cout << "\bYou see a rock on the ground.\n>";
if(c.at(1).location == 6)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(c.at(2).location == 6)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(c.at(3).location == 6)
cout << "\bYou see a blue orb casting a soft light.\n>";
}
else{
cout << "You dont see anything interesting.\n"
<< ">";
}
}
int go(int a, string b, vector<locs> c, vector<puzzle> d, vector<object> e){
if(a == 0 && b == "north") {
cout << "***************Now Entering: " << c.at(1).name << "***************\n"
<< c.at(1).look_desc;
if(e.at(0).location == 1)
cout << "\bYou see a rock on the ground.\n>";
return 1;
}
else if(a == 1 && b == "back") {
cout << "***************Now Entering: " << c.at(0).name << "***************\n"
<< c.at(0).look_desc;
if(e.at(0).location == 0)
cout << "\bYou see a rock on the ground.\n>";
return 0;
}
else if(a == 1 && b == "south") {
cout << "***************Now Entering: " << c.at(0).name << "***************\n"
<< c.at(0).look_desc;
if(e.at(0).location == 0)
cout << "\bYou see a rock on the ground.\n>";
return 0;
}
else if(a == 1 && b == "inside") {
cout << "***************Now Entering: " << c.at(2).name << "***************\n"
<< c.at(2).look_desc;
return 2;
}
else if(a == 2 && b == "forward") {
cout << "***************Now Entering: " << c.at(3).name << "***************\n"
<< c.at(3).look_desc;
return 3;
}
else if(a == 3 && b == "left") {
cout << "***************Now Entering: " << c.at(4).name << "***************\n"
<< c.at(4).look_desc;
if(e.at(0).location == 4)
cout << "\bYou see a rock on the ground.\n>";
if(e.at(1).location == 4)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(e.at(2).location == 4)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(e.at(3).location == 4)
cout << "\bYou see a blue orb casting a soft light.\n>";
return 4;
}
else if(a == 4 && b == "back") {
cout << "***************Now Entering: " << c.at(3).name << "***************\n"
<< "Y" << c.at(3).look_desc.erase(0,74);
if(e.at(0).location == 3)
cout << "\bYou see a rock on the ground.\n>";
if(e.at(1).location == 3)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(e.at(2).location == 3)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(e.at(3).location == 3)
cout << "\bYou see a blue orb casting a soft light.\n>";
return 3;
}
else if(a == 3 && b == "right") {
cout << "***************Now Entering: " << c.at(5).name << "***************\n"
<< c.at(5).look_desc;
if(e.at(0).location == 5)
cout << "\bYou see a rock on the ground.\n>";
if(e.at(1).location == 5)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(e.at(2).location == 5)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(e.at(3).location == 5)
cout << "\bYou see a blue orb casting a soft light.\n>";
return 5;
}
else if(a == 5 && b == "back") {
cout << "***************Now Entering: " << c.at(3).name << "***************\n"
<< "Y" << c.at(3).look_desc.erase(0,74);
if(e.at(0).location == 3)
cout << "\bYou see a rock on the ground.\n>";
if(e.at(1).location == 3)
cout << "\bThere is a large mushroom resting on the marble tiles.\n>";
if(e.at(2).location == 3)
cout << "\bA red orb gleams brightly on the ground.\n>";
if(e.at(3).location == 3)
cout << "\bYou see a blue orb casting a soft light.\n>";
return 3;
}
else if(a == 3 && b == "forward" && d.at(2).completed == true) {
cout << "***************Now Entering: " << c.at(6).name << "***************\n"
<< c.at(6).look_desc;
return 6;
}
else{
cout << "You can't go there right now\n"
<< ">";
return a;
}
}
void check(string a, vector<object> b){
if(a == "inventory" || a == "bag"){
if(b.at(0).location == -1 || b.at(1).location == -1 ||
b.at(2).location == -1 || b.at(3).location == -1){
cout << "You have:\n";
if(b.at(0).location == -1)
cout << "A rock\n";
if(b.at(1).location == -1)
cout << "A large mushroom\n";
if(b.at(2).location == -1)
cout << "A red orb\n";
if(b.at(3).location == -1)
cout << "A blue orb\n";
cout << ">";
}
else
cout << "Your bag is empty.\n"
<< ">";
}
else
cout << "You can't do that right now.\n"
<< ">";
}
vector<puzzle> red_room(vector<puzzle> a){
string x;
string y;
string z;
if(a.at(0).completed == true){
cout << "The levers are locked in place and will not budge.\n"
<< ">";
return a;
}
else if(a.at(0).completed == false){
cout << "There are three levers with three positions: up (u), neutral(n),\n"
<< "and down (d). How would you like to orient them?\n"
<< "";
cout << "Lever 1: ";
getline(cin, x);
cout << "Lever 2: ";
getline(cin, y);
cout << "Lever 3: ";
getline(cin, z);
if(x == "u" && y == "d" && z == "u"){
cout << "You see a red flash and hear a high pitch ringing. \n"
<< "It's coming from the dining hall!\n"
<< ">";
a.at(0).completed = true;
return a;
}
else{
cout << "Nothing happens.\n"
<< ">";
return a;
}
}
else
return a;
}
vector<object> red_outcome(vector<object> a, vector<puzzle> b){
if(b.at(0).completed == true && a.at(2).location ==-2){
a.at(2).location = 3;
return a;
}
else
return a;
}
vector<puzzle> blue_room(vector<puzzle> a){
string x;
string y;
string z;
if(a.at(1).completed == true){
cout << "The levers are locked in place and will not budge.\n"
<< ">";
return a;
}
else if(a.at(1).completed == false){
cout << "There are three levers with three positions: up (u), neutral(n),\n"
<< "and down (d). How would you like to orient them?\n"
<< "";
cout << "Lever 1: ";
getline(cin, x);
cout << "Lever 2: ";
getline(cin, y);
cout << "Lever 3: ";
getline(cin, z);
if(x == "n" && y == "n" && z == "d"){
cout << "You see a blue flash and hear a high pitch ringing. \n"
<< "It's coming from the dining hall!\n"
<< ">";
a.at(1).completed = true;
return a;
}
else{
cout << "Nothing happens.\n"
<< ">";
return a;
}
}
else
return a;
}
vector<object> blue_outcome(vector<object> a, vector<puzzle> b){
if(b.at(1).completed == true && a.at(3).location ==-2){
a.at(3).location = 3;
return a;
}
else
return a;
}
vector<puzzle> puzzle_update(vector<puzzle> a, vector<object> b){
if(b.at(2).location == -1 && b.at(3).location == -1){
a.at(2).completed = true;
return a;
}
else{
a.at(2).completed = false;
return a;
}
}
vector<puzzle> give(string a, vector<object> b, string c, vector<puzzle> d){
if(a == "rock" && b.at(0).location == -1){
cout << "You give the rock to the fungal beast...\nThe creature puts the rock in its mouth and tries to bite into it.\nThe beast lets out a deafening howl and tears your still-beating heart\nout of your chest. You fall to the ground, regretting that you ever \ncrawled into this hole, as everything begins to fade to black.\n*PRO TIP*: Fungal beasts do not like rocks! They are also crazy strong...\n";
d.at(3).completed = true;
return d;
}
else if(a == "large mushroom" && b.at(1).location == -1){
cout << "You give the large mushroom to the fungal beast...\nThe creature puts the mushroom in its mouth and bites into it.\nAfter releasing some approving groans the creature motions for you\nfollow it. The beast retrieves a large chest and sets it in front\nof you. You open the chest revealing a mountain of gold!\nIt's all yours! Glory be yours! Your village will sing songs of\nyour brav-\n\"" << c << "\"" << " ... " << "\"" << c << "\"" << " ... \"" << c << ", wake up Sicky it's time\nto take your temperature again.\" Your mother enters the room.\nIt turns out you're actually a 12 year old kid in Oregon who\nstayed home sick from school today...\nStill! Glory be yours!\n";
d.at(3).completed = true;
return d;
}
else{
if(a.at(0) == 'a' || a.at(0) == 'e' || a.at(0) == 'i' ||
a.at(0) == 'o' || a.at(0) == 'u'){
cout << "You don't have an " << a << ".\n"
<< ">";
return d;
}
else
cout << "You don't have a " << a << ".\n"
<< ">";
return d;
}
}