Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- #include <fstream>
- using namespace std;
- //Global Vars
- int mainMenuChoice = 0;
- // Player Info
- string playerName = " ";
- int playerHp = 100;
- int playerHpMax = 100;
- int playerDamage = 0;
- int playerWeapon = 0;
- // 0= fist, 1= rock, 2= hammer, 3= knife
- string playerWeaponName = "Fists";
- int playerWeaponAmmo = 0;
- // 0= unlimited
- int playerInvS[8];
- // 0 =none, 1= Alexandrovs ID, 2=
- int playerInvSUsed = 0;
- /* //AddInventoryItemCodeGroup
- playerInvS[playerInvSUsed] = 1; // added Alexandrovs ID to slot: #
- playerInvSUsed = playerInvSUsed + 1; // slot # filled */
- //voids
- void options();
- void mainMenu();
- void startGame();
- void loadGame();
- void saveGame();
- void loadGameRetieveText();
- void selectChapter();
- //voids game parts
- void gamePart1();
- void gamePart2();
- void gamePart3();
- void gamePart4();
- // void choices
- void gP1R1();
- //inizialize main
- int main()
- {
- mainMenu();
- std::cin.get();
- return 0;
- }
- //init clock
- #include <time.h>
- void wait ( double seconds )
- {
- clock_t endwait;
- endwait = clock () + seconds * CLOCKS_PER_SEC ;
- while (clock() < endwait) {}
- }
- //Options
- // option vars
- int optionsMenuChoice = 0;
- int difficulty = 0;
- // START OPTIONS
- void options()
- { //display menu
- system("cls");
- system("color 20");
- cout << " Options" << endl << endl;
- cout << "Choose Option to change" << endl << endl;
- cout << "1: Difficulty (Changes Difficulty)" << endl;
- cout << "2: Return to Main Menu" << endl;
- cin >> optionsMenuChoice;
- //menu choose
- switch(optionsMenuChoice)
- {
- case 1:
- system("cls");
- cout << "Enter difficulty (1 = easy, 2 = hard)" << endl;
- cin >> difficulty;
- if (difficulty > 2 || difficulty < 1)
- {
- cout << "difficulty must be = to 1 or 2" << endl << "Difficult set to 1 as default" << endl;
- difficulty = 1;
- }
- else
- cout << "Difficulty set to "<<difficulty << endl;
- system("pause");
- system("cls");
- options();
- break;
- case 2:
- system("cls");
- mainMenu();
- break;
- default:
- system("cls");
- options();
- }
- }
- void startGame()
- {
- system("CLS");
- cout << "1986, April 26:" << endl << " Chernobyl Power Plant, Soviet Controlled Ukraine " << endl << "1:10 A.M." << endl;
- system("Pause");
- cout << endl << "Inside Chernobyl Plant Lab 4 (Biological Studies)" << endl << endl << "Dr. Alexandrov : Titov! Bring me specimen 1734." << endl << "Titov: Yes Dr. Alexandrov"<< endl << "Titov quickly brought back a cage with a small mouse inside," << endl << " Dr. Alexandrov quickly put the mouse into a small box, " << endl << " and put the box into a slit vault door in the reactor" << endl;
- system("Pause");
- system("cls");
- cout << "As Alexandrov closes the vault door, he notices a crack in the reactor" << endl << "He dismisses it as a minor flaw with no immenent consequence" << endl;
- wait (10);
- cout << "He was wrong" << endl;
- system("Pause");
- system("cls");
- cout << "As the reactors power increased Alexandrov watched the mouse running into the walls of the box" << endl;
- system("Pause");
- system("cls");
- cout << "The Box cracked under the pressure of the reactor, allowing the mouse to escape" << endl;
- system("Pause");
- system("cls");
- cout << "Radioactive Energy also escaped from the crack, instantly vaporizing Dr. Alexandrov." << endl;
- cout << "Titov saw the mouse running at him, he noticed its glow and its red eyes, its pounced up and bit Titov" << endl << "Titov pulled the mouse off and threw it away from him" << endl << "instantly feeling pain in his neck, and numbness all through his body" << endl;
- system("Pause");
- system("cls");
- wait(5);
- cout << "April 26, 1:30 A.M.: "<< endl <<"Titov then felt nothing, his eyes began to close as the reactor exploded." << endl << " The floor collapsed under him, and he fell into a dark hole and was covered in rubble." << endl;
- system("Pause");
- system("cls");
- wait (2);
- cout << "August 28, 2017:" << endl << "Chernobyl Radiation levels have decended to a safe enviorment, with radiation suits on off course." << endl << " Dr. Gregory and his team have just began searching the long destroyed reactor for" << endl << " evidence of what caused the chernobyl disaster" << endl;
- system("Pause");
- system("cls");
- gP1R1();
- }
- void mainMenu()
- {
- // Display Menu
- system("cls");
- system("color 20");
- cout << " Zombie Survival " << endl << endl;
- cout << "Select # for choice of game" << endl << endl;
- cout << "1: New Game (Starts a brand new game)" << endl;
- cout << "2: Load Game (Loads a Previously Saved game)" << endl;
- cout << "3: Options (Selects Options)" << endl;
- cout << "4: Exit (Exits the Program)" << endl;
- cout << endl << endl << endl << endl << endl;
- cout << "777777777777777777777777777777777777777777777777777777777IIIIIIIIIII777777777777"<< endl << "7777 7 7 7777777777777777777777777777777777777IIIIII777II7IIIIII7777777777777"<< endl << "777 7777777 77 7 7 777777777777777777777 77777777"<< endl << "777 777777 777 7777"<< endl << "777 7777"<< endl << "7777 ,,,7 77777"<< endl << "7777 7,,,,,7 77777"<< endl << "7777 7,,,,7 ,,,,,,77 77777"<< endl << "7II7 ,,,,,,,,,=7I,,~ 7,,,,,,,,,, 77777"<< endl << "III7 ,,,,,,,,,,,,,,,,,., 7,,,,,,,,,,,, 77777"<< endl << "III7 7,,,,,,,,,,,,,,,,?,,,,,7 7,,,,,,,,,,,, 77777"<< endl << "III7 ,,,,,,,,,,,,,,,,7 7 ,,,,7 7,,,,,,,,,,,,,, 77777"<< endl << "III7 ,,,,,,,,,,,,,,,,,,7 7 7.,, ,,,7,,,,,,, I,,7 77777"<< endl << "II77 :,,,,,,,,,,,,,,,,,,,,+ 7 , ?,, 7,,,,,,777,,7 77777"<< endl << "III7 ,,,,,,,77,,,,,,,,,,,,,, 7,, 7,,,,,, 7 7,, 77777"<< endl << "III7 ?,,,,7= 7 77,,,,,,,,,,,,,7 ,,,I ,,,,,,,7 ., 77777"<< endl << "II77 7,,7,777 77,,,,,,,,,,,,, ,~7 77,,,,,,,, 7,, 77777"<< endl << "II77 7 7, 7 ,,,,,,,,,,,? ,= 77,,,,,,,, 7 , 77777"<< endl << "II77 7 77,,,,,,,,,,= ,7 77,,,,,,,,77 7,, 77777"<< endl << "III7 .,,,7,,,,, 777 7~,,,7 ,,, 7 77, 77777"<< endl << "777 ,,,, ,,,,7 ,,,, ,,,7 77777"<< endl << "777 7,,,,~ ,,,, ,,,= ,,,?7 7777777"<< endl << "777 =,,,,7 ,,,7 ,,,7 I,,, 777 77777"<< endl << "777 7 ,,,,. ,,,~ ,,,7 ?,,, 7777777777"<< endl << "777 ,,,,~ 7,,,, ,,,7 I,, 77777 77777"<< endl << "777 7,,,,, 7 I,,, 7,,, II,,7 77777"<< endl << "77 7,,,, 7 ,,, 7,,,7 I,,: 77777"<< endl << "77 ,,,, ,,,7 7,,, 7,,, 7 77777"<< endl << "77 :,,,77 :,,7 ,,? 7?,,7 7 77777"<< endl << "77 7,,, I,,,+ 77,,,7 77,,7 777 77777"<< endl << "77 ,,,~ 77=77 77,,,,? 7,, 7 77777"<< endl << "77 7=,, 7 ,,,,77 77,,7 77 77777"<< endl << "77 7 77 77 777 777777"<< endl << "77 7 77 77 777777"<< endl << "77 77 7 7 7 7 7 7 77777777777 77777777"<< endl << "77777777777777777777777777777777777777777777777777777777777777777 777 77777777"<< endl << "77777777777777777777777777777777777777777777777777777IIIIIIIIIIIII??????II777777"<< endl << "77777777777777777777777777777777777777777777777777777777777777777777777I77777777";
- cout << endl << endl;
- cin >> mainMenuChoice;
- // input
- switch(mainMenuChoice)
- {
- case 1:
- system("CLS");
- selectChapter();
- break;
- case 2:
- system("CLS");
- //loadGameRetieveText();
- options();
- break;
- case 3:
- system("CLS");
- options(); // brings to options
- break;
- case 4:
- system("CLS");
- exit (1);
- break;
- default:
- system("cls");
- mainMenu();
- break;
- }
- system("pause");
- }
- /*
- // Var for savedgame
- int savePosition = 0;
- //save
- void saveGame()
- {
- ofstream savegame ("SaveGamed.txt");
- if (savegame.is_open())
- {
- savegame << savePosition;
- savegame.close();
- }
- else
- cout << "Unable to save";
- }
- //loadRetriveText
- void loadGameRetieveText()
- {string line;
- ifstream savegame ("SaveGamed.txt");
- if (savegame.is_open())
- {
- while (! savegame.eof() )
- {
- getline (savegame,line);
- }
- savegame.close();
- loadGame();
- }
- else
- cout << "Unable to open file";
- }
- //load game
- void loadGame()
- {
- }
- int GetIntVal(string line)
- {
- // NOTE: You should probably do some checks to ensure that
- // this string contains only numbers. If the string is not
- // a valid integer, zero will be returned.
- savePosition = atoi(line.c_str());
- return(savePosition);
- }
- */
- //Choose chapter
- int chapterChoose = 0;
- void selectChapter()
- {
- cout << "Choose Chapter" << endl << endl;
- cout << "1 = Game Start" << endl << "2 = Unforseen Consequences" << endl << "3 = The Plague" << endl << "4 = Escape" << endl << "5 = Return to Main Menu" << endl;
- cin >> chapterChoose;
- switch(chapterChoose)
- {
- case 1:
- cout << "Game Start Selected" << endl;
- wait (1);
- system("cls");
- startGame(); // begin
- break;
- case 2:
- cout << "Unforseen Consequences Selected" << endl;
- wait (1);
- system("cls");
- gP1R1(); // part1
- break;
- case 3:
- cout << "The Plauge Selected" << endl;
- wait (1);
- system("cls");
- gP1R1(); // part 2
- break;
- case 4:
- cout << "Escape" << endl;
- wait (1);
- system("cls");
- gP1R1(); // part 3
- break;
- case 5:
- cout << "Returning to menu" << endl;
- wait (1);
- system("cls");
- selectChapter();
- break;
- default:
- selectChapter(); // wrong input
- break;
- }
- }
- //local vars for gP1R1
- int choice = 0;
- int search1P1 = 0;
- int search1P2 = 0;
- void gP1R1()
- {
- system("cls");
- cout << "U";
- wait(0.3);
- cout << "n";
- wait(0.3);
- cout << "f";
- wait(0.3);
- cout << "o";
- wait(0.3);
- cout << "r";
- wait(0.3);
- cout << "s";
- wait(0.3);
- cout << "e";
- wait(0.3);
- cout << "e";
- wait(0.3);
- cout << "n";
- wait(0.3);
- cout << " ";
- wait(0.3);
- cout << "C";
- wait(0.3);
- cout << "o";
- wait(0.3);
- cout << "n";
- wait(0.3);
- cout << "s";
- wait(0.3);
- cout << "e";
- wait(0.3);
- cout << "q";
- wait(0.3);
- cout << "u";
- wait(0.3);
- cout << "e";
- wait(0.3);
- cout << "n";
- wait(0.3);
- cout << "c";
- wait(0.3);
- cout << "e";
- wait(0.3);
- cout << "s"<< endl;
- wait(0.3);
- cout << "Enter your name: ";
- cin >> playerName;
- getline (cin,playerName);
- wait(2);
- cout << "Gregory: \"" << playerName << ", While we set up the equiptment out here go look around the offices. If you need us, dont hesitate to come get us. \"" << endl;
- wait(5);
- system("pause");
- system("cls");
- cout << "You walk down the hall and see several doors, after trying them all you enter the only unlocked door" << endl;
- wait(6);
- system("pause");
- //search1
- bool check1Search1 = false;
- bool check1Search2 = false;
- bool check1Search3 = false;
- bool check1Search4 = false;
- char userYesNo = 'N';
- while(search1P1 == 0)
- {
- system("cls");
- cout << "You enter the room and see a computer on a desk, file cabinet and a trash bin." << endl;
- cout << "What would you like to do? " << endl << " 1: Look at the computer" << endl << "2: Search the desk drawers" << endl << "3: Search the file cabinet" << endl << "4: Search the trash bin" << endl << "5: Leave the Room" << endl;
- cin >> choice;
- switch(choice)
- {
- case 1:
- if(check1Search1 == true)
- {
- cout << " You look at the computer again, nothing has changed." << endl;
- system("pause");
- break;
- }
- cout << "You look at the computer but the screen is cracked and the computer has no power supply" << endl;
- check1Search1 = true;
- system("pause");
- break;
- case 2:
- if(check1Search2 == true)
- {
- if(check1Search4 == true)
- {
- cout << " The desk is covered in crumpled up papers from the trash bin." << endl;
- system("pause");
- }
- cout << " You search the desk again but dont find anything important." << endl;
- system("pause");
- break;
- }
- cout << " You search the desk, and find an ID belonging to a Dr. Alexandrov. You keep it for Gregory" << endl;
- //AddInventoryItemCodeGroup
- playerInvS[playerInvSUsed] = 1; // added Alexandrovs ID to slot: 1
- playerInvSUsed = playerInvSUsed + 1; // slot 1 filledb
- check1Search2 = true;
- system("pause");
- break;
- case 3:
- if(check1Search3 == true)
- {
- cout << " You look through the file cabinets again, You look at the report again." << endl << " Dr. Alexandrov: " << endl << " Today we ran tests on 16 specimens, but specimen 1679 (21 day old mouse), and it began to shake uncontrollably and its eyes began to glow.\n After increasing the internal power (to 200000 Watts for a total of 4 seconds), The mouse almost burst. The mouse then ran into the walls of the box\n and fell onto its side. After de-contamination Titov pronounced it dead. Im looking forward to see another glowing in eyes of another \n specimen. After another specimen experiences the same effects, we'll have multiple records of this occurring " << endl;
- system("pause");
- break;
- }
- cout << "You look through the file cabinet, and find a report on a series of tests run on small animals, it reads as follows" << endl << endl << " Dr. Alexandrov: " << endl << " Today we ran tests on 16 specimens, but specimen 1679 (21 day old mouse), and it began to shake uncontrollably and its eyes began to glow.\n After increasing the internal power (to 200000 Watts for a total of 4 seconds), The mouse almost burst. The mouse then ran into the walls of the box\n and fell onto its side. After de-contamination Titov pronounced it dead. Im looking forward to see another glowing in eyes of another \n specimen. After another specimen experiences the same effects, we'll have multiple records of this occurring " << endl;
- check1Search3 = true;
- system("pause");
- break;
- case 4:
- if(check1Search4 == true)
- {
- cout << " The trash can is empty from dumping the papers on the desk." << endl;
- system("pause");
- break;
- }
- cout << "You dump the crumpled up papers out on the desk, but dont find anything special" << endl;
- check1Search4 = true;
- system("pause");
- break;
- case 5:
- if(check1Search2 == false || check1Search3 == false)
- {
- cout << "You didn't check everywhere, are you sure you want to leave? (Y/N) : ";
- cin >> userYesNo;
- userYesNo = toupper(toupper(userYesNo));
- if(userYesNo == 'N')
- {
- break;
- }
- if(userYesNo == 'Y')
- {
- search1P1 = 1;
- break;
- }
- }
- else
- {
- search1P1 = 1;
- cout << "You leave the room back into the hallway" << endl;
- break;
- }
- break;
- default:
- system("cls");
- break;
- }
- }
- bool hasCrowbar = false;
- bool check2Search1 = false;
- bool check2Search2 = false;
- bool check2Search3 = false;
- while(search1P2 == 0)
- {
- system("cls");
- cout << " You enter the dark hallway and hear a deep grumble, ";
- cout << "You look around and see a crate, toolbox, and a chair." << endl;
- cout << "What would you like to do?" << endl;
- cout << "1: Open the crate" << endl << "2: Search the toolbox" << endl << "3: Examine the chair" << endl << "4: Walk down the hall back to Dr. Gregory and the rest of the team" << endl;
- cin >> choice;
- switch(choice)
- {
- case 1:
- if(check2Search1 == true)
- {
- if(hasCrowbar == false)
- {
- cout << "You attempt to pull the crate open again, but it will not budge" << endl;
- system("pause");
- break;
- }
- else
- {
- cout << "You pry the crate open with the crowbar, and search it. You find several cages with decayed mice inside" << endl;
- break;
- }
- cout << "You search the crate again, You find several cages with decayed mice inside. " << endl;
- break;
- }
- else
- {
- cout << "You try to pull the crate open, but fail. It will not open, you need a tool of some sort." << endl;
- break;
- }
- check2Search1 = true;
- break;
- case 2:
- if(check2Search2 == true)
- {
- cout << " You search the toolbox again but nothing else important is inside" << endl;
- system("pause");
- break;
- }
- cout << "You open the toolbox, and find a small crowbar. Maybe you can pry open the crate with it" << endl;
- hasCrowbar == true;
- check2Search2 = true;
- system("pause");
- break;
- case 3:
- cout << "You look at the chair, it is in bad condition. It looks very dangerous to sit in" << endl;
- if(check2Search2 == true)
- {
- cout << "The chair will break if you sit in it." << endl;
- system("pause");
- break;
- }
- check2Search3 = true;
- break;
- case 4:
- search1P2 = 1;
- break;
- }
- }
- cout << "You walk down the hall, and see the equiptment set up and some lights on" << endl;
- wait(5);
- cout << "But everyone is gone" << endl;
- wait(2);
- cout << "You hear the growl again" << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment