Skip to content

Commit

Permalink
finished filling in the location details and played the first full ru…
Browse files Browse the repository at this point in the history
…n through of the game.
  • Loading branch information
Unknown authored and Unknown committed Feb 5, 2019
1 parent 45030d5 commit a21bca8
Show file tree
Hide file tree
Showing 13 changed files with 228 additions and 50 deletions.
4 changes: 3 additions & 1 deletion Leroys_Quest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "Systems/ActionSystem.h"
#include "Systems/InventorySystem.h"
#include "Systems/LanguageSystem.h"
#include "Systems/AchievementSystem.h"

std::string GetUserInput();
std::string PreprocessInput(const std::string& rawInput);
Expand All @@ -38,6 +39,7 @@ int main()
ActionSystem& ActSystem = GetInstanceOf(ActionSystem);
InventorySystem& InvSystem = GetInstanceOf(InventorySystem);
LanguageSystem& LangSystem = GetInstanceOf(LanguageSystem);
AchievementSystem& AchieveSystem = GetInstanceOf(AchievementSystem);

bool shouldQuit = false;
std::string userInput;
Expand All @@ -46,7 +48,7 @@ int main()


/* Begin core Game Loop */
while (!shouldQuit)
while (!shouldQuit && !AchieveSystem.Completed)
{
/*
* Returns a copy of the users entered string,
Expand Down
18 changes: 14 additions & 4 deletions Leroys_Quest/src/Locations/Braids.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "Braids.h"
#include "Systems/AchievementSystem.h"
#include "Core.h"
#include <iostream>

namespace LeroysQuest {
Expand Down Expand Up @@ -26,7 +28,9 @@ namespace LeroysQuest {

const char* Braids::ConditionalDescription() const
{
if (!m_BirdFreed)
AchievementSystem& as = GetInstanceOf(AchievementSystem);

if (!as.SetBirdFree)
{
return "Looking up you find a bird trapped in the braids above.\n"
"It must have gotten stuck when flying nearby. It seems \n"
Expand All @@ -44,7 +48,9 @@ namespace LeroysQuest {

const char* Braids::TransDiscription() const
{
if (!m_BirdFreed)
AchievementSystem& as = GetInstanceOf(AchievementSystem);

if (!as.SetBirdFree)
{
return "There appears to be some tall woven structures...\n";
}
Expand All @@ -60,7 +66,9 @@ namespace LeroysQuest {

bool Braids::OnExit(MovementDirection exitDir)
{
if (m_BirdFreed == false && exitDir == MovementDirection::South)
AchievementSystem& as = GetInstanceOf(AchievementSystem);

if (as.SetBirdFree == false && exitDir == MovementDirection::South)
{
std::cout <<
"The thick braids block your path south. You could probably \n"
Expand All @@ -72,6 +80,8 @@ namespace LeroysQuest {

bool Braids::OnEvent(Item item)
{
AchievementSystem& as = GetInstanceOf(AchievementSystem);

if (item.GetName() == "scissors")
{
std::cout <<
Expand All @@ -83,7 +93,7 @@ namespace LeroysQuest {
"more minutes of this you finally clear a large enough path to \n"
"to travel through, opening the path to the south.\n";

m_BirdFreed = true;
as.SetBirdFree = true;
return true;
}
else
Expand Down
3 changes: 0 additions & 3 deletions Leroys_Quest/src/Locations/Braids.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ namespace LeroysQuest {

class Braids : public Location
{

bool m_BirdFreed = false;

public:
Braids();
~Braids();
Expand Down
32 changes: 29 additions & 3 deletions Leroys_Quest/src/Locations/FalconKeep.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#include "FalconKeep.h"
#include <iostream>
//temp
#include "Core.h"
#include "Systems/LanguageSystem.h"

namespace LeroysQuest {

FalconKeep::FalconKeep()
{
LanguageSystem& ls = GetInstanceOf(LanguageSystem);

m_Inventory.push_back(Item("fireproof-clothes"));
ls.AddIdentifier("fireproof-clothes");
}

FalconKeep::~FalconKeep()
Expand All @@ -18,7 +26,11 @@ namespace LeroysQuest {

const char* FalconKeep::Description() const
{
return "";
return "You walk out onto a beach of pale yellow sand. \n"
"The tall cliffs above you seem almost as if they\n"
"could crumble any second. Inset into these cliffs\n"
"is a metal alter. Once used to give gifts to the \n"
"those who ruled this forgotten place, Falcon Keep.\n";
}

const char* FalconKeep::ConditionalDescription() const
Expand All @@ -28,7 +40,7 @@ namespace LeroysQuest {

const char* FalconKeep::TransDiscription() const
{
return "A metal door inset into a cliff wall...\n";
return "A long forgotten beach below tall cliffs.\n";
}


Expand All @@ -42,7 +54,21 @@ namespace LeroysQuest {

bool FalconKeep::OnEvent(Item item)
{
return false;
if (item.GetName() == "feather")
{
std::cout <<
"You place the feather on the alter, and the alter spins around,\n"
"revealing a set of FIREPROOF-CLOTHES.\n";

return true;
}
else
{
std::cout <<
"You place the item on the alter... and nothing happens.\n";

return false;
}
}

}
34 changes: 28 additions & 6 deletions Leroys_Quest/src/Locations/HeavensPeak.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#include "HeavensPeak.h"
#include "Systems/AchievementSystem.h"
#include "Systems/LanguageSystem.h"
#include "Core.h"
#include <iostream>

namespace LeroysQuest {

HeavensPeak::HeavensPeak()
{
LanguageSystem& ls = GetInstanceOf(LanguageSystem);

m_Inventory.push_back(Item("feather"));
ls.AddIdentifier("feather");
}


Expand All @@ -19,20 +27,36 @@ namespace LeroysQuest {

const char* HeavensPeak::Description() const
{
return "";
return
"The tall mountains tower above the surrounding landscapes.\n"
"They make passage through the area difficult, but not impossible.\n"
"The snow topped peaks and treacherous cliff sides leave little room\n"
"for land dwelling creatures to live here.\n";
}

const char* HeavensPeak::ConditionalDescription() const
{
if (!m_BirdFreed)
AchievementSystem& as = GetInstanceOf(AchievementSystem);
static bool gotFeather = false;

if (!as.SetBirdFree)
{
return "Looking up you see an empty birds nest \n"
"just out of reach...\n";
}
else if (as.SetBirdFree && !gotFeather)
{
gotFeather = true;
return
"As you climb up Heaven's Peak you hear the familiar calling\n"
"of the bird you freed from the Braids. It flies over head of\n"
"you and a single FEATHER drops at your feet. It then lands in\n"
"its nest on the cliff side and almost seems to smile at you\n"
"thankfully.\n";
}
else
{
return "Looking at the birds nest again, you \n"
"see the bird happily sleeping.\n";
return "You look up at the nest to find the bird sleeping soundly.\n";
}
}

Expand All @@ -52,8 +76,6 @@ namespace LeroysQuest {

bool HeavensPeak::OnEvent(Item item)
{
// when the bird caught in the braids is freed,
// it will come here and give the player a key?
return false;
}

Expand Down
27 changes: 26 additions & 1 deletion Leroys_Quest/src/Locations/LeroysTower.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "LeroysTower.h"
#include "Systems/AchievementSystem.h"
#include "Core.h"
#include <iostream>

namespace LeroysQuest {

Expand All @@ -21,7 +24,9 @@ namespace LeroysQuest {
{
return "You stand before a tall tower. It looks old and weathered,\n"
"but based on the rumors there is a large sum of treasure inside.\n"
"It is locked behind the towers BIG-DOOR.\n";
"It is locked behind the towers door. The key to which is said to\n"
"have been lost in the Red Chasm. A place no mortal has ever returned\n"
"from...";
}

const char* LeroysTower::ConditionalDescription() const
Expand All @@ -45,6 +50,26 @@ namespace LeroysQuest {

bool LeroysTower::OnEvent(Item item)
{
AchievementSystem& as = GetInstanceOf(AchievementSystem);

if (item.GetName() == "tower-key")
{
std::cout <<
"You unlock the door with the tower key; the tower door swings open\n"
"and reveals a mirror behind it. You are confused at first by the lack\n"
"of treasure in the tower. As you stand there looking at your own \n"
"reflection, it dawns on you that you were the treasure the whole time.\n"
"You traveled this world, helping those in need. The bird stuck in the \n"
"Braids... the mermaid having a bad hair day... The forest spirit at the\n"
"heart of treasureland. You have made all of them happy once more. You \n"
"have done great work here, and you realize you can do great work anywhere.\n"
"If you just put your mind to it, you can solve any problem presented to you.\n";

as.Completed = true;

return true;
}

return false;
}

Expand Down
53 changes: 49 additions & 4 deletions Leroys_Quest/src/Locations/MermaidCove.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#include "MermaidCove.h"
#include <iostream>

//temp
#include "Core.h"
#include "Systems/LanguageSystem.h"

namespace LeroysQuest {

MermaidCove::MermaidCove()
{
// add item "Rock" to room inventory
LanguageSystem& ls = GetInstanceOf(LanguageSystem);

m_Inventory.push_back(Item("bucket"));
ls.AddIdentifier("bucket");
}


Expand All @@ -28,7 +36,23 @@ namespace LeroysQuest {

const char* MermaidCove::ConditionalDescription() const
{
return "";
if (!m_HelpedMermaid)
{
return
"You hear a mermaid crying behind the rock. When you call out to\n"
"her to ask what is wrong, she tells you that her hair is terribly\n"
"knotted. She tells you that in her desperate attempts to find a\n"
"solution, she instead found a bucket. Through her continued sobs,\n"
"she begs you to help her. Before she sinks down under the water \n"
"leaving you standing alone in the clearing\n";
}
else
{
return
"You call out to the mermaid once more; this time she seems joyful.\n"
"She thanks you graciously for helping her earlier.\n";
}

}

const char* MermaidCove::TransDiscription() const
Expand All @@ -47,8 +71,29 @@ namespace LeroysQuest {

bool MermaidCove::OnEvent(Item item)
{
// look at the rock to find the mermaid. it will do something...
return false;
if (item.GetName() == "hair-brush")
{
std::cout <<
"As you hold up the hair brush about to call out to the crying\n"
"mermaid, She comes rushing over to the shore to grab it from \n"
"your hand. She is filled with such excitement and joy, that she\n"
"accidentally pushes you to the ground trying to take it out of\n"
"your hand. She throws the BUCKET next to you, and with the hair\n"
"brush in hand, swims back into the lake.\n";
m_HelpedMermaid = true;

return true;
}
else
{
std::cout <<
"You hold up the item and call out to the mermaid. She looks at\n"
"what you have and her face fills with rage. She screams at you\n"
"and her hair becomes engulfed in flames. She quickly dives back\n"
"under the water to quench her flaming hair.\n";

return false;
}
}

}
3 changes: 3 additions & 0 deletions Leroys_Quest/src/Locations/MermaidCove.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ namespace LeroysQuest {

class MermaidCove : public Location
{

bool m_HelpedMermaid = false;

public:
MermaidCove();
~MermaidCove();
Expand Down
Loading

0 comments on commit a21bca8

Please sign in to comment.