-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPokeCenter.cpp
More file actions
43 lines (36 loc) · 1.29 KB
/
Copy pathPokeCenter.cpp
File metadata and controls
43 lines (36 loc) · 1.29 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
/*********************************************************************
** Program name: FinalProject
** Author: James Scanlon
** Date: March 19, 2019
** Description: Implementation of the PokeCenter class. Derived class of the Space class.
*********************************************************************/
#include "PokeCenter.hpp"
#include "Player.hpp"
// constructor
PokeCenter::PokeCenter(Player* user) : Space("PokeCenter", user)
{
vector<string> menuItems = {"Heal your pokemon", "Leave"};
moveMenu->setPromptText("Nurse Joy: Welcome to the PokeCenter! What would you like to do?");
moveMenu->setMenuChoices(menuItems);
}
void PokeCenter::enter(Player* user)
{
int userChoice = moveMenu->showMenu();
while (userChoice == 1)
{
if (user->getObjective() > 2 ) // heals pokemon back to full health
{
user->getBulbasaur()->healDamage();
cout << "Nurse Joy: We have healed your " << user->getBulbasaur()->getName() << " back to full health!" << endl;
}
else
{
cout << "Nurse Joy: You don't have any pokemon to heal yet." << endl;
}
userChoice = moveMenu->showMenu();
}
cout << "Nurse Joy waves as you leave!" << endl;
}
PokeCenter::~PokeCenter()
{
}