-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHideout.cpp
More file actions
52 lines (48 loc) · 1.44 KB
/
Copy pathHideout.cpp
File metadata and controls
52 lines (48 loc) · 1.44 KB
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
/************************************************************
** Author: Peter Nguyen
** CS162-400, Final project
** Date: 6/6/15
** Description: Hideout (Location subclass) implementation file
************************************************************/
#include "Hideout.hpp"
#include <iostream>
using std::cout;
using std::string;
/************************************************************
** Hideout::printDescription
** Description: Prints description of the Location
** Parameters: none
************************************************************/
void Hideout::printDescription()
{
cout << "\nYou enter an inner cave.\n";
cout << "This is the hideout of the notorious mystic ";
cout << "and killer El Diablo. \n\n";
printMenu();
cout << "6. Fight El Diablo\n";
}
/************************************************************
** Hideout::specialAction
** Description: Performs special action for the location
** Parameters: none
************************************************************/
string Hideout::specialAction(Player* pl)
{
Character* winner;
if (pl->getKilledGrizz())
{
winner = pl->combat(&diablo1);
if (winner == pl)
{
pl->setObjectiveMet(true);
return "\nYou killed El Diablo!\n";
}
else
{
pl->setStrengthPts(5);
return "\nThe Stranger escapes with only 5 hit points.\n";
}
}
else
return "\nYou need to get past the Grizzly first!\n";
}