Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.11 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3. #include <windows.h>
  4. using namespace std;
  5.  
  6. void inventory();
  7.  
  8.  
  9. int main()
  10. {
  11.     char mainMenu;
  12.     char userResponce;
  13.     char exit;
  14.  
  15.     cout << "Payday - TextAdventure" << endl;
  16.    
  17.     cout << "-----------------------------" << endl;
  18.     cout << "1. Start" << endl;
  19.     cout << "2. Help" << endl;
  20.     cout << "3. Credits" << endl;
  21.     cout << "4. Exit" << endl;
  22.     cout << "(Please type 1,2,3 or 4)" << endl;
  23.     cout << "-----------------------------" << endl;
  24.     cin >> mainMenu;
  25.     if (mainMenu == '1')
  26.     {
  27.        
  28.         system("CLS");
  29.         cout << "It is a quiet day, you are prepared.." << endl << "You have been planning this for months now," << endl << "You stand outside of the bank ready to make your" << endl << "first choice of which entrance to take." << endl;
  30.         Sleep(150);
  31.         cout << "1. Side door" << endl;
  32.         cout << "2. Front entrance" << endl;
  33.         cout << "3. Roof access" << endl;
  34.         cin >> userResponce;
  35.        
  36.         if (userResponce == 'i')
  37.         {
  38.             inventory();
  39.             cin >> userResponce;
  40.         }
  41.         else if (userResponce == '1')
  42.         {
  43.             system("CLS");
  44.             cout << "You have chosen to take the side door, " << endl;
  45.  
  46.             cin >> userResponce;
  47.             if (userResponce == 'i')
  48.             {
  49.                 inventory();
  50.  
  51.             }
  52.         }
  53.         else if (userResponce == '2')
  54.         {
  55.             system("CLS");
  56.             cout << "You have decided to take the agresive aproach and go straight in through" << endl << "front entrance of the bank, however Before you could react you're soon overrun" << endl << "by guards and surrendering" << endl;
  57.             cout << endl;
  58.             cout << endl;
  59.             cout << "Game over :( try again!" << endl;
  60.             cout << "The game will close soon" << endl << endl;
  61.             cout << "Or you can enter E to exit" << endl;
  62.             cin >> exit;
  63.                 if (exit == 'e' || 'E')
  64.                 {
  65.                     return 0;
  66.                 }
  67.                
  68.                 Sleep(5000);
  69.                 return 0;
  70.         }
  71.         else if (userResponce == '3')
  72.         {
  73.             system("CLS");
  74.             cout << "Without needing to think about it you rush to the right" << endl << "Of the building and climb the ladder up to the roof" << endl;
  75.  
  76.             cin >> userResponce;
  77.             if (userResponce == 'i')
  78.             {
  79.                 inventory();
  80.  
  81.             }
  82.         }
  83.  
  84.     }
  85.     if (mainMenu == '2')
  86.     {
  87.         system("CLS");
  88.         cout << "Help Menu" << endl;
  89.         cout << "-----------------" << endl;
  90.         cout << "You can press i at any given time to view the inventory." << endl;
  91.         cout << "This game is a choice driven text-based game your task" << endl << "is to successfully rob the bank and get as much money" << endl << "As possible." << endl;
  92.         cout << "-----------------" << endl;
  93.        
  94.  
  95.     }
  96.     if (mainMenu == '3')
  97.     {
  98.    
  99.         cout << endl;
  100.         cout << endl;
  101.         cout << endl;
  102.         cout << "T";
  103.             Sleep(50);
  104.             cout << "h";
  105.             Sleep(50);
  106.             cout << "i";
  107.             Sleep(50);
  108.             cout << "s";
  109.             Sleep(50);
  110.             cout << " ";
  111.             Sleep(50);
  112.             cout << "G";
  113.             Sleep(50);
  114.             cout << "a";
  115.             Sleep(50);
  116.             cout << "m";
  117.             Sleep(50);
  118.             cout << "e";
  119.             Sleep(50);
  120.             cout << " ";
  121.             Sleep(50);
  122.             cout << "W";
  123.             Sleep(50);
  124.             cout << "a";
  125.             Sleep(50);
  126.             cout << "s";
  127.             Sleep(50);
  128.             cout << " ";
  129.             Sleep(50);
  130.             cout << "P";
  131.             Sleep(50);
  132.             cout << "r";
  133.             Sleep(50);
  134.             cout << "o";
  135.             Sleep(50);
  136.             cout << "g";
  137.             Sleep(50);
  138.             cout << "r";
  139.             Sleep(50);
  140.             cout << "a";
  141.             Sleep(50);
  142.             cout << "m";
  143.             Sleep(50);
  144.             cout << "m";
  145.             Sleep(50);
  146.             cout << "e";
  147.             Sleep(50);
  148.             cout << "d";
  149.             Sleep(50);
  150.             cout << " ";
  151.             Sleep(50);
  152.             cout << "B";
  153.             Sleep(50);
  154.             cout << "y";
  155.             Sleep(50);
  156.             cout << " ";
  157.             Sleep(50);
  158.             cout << "J";
  159.             Sleep(50);
  160.             cout << "o";
  161.             Sleep(50);
  162.             cout << "s";
  163.             Sleep(50);
  164.             cout << "h";
  165.             Sleep(50);
  166.             cout << " ";
  167.             Sleep(50);
  168.             cout << "W";
  169.             Sleep(50);
  170.             cout << "i";
  171.             Sleep(50);
  172.             cout << "d";
  173.             Sleep(50);
  174.             cout << "d";
  175.             Sleep(50);
  176.             cout << "u";
  177.             Sleep(50);
  178.             cout << "p";
  179.             Sleep(50);
  180.             cout << endl;
  181.  
  182.  
  183.  
  184.        
  185.     }
  186.     if (mainMenu == '4')
  187.    
  188.     {
  189.  
  190.         return 0;
  191.     }
  192.  
  193.  
  194.     system("pause");
  195.     return 0;
  196. }
  197.  
  198.  
  199. int ammo = 10;
  200. void inventory()
  201. {
  202.  
  203.     cout << "You have the following items:" << endl;
  204.     cout << endl;
  205.     cout << ". Hammer" << endl << ". Welder" << endl << ". Gun - " << ammo << " " << "bullets" << endl;
  206. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement