-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_stage1.cpp
30 lines (27 loc) · 1.09 KB
/
check_stage1.cpp
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
#include <iostream>
#include "User.h"
bool* check_stage1(User* player, bool* stage1) {
// Function to check if goal of stage 1 has been achieved. If goal is achieved, function will run stage 1 challenges and return true.
int input;
if (player->getBalance()>=150000 && player->getBalance()<300000 && (*stage1==true)) {
*stage1=false;
std::cout<<"~~~~~~~150,000$ MARK~~~~~~~`"<<std::endl;
std::cout<<"Congratulations, you have reached the 150,000$ mark!"<<std::endl;
std::cout<<"Pick from one of the following 2 boxes.."<<std::endl;
std::cout<<"The boxes could contain something good.. or bad..."<<std::endl;
std::cout<<"Enter 1 for box 1 or 2 for box 2: ";
while(!(std::cin>>input) || input<1|| input>2) {
std::cout<<"Invalid, please pick box 1 or 2: \n";
std::cin.clear();
std::cin.ignore(5,'\n');
}
if (input==1) {
player->addBalance(50000);
std::cout<<"You won 50,000$!\n"<<std::endl;
}
if (input==2) {
std::cout<<"Unfortunately you won nothing..\n"<<std::endl;
}
}
return stage1;
}