-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCave.cpp
More file actions
47 lines (43 loc) · 1.3 KB
/
Copy pathCave.cpp
File metadata and controls
47 lines (43 loc) · 1.3 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
/************************************************************
** Author: Peter Nguyen
** CS162-400, Final project
** Date: 6/6/15
** Description: Cave (Location subclass) implementation file
************************************************************/
#include "Cave.hpp"
#include <iostream>
using std::cout;
using std::string;
/************************************************************
** Cave::printDescription
** Description: Prints description of the Location
** Parameters: none
************************************************************/
void Cave::printDescription()
{
cout << "\nYou enter a dark and smelly cave.\n";
cout << "You can smell the presence of a ";
cout << "large grizzly bear. \n\n";
printMenu();
cout << "6. Fight the grizzly bear\n";
}
/************************************************************
** Cave::specialAction
** Description: Performs special action for the location
** Parameters: none
************************************************************/
string Cave::specialAction(Player* pl)
{
Character* winner;
winner = pl->combat(&grizzly1);
if (winner == pl)
{
pl->setKilledGrizz(true);
return "\nYou killed the Grizzly!\n";
}
else
{
pl->setStrengthPts(5);
return "\nThe Stranger escapes with only 5 hit points.\n";
}
}