Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdlib>
- #include <limits>
- using namespace std;
- void divider(){
- cout << "\n------------------------------------------------------------------\n";
- }
- void gunChoose(string gun){
- cout << "You have chosen the " << gun << endl;
- }
- void pressContinue(){
- string temp;
- divider();
- cin.ignore();
- cin.ignore();
- }
- string introduction() { //Introduce storyline
- string playerName;
- string shipName;
- string introduction,introduction2, introduction3;
- string introduction4, introduction5;
- string divider = "\n------------------------------------------------------------------\n";
- cout << "What is your name? \n";
- cin >> playerName;
- cout << "Bot: Welcome. " << playerName << " I am here to give you details on a new mission assigned to you.\n"
- << "20 years ago, 2089: The Vatican defeats The Syndicate, a global world power trying to destroy Religion and place in power\n"
- << "a dictatorship under a man by the name of The Rook. After his defeat, he and his solder minions called the Pawns and the Buggers\n"
- << "ran into hiding. But now, he is planning a new revolution. The Pawns are weak creatures and the Buggers are stronger creatures\n"
- << "Throughout this mission, you will have to fight many of them. When you do encounter one, press 1 to fire a weapon at them\n"
- << "I warn you, this leaves you open to attack. If you are low on health, press 2 to heal up.\n";
- introduction = "I am your A.I Bot. I am here simply to guide you on your mission,\n";
- introduction2 = "The Vatican has ordered you to take your ship throughout the Galaxy in order to find the ancient key.\n";
- introduction3 = "This key will bring us access to the weapons of mass destruction, so we can spread Christianity throughout the Galaxy and defeat The\n";
- introduction4 = "Syndicate. In order to do this you must fight others in the search for the key, and solve puzzles ";
- introduction5 = "in order to find the key, you must find three separate parts. Enter the name of your vehicle to begin:\n ";
- cout << divider << introduction << introduction2 << introduction3 << introduction4 << introduction5 << endl;
- cin >> shipName;
- cout << "Bot: Very well, I hope the " << shipName << " is suitable for this mission.\n";
- return playerName;
- }
- void potionSelect(int& incHealth,int& incDamage,int& incShield,string& potion){
- string select;
- cout << "Select which potion you would like to bring on your journey. "
- << "You may only bring one.\n"
- << " a. Health\n b. Attack\n c. Shield\n";
- cin >> select;
- if (select == "a"){
- potion = "Health";
- incHealth = 5;
- } else if (select == "b"){
- potion = "Attack";
- incDamage = 1;
- } else if (select == "c"){
- potion = "Shield";
- incShield = 1;
- }
- //return increaseHealth,increaseDamage,increaseShield;
- }
- void pawnAttack(int& pawnHealth,int& gunDamage,int& health){ //Whenever a pawn attacks
- int random;
- int random1;
- int choose;
- divider();
- cout << "You have encountered a Pawn!\n"
- << "What are you going to do?\n(1-Use Gun, 2-Rest)";
- divider();
- while (pawnHealth > 0 && health > 0){ //While Loop
- random = (rand() % 4) + 2;
- cin >> choose;
- if (choose == 1){
- //random1 = (rand() % 4) + 3;
- cout << "Pawn lost " << gunDamage << " health\n";
- pawnHealth -= gunDamage;
- cout << "Pawn health: " << pawnHealth << endl;
- cout << "Your health: " << health << endl;
- divider();
- if (random == 3){
- health -= 4;
- pawnHealth += 2;
- cout << "Pawn attacked you.\nYou have " << health << " health now\n"
- << "Pawn healed up by 2\n"
- << "Pawn Health: "<< pawnHealth << endl
- << "Your Health: " << health << endl;
- divider();
- }
- } else if (choose == 2){
- health += 1; //Making it different from Bugger
- cout << "Health increased by 1" << endl;
- if (random == 3){ //Heal
- health += 2;
- cout << "You were lucky and gained an extra 2 in health\n";
- cout << "You have " << health << " health now\n";
- cout << "Pawn Health: " << pawnHealth << endl
- << "Your Health: " << health << endl;
- } else if (random == 2){ //Pawn attacks
- health -= 2;
- cout << "Pawn attacked you.\nYou have " << health << " health now\n";
- cout << "Pawn Health: " << pawnHealth << endl
- << "Your Health: " << health << endl;
- }
- }
- }
- divider();
- if (health <= 0){
- cout << "Game Over!\n";
- exit(0);
- } else if (pawnHealth <= 0){
- cout << "You have defeated the Pawn!\n";
- }
- health += 5;
- pawnHealth = 10;
- }
- void buggerAttack(int& buggerHealth,int& gunDamage,int& health){ //Whenever a Bugger attacks player
- int random;
- int random1;
- int choose;
- divider();
- cout << "You have encountered a Bugger!\n"
- << "What are you going to do?\n(1-Use Gun, 2-Rest)";
- divider();
- while (buggerHealth > 0 && health > 0){ //While Loop
- random = (rand() % 4) + 2;
- cin >> choose;
- if (choose == 1){
- cout << "Bugger lost " << gunDamage << " health\n";
- buggerHealth -= gunDamage;
- cout << "Bugger health: " << buggerHealth << endl;
- cout << "Your health: " << health << endl;
- divider();
- if (random == 3){
- health -= 3; //Bugger attacks player
- buggerHealth += 3;
- cout << "Bugger attacked you.\nYou have " << health << " health now\n"
- << "Bugger healed up by 3\n"
- << "Bugger Health: "<< buggerHealth << endl
- << "Your Health: " << health << endl;
- divider();
- }
- } else if (choose == 2){
- health += 2;
- cout << "Health boosted by 2" << endl;
- if (random == 2){ //Player has chosen to heal
- health += 3;
- cout << "You were lucky and gained an additional 3 health from resting\n";
- cout << "You have " << health << " health now\n"
- << "Bugger Health: "<< buggerHealth << endl
- << "Your Health: " << health << endl;
- } else if (random == 3){
- health -= 4; //Health Loss
- cout << "Bugger attacked you.\nYou have " << health << " health now\n"
- << "Bugger Health: "<< buggerHealth << endl
- << "Your Health: " << health << endl;
- } else {
- cout << "Nothing\n";
- }
- }
- }
- divider();
- if (health <= 0){
- cout << "Game Over!\n";
- exit(0);
- } else if (buggerHealth <= 0){
- cout << "You have defeated the Bugger!\n";
- }
- health += 5;
- buggerHealth = 15;
- }
- int Venus(int& pawnHealth, int& buggerHealth, int& gunDamage, int& health, int& key){ //If user inputs Venus
- int input; //Prompt user input
- cout << "Bot: . . . Initializing. . .\n"
- << "Now entering Venus Airstrip District 7\n";
- cout << "Bot: Analyzing landform. There are several harmful"
- << "entities across the barrier. Would you like to cross? (1-Yes, 2-No)\n";
- cin >> input;
- switch (input){ //Crossing the barrier
- case 1: //1-YES
- cout << "Crossing into Inner Venus\n";
- pawnAttack(pawnHealth,gunDamage,health);
- break;
- case 2: //2-NO
- cout << "Leaving Venus\n ";
- break;
- }
- pressContinue();
- cout << "Bot: We have to be careful. Venus is known to be one of the largest bases of The Syndicate\n"
- << "The key is here somewhere, but I am afraid we may have to cross some more pawns in the way\n";
- //pressContinue();
- cout << "Bot: Look! Three pathways.\n";
- int indicator = 0;
- while (indicator == 0){
- cout << "Where would you like to go?\n1.Path 1\n2.Path 2\n3.Path 3\n";
- int chosen;
- cin >> chosen;
- switch (chosen){
- case 1:
- //for (int i; i < 3; i++){
- pawnAttack(pawnHealth,gunDamage,health);
- pawnAttack(pawnHealth,gunDamage,health);
- //}
- buggerAttack(buggerHealth,gunDamage,health);
- cout << "Bot: All that for nothing huh. Let's go somewhere else.";
- pressContinue();
- break;
- case 2:
- cout << "Bot: Looks like you found a medkit.";
- cout << "Health boosted by 5";
- health += 5;
- pressContinue();
- cout << "Still no key parts.";
- pressContinue();
- break;
- case 3:
- //for (int i; i < 4; i++){
- pawnAttack(pawnHealth,gunDamage,health);
- //}
- cout << "You found another key part!\nMission Venus Complete!";
- key = 1;
- return key;
- indicator = 1;
- break;
- }
- }
- }
- int mars(int& pawnHealth, int& buggerHealth, int& gunDamage, int& health, int& key){
- int inputMars,responseCave1,responseCave2,responseCave3,letterAnalysis,caveIndicator;
- cout << "Bot: . . . Initializing. . .\n";
- cout << "Now entering Mars landing zone. 7\n";
- cout << "Bot: It is best to start with searching with the main cave on Mars\n";
- caveIndicator = 0;
- while (caveIndicator == 0){ // helps sey cave 3 as the correct cave to search
- cout << "\tPlease enter: 1 - Right; 2 - Left; 3 - Straight Forward\n";
- cin >> responseCave1; // searching the cave
- switch (responseCave1) { // gives the options for the other caves
- case 1:
- cout << "Bot: The tunnel to the right is filled with dangerous entities\n";
- cout << "Bot: There was a dangerous alien pawn thing. I think it wants to fight.\n";
- cout << "You: Not on my christian minecraft server!";
- pawnAttack(pawnHealth,gunDamage,health);
- cout << "You defeat the dangerous entity, but this cave is a dead end\n";
- break;
- case 2:
- cout << "Bot: The room is cave is full scattered papers, but only three stand out.\n";
- cout << "\n -------------------------------------------------------- \n";
- cout << "You grab the the three papers, which do you read first?\n";
- cout << "The first paper states:\n";
- cout << "\t GOing ThrOugh THE tunnel.\n";
- cout << "The second paper states:\n";
- cout << "\tTesting tHese clues In the Rigid tunnel Doors\n";
- cout << "The third and final Paper states:\n";
- cout << "\t Determined tO find the correct doOR.";
- cout << "\n --------------------------------------------------------- \n";
- cout << "Bot: There seem to be a code in these letters, You should test the 1 - capital letters or 2 - lowercase letters\n" << endl;
- cin >> letterAnalysis;
- if (letterAnalysis == 1) {
- cout << "You: The capital letters seem to form a phrase.\n";
- cout << "Bot: The phrase is: GO TO THE THIRD DOOR\n";
- cout << "You: Since the third option is the middle door, we should try that next!\n";
- }
- else if (letterAnalysis == 2) {
- cout << "Bot: There are way to many letters for this to be a code\n"
- << "Bot: We should try the upper case letters.";
- cout << "You: The capital letters seem to form a phrase.\n";
- cout << "Bot: The phrase is: GO TO THE THIRD DOOR";
- cout << "You: Since the third option is the middle door, we should try that next!";
- }
- break;
- case 3:
- cout << "Bot: This appears to be the correct cave, but there is a pawn guarding the peice of the key.\n";
- pawnAttack(pawnHealth,gunDamage,health);
- cout << "Bot: The pawn dropped 2 medkits, but now there is a bugger coming!";
- cout << "You quickly use the medkit before begining the fight with the bugger.";
- health += 5; // value of one medkit because you lose the value of one medkit later
- cout << "You gained 10 health!";
- cout << "The bugger attacks as you use the medkits, and you lose 5 of the 1 health you just gained.";
- buggerAttack(buggerHealth,gunDamage,health); divider();
- cout << "Bot: You defeated the bugger and discovered part of the key!";
- caveIndicator == 1; // ends loop after finding key
- key = 1;
- return key;
- break;
- }
- }
- }
- int plusGun(int& gunDamage){
- gunDamage += 2;
- return gunDamage;
- }
- int Jupiter(string name, int& buggerHealth, int& gunDamage, int& health, int& key, int& pawnHealth){
- int select;
- cout << "Jupes: Welcome to Jupiter!" << name << " Please accept our hospitality.";
- divider();
- pressContinue();
- cout << "There are many dangerous creatures out there. I am not sure if you would like to venture\n"; pressContinue();
- cout << "but we do know your duties to your country and your Religion.\n"; pressContinue();
- cout << "We also want to show our appreciation for what your father did for us many years ago\n"
- << "He killed off millions of buggers and pawns off our planet years ago, which helped us to\n"
- << "thrive and prosper for many years to come, even though they still lived. As a token of appreciation, let us upgrade your gun\n"; divider();
- cout << "Bot: Would you like these Jupiterians to upgrade your gun? (1-Yes, 2-No)\n";
- cin >> select;
- if (select == 1){
- plusGun(gunDamage);
- cout << "Very well. ABDUL! Come upgrade this man's gun immediately!\n";
- } else if (select == 2){
- cout << "That is fine with us. It is an offer, not a force feed.\n"
- << "Good luck on your journey!\n"; divider();
- }
- cout << "Jupes: Be safe my friend. Here, take this. It is a Jupiter Emerald. It will keep you safe.\n"; divider();
- int indicator = 0;
- while (indicator == 0){
- cout << "Bot: This place is scary! Based on this map, there are three places you can go.\n"
- << "1. Devil's Temple\n2. Florida\n3. Meridian Oasis\nChoose one!";
- cin >> select;
- switch(select){
- case 1:
- indicator = 1;
- buggerAttack(buggerHealth,gunDamage,health); divider();
- cout << "Bot: Look! You found another part of the key!\n";
- key = 1;
- return key;
- cout << "Bot: Mission Jupiter complete!"; //KEY FOUND
- pressContinue();
- break;
- case 2:
- divider();
- cout << "Bot: Very eerie place and lots of people!\n"
- << "Watch out for Pawns here. I heard there are a lot.\n"; pressContinue();
- pawnAttack(pawnHealth,gunDamage,health);
- cout << "Bot: Ugh.Nothing here! We need to go to a different place.\n\n";
- break;
- case 3:
- divider();
- cout << "This place seems peaceful.\n";
- pressContinue();
- cout << "Wow! Look a chest! Let's open it!\n";
- pressContinue();
- cout << "You found an M16!! Would you like to swap with your old gun?\n(1-Yes, 2-No)";
- int userInput;
- cin >> userInput;
- if (userInput == 1){
- gunDamage == 3.5;
- cout << "Gun updgraded\n";
- } else {
- cout << "Gun Discarded.\n";
- }
- cout <<"Bot: Let's keep moving. We don't want to lose track of time.\n";
- pressContinue();
- pawnAttack(pawnHealth,gunDamage,health);
- cout << "Rats! Key parts are nowhere to be found. But in the meanwhile "
- << "There is this medkit. I would advise you use it. (1-Take The Meds 2-Discard the Meds)";
- cin >> userInput;
- if (userInput == 1){
- health += 5;
- cout << "Health increased by 5\n";
- } else {
- cout << "Medkit Discarded\n";
- }
- cout << "Bot: Let's move!\n";
- break;
- }
- }
- }
- void endGame(int& keyVenus,int& keyMars,int& keyJupiter){
- int sum = keyVenus + keyJupiter + keyMars;
- if (sum == 3){
- cout << "Congratulations, you've won the game! You found all three parts of the Key";
- exit(0);
- }
- }
- int main(){
- string gun;
- string armor;
- string shield;
- string potion;
- string medkit;
- string select;
- int health = 25; //Health
- int gunDamage; //How much damage the weapon will inflict upon the enemy
- int armorStrength;
- int shieldStrength;
- int attack;
- int pawnHealth = 10; int buggerHealth = 20;
- string playerName;
- int increaseDamage;
- int increaseHealth;
- int increaseShield;
- int sum;
- introduction(); //Displays Intro
- divider();
- cout << "Bot: First things first, we must provide you with the proper equipment\n"
- << "Choose a type of gun\n a. AK47\n b. P90\n c. RheinmetallMG\n d. M4\n";
- string gunChoice;
- cin >> gunChoice;
- if (gunChoice == "a"){
- gun = "AK47";
- gunDamage = 1;
- gunChoose(gunChoice);
- } else if (gunChoice == "b"){
- gun = "P90";
- gunDamage = 2;
- gunChoose(gunChoice);
- } else if (gunChoice == "c"){
- gun = "RheinmetalMG";
- gunDamage = 2.2;
- gunChoose(gunChoice);
- } else if (gunChoice == "d"){
- gun = "M4";
- gunDamage = 2.5;
- gunChoose(gun);
- }
- int keyVenus = 0;
- int keyJupiter = 0;
- int keyMars = 0;
- divider();
- potionSelect(increaseHealth,increaseDamage,increaseShield,potion);
- cout << "Bot: Very well! You are all set for the journey."
- << "I will be assisting you at all times.\n";
- while (select != "Exit"){
- endGame(keyVenus,keyMars,keyJupiter);
- divider();
- cout << "What planet would you like to visit?\n"
- << " a. Venus\n b. Mars\n c. Jupiter\n d. Mercury\n ";
- cin >> select;
- divider();
- if (select == "a"){
- Venus(pawnHealth,buggerHealth,gunDamage,health,keyVenus);
- if(health == 0){
- break;
- }
- } else if (select == "b"){
- mars(pawnHealth, buggerHealth, gunDamage, health, keyMars);
- } else if (select == "c"){
- Jupiter(playerName,buggerHealth,gunDamage,health,keyJupiter,pawnHealth);
- if(health == 0){
- break;
- }
- } else if (select == "d"){
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement