Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <windows.h>
- #include <stdbool.h>
- #include <string.h>
- void PrintTitle();
- void LoopCheck1(bool scream, bool cabins, bool kitchen);
- void LoopCheck2(bool cans, bool cabins, bool paper);
- int main(void)
- {
- char playerName [100];
- unsigned int timeCounter = 0;
- unsigned int screamCounter = 0;
- clock_t start_t, end_t, total_t;
- bool gotIDcard = false;
- bool closedDoor = false;
- bool leftFirstRoom = false;
- bool checkedCabins = false;
- bool checkedKitchen = false;
- bool checkedCans = false;
- bool checkedPaper = false;
- bool checkedScream = false;
- bool goToNavi = false;
- bool gameOver = false;
- PrintTitle();
- Sleep(1000);
- srand(time(0));
- //0
- start_t = clock();
- printf("What's your name?\n>>");
- scanf("%[^\n]", &playerName);
- printf("\n");
- //1
- Sleep(2000);
- printf("Drip...");
- Sleep(1000);
- printf("\nDrip...");
- Sleep(1000);
- printf("\n\n%s, wake up! A drop fell onto your forehead and you need a moment to recognize it properly. Fuck. Fuck! Now, you are definitely awake. You are working in a submarine and a lot of things can happen there; water that comes from the ceiling isn't one of the acceptable ones.", &playerName);
- Sleep(1000);
- printf("\n\nWhat will you do?\nScream - You scream until one of your crewmates comes to help you\nWeapon - You search for your weapon\nRun - You get out of this room immediately\nID - You search for your ID card\n>>");
- char decS1 [20];
- scanf("%s", &decS1);
- unsigned int dec1;
- bool inputWait = true;
- do {
- if (strcmp(decS1, "Scream") == 0 || strcmp(decS1, "scream") == 0)
- {
- dec1 = 1;
- inputWait = false;
- }
- else if (strcmp(decS1, "Weapon")== 0 || strcmp(decS1, "weapon") == 0)
- {
- dec1 = 2;
- inputWait = false;
- }
- else if (strcmp(decS1, "Run")== 0 || strcmp(decS1, "run") == 0)
- {
- dec1 = 3;
- inputWait = false;
- }
- else if (strcmp(decS1, "ID")== 0 || strcmp(decS1, "id") == 0)
- {
- dec1 = 4;
- inputWait = false;
- }
- else if (strcmp(decS1, "secret")== 0 || strcmp(decS1, "Secret") == 0)
- {
- printf("\n\nYou found the secret area. It's very mysterious. Don't tell anybody.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS1);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS1);
- }
- }
- }while(inputWait);
- //2
- char decS2 [20];
- unsigned int dec2;
- if (dec1 == 1)
- {
- timeCounter++;
- screamCounter++;
- int r = rand() % 100;
- if (r <= 50)
- {
- printf("\n\"WATER! HELP!\" No response. You scream again but nothing happens. Is nobody here anymore?\n\nA crack. More water. Fuck. You need to get out of here - quick! You stand up and get out of the room.");
- Sleep(1000);
- printf("\n\nClose - You close the door behind you\nRun - You can't waste any more time and hurry up\n>>");
- }
- else
- {
- printf("\n\"HELP ME! HELP!\" Nothing. You scream again but nobody seems to hear it.\n\nSuddenly a crack. More water. Fuck. You need to get out of here - now! You stand up quickly and get out of the room.");
- Sleep(1000);
- printf("\n\nClose - You close the door behind you\nRun - You can't waste any more time and hurry up\n>>");
- }
- inputWait = true;
- scanf("%s", &decS2);
- do {
- if (strcmp(decS2, "Close") == 0 || strcmp(decS2, "close") == 0)
- {
- closedDoor = true;
- leftFirstRoom = true;
- dec2 = 1;
- inputWait = false;
- }
- else if (strcmp(decS2, "Run")== 0 || strcmp(decS2, "run") == 0)
- {
- dec2 = 2;
- leftFirstRoom = true;
- inputWait = false;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS2);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS2);
- }
- }
- }while(inputWait);
- }
- //3
- char decS3 [20];
- unsigned int dec3;
- if (dec1 == 2)
- {
- timeCounter++;
- printf("\nYou search for your laser pistol, but it is not in the place where you left it. \n\nSuddenly a crack above you. More water. Fuck. You need to get out of here - now! You stand up quickly and get out of the room.");
- Sleep(1000);
- printf("\n\nClose - You close the door behind you\nRun - You can't waste any more time and hurry up\n>>");
- inputWait = true;
- scanf("%s", &decS3);
- do {
- if (strcmp(decS3, "Close") == 0 || strcmp(decS3, "close") == 0)
- {
- closedDoor = true;
- leftFirstRoom = true;
- dec3 = 1;
- inputWait = false;
- }
- else if (strcmp(decS3, "Run")== 0 || strcmp(decS3, "run") == 0)
- {
- dec3 = 2;
- leftFirstRoom = true;
- inputWait = false;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS3);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS3);
- }
- }
- }while(inputWait);
- }
- //4
- char decS4 [20];
- unsigned int dec4;
- if (dec1 == 3)
- {
- end_t = clock();
- total_t = (double)(end_t - start_t) / CLOCKS_PER_SEC;
- if (total_t <= 20)
- {
- printf("\nYou leave the room. Water can be dangerous especially in a submarine. As you look around for other guys in front of the room you hear a crack behind you.");
- }
- else
- {
- printf("\nYou leave the room immediately. As you look around for other guys in front of the room you hear a crack behind you.");
- }
- Sleep(1000);
- printf("\n\nClose - You close the door behind you\nRun - You can't waste any more time and hurry up\n>>");
- inputWait = true;
- scanf("%s", &decS4);
- do {
- if (strcmp(decS4, "Close") == 0 || strcmp(decS4, "close") == 0)
- {
- closedDoor = true;
- leftFirstRoom = true;
- dec4 = 1;
- inputWait = false;
- }
- else if (strcmp(decS4, "Run")== 0 || strcmp(decS4, "run") == 0)
- {
- dec4 = 2;
- leftFirstRoom = true;
- inputWait = false;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS4);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS4);
- }
- }
- }while(inputWait);
- }
- //5
- char decS5 [20];
- unsigned int dec5;
- if (dec1 == 4)
- {
- timeCounter++;
- printf("\nYou search for your ID card and find it relatively fast. As you put it in your pocket you hear a crack above you. You need to get out of here - fast! You stand up quickly and get out of the room.");
- gotIDcard = true;
- Sleep(1000);
- printf("\n\nClose - You close the door behind you\nRun - You can't waste any more time and hurry up\n>>");
- inputWait = true;
- scanf("%s", &decS5);
- do {
- if (strcmp(decS5, "Close") == 0 || strcmp(decS5, "close") == 0)
- {
- closedDoor = true;
- leftFirstRoom = true;
- dec5 = 1;
- inputWait = false;
- }
- else if (strcmp(decS5, "Run")== 0 || strcmp(decS5, "run") == 0)
- {
- dec5 = 2;
- leftFirstRoom = true;
- inputWait = false;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS5);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS5);
- }
- }
- }while(inputWait);
- }
- //6 & 7
- char decS6 [20];
- unsigned int dec6 = 0;
- if (leftFirstRoom == true)
- {
- if (closedDoor)
- {
- timeCounter++;
- printf("\nYou close the door. The water shouldn't get to the rest of the rooms. Hopefully. From here you could get to the kitchen to the right, go to the cabins of your mates and look in each and every one or get to the inertial navigation system far in front of you.\n\n");
- Sleep(1000);
- }
- else
- {
- printf("\nWhere do you want to go? The kitchen is on the right, the inertial navigation system in front of you or you could search for your mates in the cabins. \n\n");
- Sleep(1000);
- }
- printf("Scream - You scream for help\nCabins - Search for your mates in the cabins\nNavigation - Get to the inertial navigation system\nKitchen - Get to the kitchen\n>>");
- inputWait = true;
- scanf("%s", &decS6);
- do {
- if (strcmp(decS6, "Scream") == 0 || strcmp(decS6, "scream") == 0)
- {
- dec6 = 1;
- screamCounter++;
- inputWait = false;
- }
- else if (strcmp(decS6, "Cabins")== 0 || strcmp(decS6, "cabins") == 0)
- {
- dec6 = 2;
- inputWait = false;
- }
- else if (strcmp(decS6, "Navigation")== 0 || strcmp(decS6, "navigation") == 0)
- {
- dec6 = 3;
- inputWait = false;
- }
- else if (strcmp(decS6, "Kitchen")== 0 || strcmp(decS6, "kitchen") == 0)
- {
- dec6 = 4;
- inputWait = false;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS6);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS6);
- }
- }
- }while(inputWait);
- }
- // NEW NAVI LOOP
- char decS7 [20];
- unsigned int dec7 = 0;
- do
- {
- // 8
- if ((dec6 == 1 || dec7 ==1) && !checkedScream)
- {
- checkedScream = true;
- timeCounter++;
- screamCounter++;
- printf("\nYou scream. No reaction.\n");
- Sleep(1000);
- LoopCheck1(checkedScream, checkedCabins, checkedKitchen);
- inputWait = true;
- }
- // 9
- else if ((dec6 == 2 || dec7 == 2) && !checkedCabins)
- {
- checkedCabins = true;
- timeCounter += 4;
- printf("\nYou run into every cabin but nobody is there. Only the blank racks. Not even Martin the fucking air breather is there anymore.\n");
- Sleep(1000);
- if (!closedDoor)
- {
- printf("\nAs you move back to the corridor you see that there is water on the floor which is coming from your cabin. You need to get to the navigation room ASAP.");
- Sleep(1000);
- printf("\n\nNavigation - Get to the inertial navigation system\n\n>>");
- checkedScream = true;
- }
- else if(checkedKitchen)
- {
- Sleep(1000);
- LoopCheck2(checkedCans, checkedCabins, checkedPaper);
- }
- else
- {
- Sleep(1000);
- LoopCheck1(checkedScream, checkedCabins, checkedKitchen);
- }
- inputWait = true;
- }
- // 10
- else if (dec6 == 3 || dec7 == 3)
- {
- goToNavi = true;
- }
- // 11
- else if ((dec6 == 4 || dec7 == 4) && !checkedKitchen)
- {
- checkedKitchen = true;
- timeCounter += 2;
- printf("\nYou get to the kitchen but nobody is here. Only some cans, but there's a piece of paper under a one of them.\n");
- Sleep(1000);
- if (!closedDoor)
- {
- printf("\nBut the water spills over the entry of your room. You need to get to the navigation room immediately.");
- Sleep(1000);
- printf("\n\nNavigation - Get to the inertial navigation system\n\n>>");
- inputWait = true;
- }
- else
- {
- LoopCheck2(checkedCans, checkedCabins, checkedPaper);
- inputWait = true;
- }
- }
- // 12
- else if (dec7 == 5 && !checkedCans)
- {
- checkedCans = true;
- timeCounter++;
- printf("%s, you are amazed. Such cans. Much food. Wow.\n", playerName);
- Sleep(1000);
- LoopCheck2(checkedCans, checkedCabins, checkedPaper);
- inputWait = true;
- }
- // 13
- else if (dec7 == 6 && !checkedPaper)
- {
- checkedPaper = true;
- timeCounter++;
- printf("\nThe paper reads: If you lost your ID card the code is: GetTheFuckOutOfHere.\nGood to know.\n");
- Sleep(1000);
- LoopCheck2(checkedCans, checkedCabins, checkedPaper);
- inputWait = true;
- }
- if (inputWait)
- {
- scanf("%s", &decS7);
- do {
- if ((strcmp(decS7, "Scream")== 0 || strcmp(decS7, "scream") == 0) && !checkedScream)
- {
- dec7 = 1;
- inputWait = false;
- }
- else if ((strcmp(decS7, "Cabins")== 0 || strcmp(decS7, "cabins") == 0) && !checkedCabins)
- {
- dec7 = 2;
- inputWait = false;
- }
- else if (strcmp(decS7, "Navigation")== 0 || strcmp(decS7, "navigation") == 0)
- {
- dec7 = 3;
- inputWait = false;
- }
- else if ((strcmp(decS7, "Kitchen")== 0 || strcmp(decS7, "kitchen") == 0) && !checkedKitchen)
- {
- dec7 = 4;
- inputWait = false;
- }
- else if ((strcmp(decS7, "Cans")== 0 || strcmp(decS7, "cans") == 0) && !checkedCans)
- {
- dec7 = 5;
- inputWait = false;
- }
- else if ((strcmp(decS7, "Look")== 0 || strcmp(decS7, "look") == 0) && !checkedPaper)
- {
- dec7 = 6;
- inputWait = false;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS7);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS7);
- }
- }
- }while(inputWait);
- }
- }while(!goToNavi);
- //10
- char decS10 [20];
- unsigned int dec10 = 0;
- printf("\nYou get to the inertial navigation system, but nobody is here, not even the Chief of the Boat. How is it possible that nobody is here?");
- Sleep(1000);
- printf("\n\nScream - Maybe somebody will hear you?\nBlow - Get to the emergency blow system to get the damn boat up\n>>");
- inputWait = true;
- scanf("%s", &decS10);
- do {
- if (strcmp(decS10, "Scream") == 0 || strcmp(decS10, "scream") == 0)
- {
- dec10 = 1;
- screamCounter++;
- inputWait = false;
- }
- else if (strcmp(decS10, "Blow")== 0 || strcmp(decS10, "blow") == 0)
- {
- dec10 = 2;
- inputWait = false;
- }
- else
- {
- int stringlength;
- stringlength = strlen(decS10);
- if (stringlength >= 1)
- {
- fflush(stdin);
- printf("Try again\n>>");
- stringlength = 0;
- scanf("%s", &decS10);
- }
- }
- }while(inputWait);
- //14
- unsigned int dec14;
- char decS14 [20];
- char password [20];
- bool rightPassword;
- if (dec10 == 1)
- {
- timeCounter++;
- if (screamCounter >= 2)
- {
- printf("\nIf this was a Steam game you would get an achievement for being that dumb idiot that screams all the time. Grow some balls %s. Okay. Okay. This is the end. You screamed too much and now there is no oxygen left. Bye bye.", playerName);
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- else
- {
- printf("\nNo reaction. It seems that nobody is here anymore. You go to the emergency blow system. You need to get the fuck out of here.\nThe monitor says that you need your ID card to access the terminal.");
- if (gotIDcard)
- {
- printf("\nYou put your ID card on the space for it and it immediately works. Yeah!");
- Sleep(1000);
- printf("\n\nYou feel how the submarine rises to the surface of the water of this damn planet. It's a bit shaky but you are glad that you're alive. You get out of the submarine and look around. Ice. Everywhere. Fuck.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- else
- {
- Sleep(1000);
- printf("\n\nBut you don't have it. There is also the last option: An emergency password.\nType it:\n>>");
- scanf("%s", &password);
- if (strcmp(password, "GetTheFuckOutOfHere") == 0)
- {
- rightPassword = true;
- }
- else
- {
- rightPassword = false;
- }
- }
- }
- }
- bool rightPassword2;
- //15
- if (dec10 == 2)
- {
- printf("\nThe monitor of the emergency blow system says that you need your ID card to access the terminal. ");
- if (gotIDcard)
- {
- printf("\n\nYou put your ID card on the space for it and it immediately works. Yeah!");
- Sleep(1000);
- printf("\n\nYou feel how the submarine rises to the surface of the water of this damn planet. It's a bit shaky but you are glad that you live. You get out of the submarine and look around. Ice. Everywhere. Fuck.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- else
- {
- Sleep(1000);
- printf("\n\nBut you don't have it. There is also the last option: An emergency password.\nType it:\n>>");
- scanf("%s", &password);
- if (strcmp(password, "GetTheFuckOutOfHere") == 0)
- {
- rightPassword = true;
- }
- else
- {
- rightPassword = false;
- }
- }
- }
- //16
- bool timeLeft = true;
- if (rightPassword)
- {
- if (checkedPaper)
- {
- printf("\nYou feel how the submarine rises to the surface of the water of this damn planet. It's a bit shaky but you are glad that you live. You get out of the submarine and look around. Ice. Everywhere. Fuck.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- else
- {
- printf("\nYou can't know the password. Cheater! A big whale eats the submarine! Don't cheat.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- }
- else
- {
- //17
- do
- {
- printf("\nYou typed it wrong! Oh no! But you can try it again!\n>>");
- scanf("%s", &password);
- if (strcmp(password, "GetTheFuckOutOfHere") == 0)
- {
- rightPassword = true;
- }
- else
- {
- rightPassword = false;
- }
- timeCounter += 2;
- if ((timeCounter <= 7 && !closedDoor) || (timeCounter <= 10 && closedDoor))
- {
- timeLeft = true;
- }
- else
- {
- timeLeft = false;
- }
- }while (timeLeft && !rightPassword);
- // LAST TRY
- if (!rightPassword)
- {
- printf("\nYou don't have much time left. You can try it one last time! The water rises!\n>>");
- scanf("%s", &password);
- if (strcmp(password, "GetTheFuckOutOfHere") == 0)
- {
- rightPassword = true;
- }
- else
- {
- rightPassword = false;
- }
- }
- // RIGHT PASSWORD
- if (rightPassword)
- {
- if (checkedPaper)
- {
- printf("\nYou feel how the submarine rises to the surface of the water of this damn planet. It's a bit shaky but you are glad that you live. You get out of the submarine and look around. Ice. Everywhere. Fuck.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- else
- {
- printf("\nYou can't know the password. Cheater! A big whale eats the submarine! Don't cheat.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- }
- else
- //WRONG PASSWORD
- {
- printf("\nNo time left. The water rises and the electricity isn't working anymore. It's dark and wet and the water is constantly rising. You die. Oh no.");
- Sleep(2000);
- printf("\n\n");
- system("pause");
- return 0;
- }
- }
- }
- void PrintTitle()
- {
- Sleep(500);
- printf("\n .o88b. db db d8888b. .88b d88. .d8b. d8888b. d888888b d8b db d88888b \n");
- Sleep(50);
- printf(" d8P Y8 88 88 88 `8D 88'YbdP`88 d8' `8b 88 `8D `88' 888o 88 88' \n");
- Sleep(50);
- printf(" 8P 88 88 88oooY' 88 88 88 88ooo88 88oobY' 88 88V8o 88 88ooooo \n");
- Sleep(50);
- printf(" 8b 88 88 88~~~b. 88 88 88 88~~~88 88`8b 88 88 V8o88 88~~~~~ \n");
- Sleep(50);
- printf(" Y8b d8 88b d88 88 8D 88 88 88 88 88 88 `88. .88. 88 V888 88. \n");
- Sleep(50);
- printf(" `Y88P' ~Y8888P' Y8888P' YP YP YP YP YP 88 YD Y888888P VP V8P Y88888P \n");
- Sleep(50);
- printf(" -----------------------------------------------------------------------\n\n");
- Sleep(50);
- printf(" |`-:_\n");
- Sleep(50);
- printf(" ,----....____ | `+.\n");
- Sleep(50);
- printf(" ( ````----....|___ |\n");
- Sleep(50);
- printf(" \\ _ ````----....____\n");
- Sleep(50);
- printf(" \\ _) ```---.._\n");
- Sleep(50);
- printf(" \\ \\\n");
- Sleep(50);
- printf(" )`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`.\n");
- Sleep(50);
- printf(" -' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `\n\n");
- Sleep(50);
- printf(" -----------------------------------------------------------------------\n\n");
- Sleep(50);
- printf(" A game by Angela Reinert | @MadameYavi\n Text: Daniel da Silva | @SmokeSomeFrogs\n Testing:\n Daniel da Silva | @SmokeSomeFrogs\n Devon Wolters | @DevonWolters\n Luca Koster | @murmeltiertage\n\n");
- Sleep(50);
- printf(" -----------------------------------------------------------------------\n\n");
- Sleep(50);
- }
- void LoopCheck1(bool scream, bool cabins, bool kitchen)
- {
- if (!scream)
- {
- printf("\nScream - You scream for help");
- }
- if (!cabins)
- {
- printf("\nCabins - Search for your mates in the cabins");
- }
- printf("\nNavigation - Get to the inertial navigation system");
- if (!kitchen)
- {
- printf("\nKitchen - Get to the kitchen");
- }
- printf("\n\n>>");
- }
- void LoopCheck2(bool cans, bool cabins, bool paper)
- {
- if (!cans)
- {
- printf("\nCans - Look at the nice cans");
- }
- if (!paper)
- {
- printf("\nLook - Look at the piece of paper");
- }
- printf("\nNavigation - Get to the inertial navigation system");
- if (!cabins)
- {
- printf("\nCabins - Go to the cabins");
- }
- printf("\n\n>>");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement