/********************************************************************** * ESCAPE * *********************************************************************** * Michael D. McKinney * September 28, 2022 * Updated December 11, 2023 - fixed typos and changed debug to be * disabled by default. * Updated May 11, 2024 - fixed typos. * * A simple text adventure game that showcases the elements of a text * adventure game such as movement, inventory, game states, clearing of * screen, saving and loading save files, debugging/debug mode, etc. * * There are five rooms in this text adventure. * * To enable debug mode - make sure the debug flag is set to 1, then type * "xyzzy" at any time during the game. * * To save/load game, type "save" or "load" at any time during the game. * (Save files generated by this game is compatible with Python3 version * of Escape.) * * I have tried to anticipate everything a player could type in the game * and developed a response for each potential input. * * Walkthrough - E, TAKE PAPER, PRESS YELLOW, PRESS GREEN, W, N, OPEN PANEL, * PRESS BLACK, CLOSE PANEL, S, S, TAKE PLANTER, TAKE BRASS, TAKE RUBBISH, * OPEN PANEL, PRESS RED, PRESS BLUE, CLOSE PANEL, N, E, OPEN BOX, TAKE KEY, * CLOSE BOX, PRESS YELLOW, PRESS GREEN, W, N, OPEN PANEL, PRESS BLACK, * CLOSE PANEL, OPEN BOX WITH ALUMINUM KEY, TAKE BATTERIES, S, S, OPEN PANEL, * PRESS BLUE, CLOSE PANEL, N, E, OPEN BOX, PRESS YELLOW, W, * INSERT BATTERIES INTO FLASHLIGHT, W, TURN FLASHLIGHT ON, * OPEN BOX WITH BRASS KEY, TAKE KEY, CLOSE BOX, TURN FLASHLIGHT OFF, E, E, * CLOSE BOX, PRESS YELLOW, PRESS GREEN, W, N, UNLOCK GATE WITH IRON, N. * */ //INCLUDES #include #include #include #include // UNCOMMENT IF COMPILING FOR WINDOWS //#include /********************************************************************** * DEBUG FLAG * **********************************************************************/ // 0 = DISABLED, 1 = ENABLED. ENTER XYZZY AT ANY TIME DURING THE GAME // TO ACCESS THE DEBUG MENU. int debug = 0; /********************************************************************** * INITIALIZING ROOMS AND STUFF * **********************************************************************/ int main(); void opening(); void centerRoom(); void eastRoom(); void northRoom(); void southRoom(); void westRoom(); void inputHandler(); void endgame(); void playerinventory(); void debugmode(); void saveGame(); void loadGame(); char rawinput[50]; int len; /********************************************************************** * SCREEN SIZE ADJUSTMENTS * **********************************************************************/ void screensize() { // WINDOWS #ifdef _WIN32 ShowWindow( GetConsoleWindow() , SW_MAXIMIZE); #endif // UNIX/LINUX #ifdef __unix__ fputs("\x1b[8;50;132t", stdout); #endif // MACOS #ifdef __APPLE__ fputs("\x1b[8;50;132t", stdout); #endif } /********************************************************************** * CLEAR SCREEN FUNCTION * **********************************************************************/ void clearscreen() { // WINDOWS #ifdef _WIN32 system("cls"); #endif // UNIX/LINUX #ifdef __unix__ system("clear"); #endif // MACOS #ifdef __APPLE__ system("clear"); #endif } /********************************************************************** * CLEAN RAW INPUT (REMOVE "\n" FROM STRING & MAKE STRING LOWER CASE) * **********************************************************************/ char *CleanRawInput(char *rawinput, int len) { char *input = malloc(sizeof(char) * len); // CONVERTING INPUT TO LOWER CASE for (int i = 0; i < len; ++i) { input[i] = tolower((unsigned char)rawinput[i]); } // STRIPPING "\n" OUT OF STRING BY REPLACING IT WITH \0. input[strcspn (input, "\n")] = '\0'; return input; } /********************************************************************** * GAME STATES * **********************************************************************/ // roomid - 1-5 (1 = Center Room, 2 = East Room, 3 = West Room, // 4 = South Room, and 5 = North Room. 0 = Opening, 6 = Ending.) // northdoor, southdoor, eastdoor, westdoor - 0 (locked) or 1 (unlocked). // steelbox, titaniumbox and tungstengate - 0 (locked) or 1 (unlocked/open) // bronzebox - 0 (closed/locked), 1 (closed/unlocked) or 2 (open) // northaccesspanel - 0 (closed) or 1 (open) // southaccesspanel - 0 (closed/locked), 1 (closed/unlocked) or 2 (open) // deadplant and planter - 0 (still intact) or 1 (crumbled) // flashlighton - 0 (off) or 1 (on) // flashlight batteries - 0 (not inserted) or 1 (inserted) // escaped - 0 (not escaped) or 1 (escaped) // emptyinventory - 0 (holding at least one item) or 1 (nothing in inventory) int roomid = 0; int northdoor = 0; int southdoor = 0; int eastdoor = 1; int westdoor = 0; int bronzebox = 0; int northaccesspanel = 0; int steelbox = 0; int southaccesspanel = 1; int deadplant = 0; int planter = 0; int flashlighton = 0; int flashlightbatteries = 0; int titaniumbox = 0; int tungstengate = 0; int escaped = 0; int emptyinventory = 1; /********************************************************************** * INVENTORY STATES * **********************************************************************/ int paper = 0; int brasskey = 0; int aluminumkey = 0; int ironkey = 0; int flashlight = 0; int batteries = 0; /********************************************************************** * MAIN * **********************************************************************/ int main() { // ADJUSTING SCREEN SIZE, CLEARING THE SCREEN, AND // ENSURING GAME BEGINS AT TOP OF THE SCREEN. screensize(); printf("\n"); clearscreen(); // GAME BEGINS HERE opening(); } /********************************************************************** * OPENING * **********************************************************************/ void opening() { clearscreen(); // OPENING printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t ESCAPE\n"); printf("\t\t-----------------------------------------------"); roomid = 0; printf("\n\n\nSomehow you have ended up in this strange area."); printf("\n\nYou have no recollection of how you ended up in " "here, but you do \nknow that you need to escape."); printf("\n\nCan you escape?"); printf("\n\n\n\n\n\n\nPress enter to begin the game or type " "\"HELP\" and press enter to see \ninstruction on how " "to interact with the game.\n\n"); for(;;) { // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); // PLAYER WANTED TO SEE INSTRUCTION ("HELP") if (strcmp(input, "help") == 0) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t ESCAPE\n"); printf("\t\t-----------------------------------------------"); printf("\n\nEscape is a text advetnure game. You type what " "you would like to do.\n"); printf("\nHere is a list of commands you can type in the " "game:\n"); printf("LOOK, TAKE, PRESS, PUSH, SEARCH, INSERT, OPEN, " "CLOSE, TURN ON,"); printf("\nTURN OFF, USE, UNLOCK"); printf("\n\nSome examples of commands:\nLOOK DIAMOND, " "TAKE DIAMOND, OPEN BOX WITH KEY, TURN ON LANTERN," "\nINSERT COIN INTO TUBE"); printf("\n\nAvoid using words such as \"the\", \"a\", \"an\", " "and \"at.\" Keep it simple."); printf("\n\nType \"n\" or \"north\", \"s\" or \"south\", \"e\" " "or \"east\", and \"w\" or \"west\" \nto go to the room in" " that direction."); printf("\n\nType \"inventory\" or \"i\" to see your inventory " "at any time."); printf("\n\nType \"save\" or \"load\" to save or load the " "save file at any time."); printf("\n\nType \"quit\" or \"q\" to quit the game at any " "time."); printf("\n\nPress enter to begin the game.\n\n"); getchar(); centerRoom(); } // DEBUG MODE if (strcmp(input, "xyzzy") == 0 && debug == 1){ debugmode(); } // SAVE if (strcmp(input, "save") == 0){ saveGame(); } // LOAD if (strcmp(input, "load") == 0){ loadGame(); } // QUIT if (strcmp(input, "q") == 0 || strcmp(input, "quit") == 0) { endgame(); } // GO TO CENTER ROOM (BEGIN THE GAME) else { centerRoom(); } } } /********************************************************************** * CENTER ROOM * **********************************************************************/ void centerRoom() { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t CENTER ROOM\n"); printf("\t\t-----------------------------------------------"); printf("\n\nYou're in the center room."); roomid = 1; // LIGHT ABOVE THE DOOR (RED IS LOCKED, GREEN IS UNLOCKED.) if (northdoor == 0) { printf("\nThe light above the door in the north is red."); } if (northdoor != 0) { printf("\nThe light above the door in the north is green."); } if (southdoor == 0) { printf("\nThe light above the door in the south is red."); } if (southdoor != 0) { printf("\nThe light above the door in the south is green."); } if (eastdoor == 0) { printf("\nThe light above the door in the east is red."); } if (eastdoor != 0) { printf("\nThe light above the door in the east is green."); } if (westdoor == 0) { printf("\nThe light above the door in the west is red."); } if (westdoor != 0) { printf("\nThe light above the door in the west is green."); } // MAIN SECTION OF THE CENTER ROOM FUNCTION for(;;) { printf("\n\n> "); // GET PLAYER'S INPUT fgets(rawinput, sizeof(rawinput), stdin); // CLEAN THE RAW INPUT char *input = CleanRawInput(rawinput, strlen(rawinput)); // LOOK / LOOK ROOM if (strcmp(input, "look") == 0 || strcmp(input, "look room") == 0) { printf("\nThe walls, doors, ceiling, and floor are metal."); printf("\nThere is a light source on the ceiling."); printf("\nIt looks like a very bright LED embedded in the ceiling."); printf("\nThere are four doors here, with a light above it."); if (northdoor == 0) { printf("\nThe light above the door in the north is red."); } if (northdoor != 0) { printf("\nThe light above the door in the north is green."); } if (southdoor == 0) { printf("\nThe light above the door in the south is red."); } if (southdoor != 0) { printf("\nThe light above the door in the south is green."); } if (eastdoor == 0) { printf("\nThe light above the door in the east is red."); } if (eastdoor != 0) { printf("\nThe light above the door in the east is green."); } if (westdoor == 0) { printf("\nThe light above the door in the west is red."); } if (westdoor != 0) { printf("\nThe light above the door in the west is green."); } if (flashlighton != 0) { printf("\nLight is shining from the flashlight."); } continue; } // INPUT HANDLER else { inputHandler(input); continue; } } } /********************************************************************** * EAST ROOM * **********************************************************************/ void eastRoom() { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t EAST ROOM\n"); printf("\t\t-----------------------------------------------"); printf("\n\nYou're in the east room."); roomid = 2; // LOCK THE DOOR AS SOON AS THE PLAYER ENTERS THE ROOM eastdoor = 0; printf("\nAs soon as the door behind you closes, the light above the door turns red."); // LIGHT ABOVE THE DOOR (RED IS LOCKED, GREEN IS UNLOCKED.) if (eastdoor == 0) { printf("\nThe light above the door in the west is red."); } if (eastdoor != 0) { printf("\nThe light above the door in the west is green."); } // BRONZE BOX - ALUMINUM KEY INSIDE THE BOX printf("\nThere is a bronze box on the floor in center of the room."); if (bronzebox != 2) { printf("\nThe lid on the bronze box is closed."); } if (bronzebox == 2) { printf("\nThe lid on the bronze box is open."); if (aluminumkey == 0) { printf("\nThere is an aluminum key inside the bronze box."); } if (aluminumkey != 0) { printf("\nThe bronze box is empty."); } } // PAPER - COVERING THE YELLOW SWITCH if (paper == 0) { printf("\nThere is a paper on the floor in the southeast corner."); } if (paper != 0) { printf("\nThere is a yellow switch on floor in the southeast corner."); } // GREEN SWITCH - UNLOCKS NORTH DOOR printf("\nThere is a green switch on the north wall."); // MAIN SECTION OF THE EAST ROOM FUNCTION for(;;) { printf("\n\n> "); // GET PLAYER'S INPUT fgets(rawinput, sizeof(rawinput), stdin); // CLEAN THE RAW INPUT char *input = CleanRawInput(rawinput, strlen(rawinput)); // LOOK / LOOK ROOM if (strcmp(input, "look") == 0 || strcmp(input, "look room") == 0) { printf("\nThe walls, doors, ceiling, and floor are metal."); printf("\nThere is a light source on the ceiling."); printf("\nIt looks like a very bright LED embedded in the ceiling."); printf("\nThere is a door in the west."); if (eastdoor == 0) { printf("\nThe light above the door is red."); } if (eastdoor != 0) { printf("\nThe light above the door is green."); } printf("\nThere is a green switch on the north wall."); if (paper == 0) { printf("\nThere is a paper on the floor in southeast corner."); } if (paper != 0) { printf("\nThere is a yellow switch on the floor in southeast corner."); } printf("\nThere is a bronze box in the center of the room."); if (bronzebox != 2) { printf("\nThe bronze box is currently closed."); } if (bronzebox == 2) { printf("\nThe bronze box is currently open."); if (aluminumkey == 0) { printf("\nThere is an aluminum key inside the bronze box."); } if (aluminumkey != 0) { printf("\nThe bronze box is empty."); } } if (flashlighton != 0) { printf("\nLight is shining from the flashlight."); } continue; } // INPUT HANDLER else { inputHandler(input); continue; } } } /********************************************************************** * NORTH ROOM * **********************************************************************/ void northRoom() { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t NORTH ROOM\n"); printf("\t\t-----------------------------------------------"); printf("\n\nYou're in the north room."); roomid = 5; // LOCK EAST DOOR UPON ENTRY INTO NORTH ROOM printf("\nUpon entering the room, you stepped on a pressure switch on the floor."); eastdoor = 0; // DOOR LIGHT STATE if (northdoor == 0) { printf("\nThe light above the door in the south is red."); } if (northdoor != 0) { printf("\nThe light above the door in the south is green."); } // PASSAGE TO THE EXIT printf("\nYou can see the passage to the exit in the north."); printf("\nThere is an impassable thick tungsten gate blocking the passage."); printf("\nThere is a keyhole on the tungsten gate."); // ACCESS PANEL STATUS if (northaccesspanel == 0) { printf("\nThere is a metal access panel on the west wall. It is currently closed."); } if (northaccesspanel != 0) { printf("\nThere is a metal access panel on the west wall. It is currently open."); printf("\nYou can see black and white switches inside the metal access panel."); } // STEEL BOX STATUS printf("\nThere is a steel box on the floor in center of the room."); printf("\nThere is a keyhole on a side of the steel box."); if (steelbox == 0) { printf("\nThe steel box is currently closed."); } if (steelbox != 0) { printf("\nThe steel box is currently open."); if (batteries == 0) { printf("\nThere are several batteries inside the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } // MAIN SECTION OF THE NORTH ROOM FUNCTION for(;;) { printf("\n\n> "); // GET PLAYER'S INPUT fgets(rawinput, sizeof(rawinput), stdin); // CLEAN THE RAW INPUT char *input = CleanRawInput(rawinput, strlen(rawinput)); // LOOK / LOOK ROOM if (strcmp(input, "look") == 0 || strcmp(input, "look room") == 0) { printf("\nThe walls, door, ceiling, and floor are metal."); printf("\nThere is a light source on the ceiling."); printf("\nIt looks like a very bright LED embedded in the ceiling."); printf("\nThere is a door in the south."); if (northdoor == 0) { printf("\nThe light above the door is red."); } if (northdoor != 0) { printf("\nThe light above the door is green."); } printf("\nA tungsten gate is blocking the passage to the exit in the north."); printf("\nThere is a steel box in the center of the room."); if (steelbox == 0) { printf("\nThe steel box is currently closed."); } if (steelbox != 0) { printf("\nThe steel box is currently open."); if (batteries == 0) { printf("\nThere are batteries in the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } printf("\nThere is a metal access panel on the west wall."); if (northaccesspanel == 0) { printf("\nThe metal access panel is currently closed."); } if (northaccesspanel != 0) { printf("\nThe metal access panel is currently open."); printf("\nYou can see a black switch and a white switch inside the metal access panel."); } if (flashlighton != 0) { printf("\nLight is shining from the flashlight."); } continue; } // INPUT HANDLER else { inputHandler(input); continue; } } } /********************************************************************** * SOUTH ROOM * **********************************************************************/ void southRoom() { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t SOUTH ROOM\n"); printf("\t\t-----------------------------------------------"); printf("\n\nYou're in the south room."); roomid = 4; printf("\nIt's quite messy in here."); // DOOR LIGHT STATE if (southdoor == 0) { printf("\nThe light above the door in the north is red."); } if (southdoor != 0) { printf("\nThe light above the door in the north is green."); } // METAL ACCESS PANEL printf("\nThere is a metal access panel on the west wall."); if (southaccesspanel != 2) { printf("\nThe metal access panel is currently closed."); } if (southaccesspanel == 2) { printf("\nThe metal access panel is currently open."); printf("\nYou can see a blue switch and a red switch inside the metal access panel."); } // ITEMS IN THE ROOM printf("\nSeveral large gears are stacked in the northeast corner."); printf("\nSprings of varying sizes are scattered everywhere in the room."); printf("\nRubbish are piled up in the southwest corner."); // DEAD PLANT INSIDE PLANTER - PLANT/PLANTER INTACT if (deadplant == 0 && planter == 0) { printf("\nA large planter with a dead and decaying plant is in southeast corner."); } // PLANT CRUMBLED, PLANTER INTACT if (deadplant != 0 && planter == 0) { printf("\nA large planter with a pile of dust on it is in southeast corner."); } // PLANTER CRUMBLED, DEAD PLANT AUTOMATICALLY CRUMBLED if (planter != 0) { printf("\nThere is a pile of dirt in the southeast corner."); if (brasskey == 0) { printf("\nA brass key is partially buried in the pile of dirt."); } } // MAIN SECTION OF THE SOUTH ROOM FUNCTION for(;;) { printf("\n\n> "); // GET PLAYER'S INPUT fgets(rawinput, sizeof(rawinput), stdin); // CLEAN THE RAW INPUT char *input = CleanRawInput(rawinput, strlen(rawinput)); // LOOK / LOOK ROOM if (strcmp(input, "look") == 0 || strcmp(input, "look room") == 0) { printf("\nIt's quite messy in here."); printf("\nThe walls, door, ceiling, and floor are metal."); printf("\nThere is a light source on the ceiling."); printf("\nIt looks like a very bright LED embedded in the ceiling."); printf("\nThere is a door in the north."); if (southdoor == 0) { printf("\nThe light above the door is red."); } if (southdoor != 0) { printf("\nThe light above the door is green."); } if (deadplant == 0 && planter == 0) { printf("\nA large planter with a dead and decaying plant is in southeast corner."); } if (deadplant != 0 && planter == 0) { printf("\nA large planter with a pile of dust on it is in southeast corner."); } if (deadplant != 0 && planter != 0) { printf("\nThere is a pile of dirt is in southeast corner."); if (brasskey == 0) { printf("\nA brass key is partially buried in the pile of dirt."); } } printf("\nThere is a pile of rubbish in southwest corner."); printf("\nGears are stacked in northeast corner."); printf("\nSprings are scattered all over the room."); printf("\nThere is a metal access panel on the west wall."); if (southaccesspanel != 2) { printf("\nThe metal access panel is currently closed."); } if (southaccesspanel == 2) { printf("\nThe metal access panel is currently open."); printf("\nYou can see a blue switch and a red switch inside the metal access panel."); } if (flashlighton != 0) { printf("\nLight is shining from the flashlight."); } continue; } // INPUT HANDLER else { inputHandler(input); continue; } } } /********************************************************************** * WEST ROOM * **********************************************************************/ void westRoom() { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t WEST ROOM\n"); printf("\t\t-----------------------------------------------"); printf("\n\nYou're in the west room."); roomid = 3; if (flashlighton == 0 && titaniumbox == 0) { westdoor = 1; } if (flashlighton != 0 || titaniumbox != 0) { westdoor = 0; } if (flashlighton == 0) { printf("\nIt's pitch black in here."); if (westdoor == 0) { printf("\nThe only source of light is a dim red light above the door in the east."); } if (westdoor != 0) { printf("\nThe only source of light is a dim green light above the door in the east."); } } if (flashlighton != 0) { printf("\nThe flashlight is illuminating the room."); if (westdoor == 0) { printf("\nThe light above the door in the east is red."); } if (westdoor != 0) { printf("\nThe light above the door in the east is green"); } printf("\nThere is a sensor on the ceiling."); printf("\nThere is a titanium box on the floor in the center of the room."); printf("\nThere is a keyhole on a side of the titanium box."); if (titaniumbox == 0) { printf("\nThe titanium box is closed."); } if (titaniumbox != 0) { printf("\nThe titanium box is open."); if (ironkey == 0) { printf("\nThere is an iron key inside the titanium box."); } if (ironkey != 0) { printf("\nThe titanium box is empty."); } } } // MAIN SECTION OF THE WEST ROOM FUNCTION for(;;) { printf("\n\n> "); // GET PLAYER'S INPUT fgets(rawinput, sizeof(rawinput), stdin); // CLEAN THE RAW INPUT char *input = CleanRawInput(rawinput, strlen(rawinput)); // FLASHLIGHT IS OFF, NO ACTION CAN BE DONE EXCEPT TURNING FLASHLIGHT ON/OFF OR GOING EAST // INPUT HANDLER DISABLED if (flashlighton == 0) { //EAST if (strcmp(input, "e") == 0 || strcmp(input, "east") == 0) { if (westdoor == 0) { printf("\nThe door is locked, you can't go east."); continue; } if (westdoor != 0) { centerRoom(); } } // NORTH if (strcmp(input, "n") == 0 || strcmp(input, "north") == 0) { printf("\nGroping around in the darkness, you find that there is no route north from here."); continue; } // SOUTH if (strcmp(input, "s") == 0 || strcmp(input, "south") == 0) { printf("\nGroping around in the darkness, you find that there is no route south from here."); continue; } // WEST if (strcmp(input, "w") == 0 || strcmp(input, "west") == 0) { printf("\nGroping around in the darkness, you find that there is no route west from here."); continue; } // LOOK / LOOK ROOM if (strcmp(input, "look") == 0 || strcmp(input, "look room") == 0) { printf("\nIt's too dark to see anything."); if (westdoor == 0) { printf("\nThe only source of light is a dim red light above the door in the east."); } if (westdoor != 0) { printf("\nThe only source of light is a dim green light above the door in the east."); } continue; } // TURN FLASHLIGHT ON if (strcmp(input, "turn flashlight on") == 0 || strcmp(input, "turn on flashlight") == 0 || strcmp(input, "turn on light") == 0 || strcmp(input, "turn light on") == 0) { if (flashlight != 0) { if (flashlightbatteries != 0) { if (flashlighton == 0) { flashlighton = 1; westRoom(); } } if (flashlightbatteries == 0) { printf("\nFlashlight won't turn on. There are no batteries inside it."); } } if (flashlight == 0) { if (strcmp(input, "turn flashlight on") == 0 || strcmp(input, "turn on flashlight") == 0) { printf("\nWhat flashlight?"); } if (strcmp(input, "turn light on") == 0 || strcmp(input, "turn on light") == 0) { printf("\nWhat light?"); } } continue; } // QUIT if (strcmp(input, "q") == 0 || strcmp(input, "quit") == 0) { endgame(); } // DEBUG if (strcmp(input, "xyzzy") == 0 && debug == 1) { debugmode(); } // SAVE if (strcmp(input, "save") == 0) { saveGame(); } // LOAD if (strcmp(input, "load") == 0){ loadGame(); } // CATCH-ALL FOR ALL OTHER INPUTS // INPUT HANDLER DISABLED WHEN ROOM IS DARK else { printf("\nIt's too dark to do anything."); continue; } } // FLASHLIGHT IS ON, INPUT HANDLER IS ENABLED AGAIN if (flashlighton != 0) { // LOOK / LOOK ROOM if (strcmp(input, "look") == 0 || strcmp(input, "look room") == 0) { printf("\nThe walls, door, ceiling, and floor are metal."); printf("\nThere is no light anywhere in the room except for the light" "\nabove the door in the east and the flashlight."); printf("\nThere is a door to the east."); if (westdoor == 0) { printf("\nThe light above the door in the east is red."); } if (westdoor != 0) { printf("\nThe light above the door in the east is green."); } printf("\nThere is a titanium box in the center of the room."); if (titaniumbox == 0) { printf("\nThe titanium box is currently closed."); } if (titaniumbox != 0) { printf("\nThe titanium box is currently open."); if (ironkey == 0) { printf("\nThere is an iron key inside the titanium box."); } if (ironkey == 0) { printf("\nThe titanium box is empty."); } } continue; } // INPUT HANDLER else { inputHandler(input); continue; } } } } /********************************************************************** * INPUT HANDLER * **********************************************************************/ void inputHandler(char *input) { // DEBUG if (strcmp(input, "xyzzy") == 0 && debug == 1) { debugmode(); } // INVENTORY if (strcmp(input, "i") == 0 || strcmp(input, "inventory") == 0) { playerinventory(); return; } // NORTH if (strcmp(input, "n") == 0 || strcmp(input, "north") == 0) { if (roomid == 1) { if (northdoor == 0) { printf("\nThe north door is locked."); } if (northdoor != 0) { northRoom(); } } if (roomid == 2 || roomid == 3) { printf("\nThere is no route north from here."); } if (roomid == 4) { if (southdoor == 0) { printf("\nThe north door is locked."); } if (southdoor != 0) { centerRoom(); } } if (roomid == 5) { if (tungstengate == 0) { printf("\nThe tungsten gate is locked."); } if (tungstengate != 0) { escaped = 1; endgame(); } } return; } // SOUTH if (strcmp(input, "s") == 0 || strcmp(input, "south") == 0) { if (roomid == 1) { if (southdoor == 0) { printf("\nThe south door is locked."); } if (southdoor != 0) { southRoom(); } } if (roomid == 2 || roomid == 3 || roomid == 4) { printf("\nThere is no route south from here."); } if (roomid == 5) { if (northdoor == 0) { printf("\nThe south door is locked."); } if (northdoor != 0) { centerRoom(); } } return; } // EAST if (strcmp(input, "e") == 0 || strcmp(input, "east") == 0) { if (roomid == 1) { if (eastdoor == 0) { printf("\nThe east door is locked."); } if (eastdoor != 0) { eastRoom(); } } if (roomid == 2 || roomid == 4 || roomid == 5) { printf("\nThere is no route east from here."); } if (roomid == 3) { if (westdoor == 0) { printf("\nThe east door is locked."); } if (westdoor != 0) { centerRoom(); } } return; } // WEST if (strcmp(input, "w") == 0 || strcmp(input, "west") == 0) { if (roomid == 1) { if (westdoor == 0) { printf("\nThe west door is locked."); } if (westdoor != 0) { westRoom(); } } if (roomid == 2) { if (eastdoor == 0) { printf("\nThe west door is locked."); } if (eastdoor != 0) { centerRoom(); } } if (roomid == 3 || roomid == 4 || roomid == 5) { printf("\nThere is no route west from here."); } return; } // LOOK TUNGSTEN GATE if (strcmp(input, "look tungsten gate") == 0 || strcmp(input, "look tungsten") == 0 || strcmp(input, "look gate") == 0) { if (roomid == 5) { printf("\nPeering through the tungsten gate and squinting to see beyond " "the passage, \nyou can see blue sky and grassy meadows."); printf("\nThere is a keyhole on the tungsten gate."); } if (roomid != 5) { if (strcmp(input, "look tungsten gate") == 0) { printf("\nThere isn't any tungsten gate here."); } if (strcmp(input, "look tungsten") == 0) { printf("\nThere isn't anything tungsten in here."); } if (strcmp(input, "look gate") == 0) { printf("\nThere isn't any gate here."); } } return; } // UNLOCK TUNGSTEN GATE WITH KEY / UNLOCK GATE WITH KEY if (strcmp(input, "use key on tungsten gate") == 0 || strcmp(input, "use key on gate") == 0 || strcmp(input, "use key on tungsten") == 0 || strcmp(input, "use key to open tungsten gate") == 0 || strcmp(input, "use key to open tungsten") == 0 || strcmp(input, "use key to open gate") == 0 || strcmp(input, "use key to unlock tungsten gate") == 0 || strcmp(input, "use key to unlock gate") == 0 || strcmp(input, "use key to unlock tungsten") == 0 || strcmp(input, "open tungsten gate with key") == 0 || strcmp(input, "open gate with key") == 0 || strcmp(input, "open tungsten with key") == 0 || strcmp(input, "open tungsten gate using key") == 0 || strcmp(input, "open gate using key") == 0 || strcmp(input, "open tungsten using key") == 0 || strcmp(input, "unlock tungsten gate using key") == 0 || strcmp(input, "unlock gate using key") == 0 || strcmp(input, "unlock tungsten using key") == 0 || strcmp(input, "unlock tungsten gate with key") == 0 || strcmp(input, "unlock gate with key") == 0 || strcmp(input, "unlock tungsten with key") == 0) { if (roomid == 5) { if (ironkey != 0 || brasskey != 0 || aluminumkey != 0) { printf("\nPlease specify which key to use."); } if (ironkey == 0 && brasskey == 0 && aluminumkey == 0) { printf("\nWhat key?"); } } if (roomid != 5) { if (strcmp(input, "use key on gate") == 0 || strcmp(input, "use key to open gate") == 0 || strcmp(input, "open gate with key") == 0 || strcmp(input, "open gate using key") == 0 || strcmp(input, "unlock gate using key") == 0 || strcmp(input, "unlock gate with key") == 0 || strcmp(input, "use key to unlock gate") == 0) { printf("\nThere isn't any gate here."); } if (strcmp(input, "use key on tungsten") == 0 || strcmp(input, "use key to open tungsten") == 0 || strcmp(input, "open tungsten with key") == 0 || strcmp(input, "open tungsten using key") == 0 || strcmp(input, "unlock tungsten using key") == 0 || strcmp(input, "unlock tungsten with key") == 0 || strcmp(input, "use key to unlock tungsten") == 0) { printf("\nThere isn't anything tungsten in here."); } if (strcmp(input, "use key on tungsten gate") == 0 || strcmp(input, "use key to open tungsten gate") == 0 || strcmp(input, "open tungsten gate with key") == 0 || strcmp(input, "open tungsten gate using key") == 0 || strcmp(input, "unlock tungsten gate using key") == 0 || strcmp(input, "unlock tungsten gate with key") == 0 || strcmp(input, "use key to unlock tungsten gate") == 0) { printf("\nThere isn't any tungsten gate here."); } if (aluminumkey == 0 && brasskey == 0 && ironkey == 0) { printf("\nWhat key?"); } } return; } // UNLOCK TUNGSTEN GATE WITH ALUMINUM KEY if (strcmp(input, "use aluminum key on tungsten gate") == 0 || strcmp(input, "use aluminum key on gate") == 0 || strcmp(input, "use aluminum key on tungsten") == 0 || strcmp(input, "use aluminum on gate") == 0 || strcmp(input, "use aluminum on tungsten") == 0 || strcmp(input, "use aluminum on tungsten gate") == 0 || strcmp(input, "use aluminum key to open tungsten gate") == 0 || strcmp(input, "use aluminum key to open gate") == 0 || strcmp(input, "use aluminum key to open tungsten") == 0 || strcmp(input, "use aluminum to open gate") == 0 || strcmp(input, "use aluminum to open tungsten") == 0 || strcmp(input, "use aluminum to open tungsten gate") == 0 || strcmp(input, "use aluminum key to unlock tungsten gate") == 0 || strcmp(input, "use aluminum key to unlock gate") == 0 || strcmp(input, "use aluminum key to unlock tungsten") == 0 || strcmp(input, "use aluminum to unlock gate") == 0 || strcmp(input, "use aluminum to unlock tungsten") == 0 || strcmp(input, "use aluminum to unlock tungsten gate") == 0 || strcmp(input, "open tungsten gate with aluminum key") == 0 || strcmp(input, "open gate with aluminum key") == 0 || strcmp(input, "open tungsten with aluminum key") == 0 || strcmp(input, "open gate with aluminum") == 0 || strcmp(input, "open tungsten with aluminum") == 0 || strcmp(input, "open tungsten gate with aluminum") == 0 || strcmp(input, "open tungsten gate using aluminum key") == 0 || strcmp(input, "open gate using aluminum key") == 0 || strcmp(input, "open tungsten using aluminum key") == 0 || strcmp(input, "open gate using aluminum") == 0 || strcmp(input, "open tungsten using aluminum") == 0 || strcmp(input, "open tungsten gate using aluminum") == 0 || strcmp(input, "unlock tungsten gate with aluminum key") == 0 || strcmp(input, "unlock gate with aluminum key") == 0 || strcmp(input, "unlock tungsten with aluminum key") == 0 || strcmp(input, "unlock gate with aluminum") == 0 || strcmp(input, "unlock tungsten with aluminum") == 0 || strcmp(input, "unlock tungsten gate with aluminum") == 0 || strcmp(input, "unlock tungsten gate using aluminum key") == 0 || strcmp(input, "unlock gate using aluminum key") == 0 || strcmp(input, "unlock tungsten using aluminum key") == 0 || strcmp(input, "unlock gate using aluminum") == 0 || strcmp(input, "unlock tungsten using aluminum") == 0 || strcmp(input, "unlock tungsten gate using aluminum") == 0) { if (roomid == 5 && aluminumkey != 0) { printf("\nAluminum key doesn't fit in the keyhole on the tungsten gate."); } if (roomid != 5) { if (strcmp(input, "use aluminum key on gate") == 0 || strcmp(input, "use aluminum on gate") == 0 || strcmp(input, "use aluminum key to open gate") == 0 || strcmp(input, "use aluminum to open gate") == 0 || strcmp(input, "use aluminum key to unlock gate") == 0 || strcmp(input, "use aluminum to unlock gate") == 0 || strcmp(input, "open gate with aluminum key") == 0 || strcmp(input, "open gate with aluminum") == 0 || strcmp(input, "open gate using aluminum key") == 0 || strcmp(input, "open gate using aluminum") == 0 || strcmp(input, "unlock gate with aluminum key") == 0 || strcmp(input, "unlock gate with aluminum") == 0 || strcmp(input, "unlock gate using aluminum key") == 0 || strcmp(input, "unlock gate using aluminum") == 0) { printf("\nThere isn't any gate here."); } if (strcmp(input, "use aluminum key on tungsten gate") == 0 || strcmp(input, "use aluminum on tungsten gate") == 0 || strcmp(input, "use aluminum key to open tungsten gate") == 0 || strcmp(input, "use aluminum to open tungsten gate") == 0 || strcmp(input, "use aluminum key to unlock tungsten gate") == 0 || strcmp(input, "use aluminum to unlock tungsten gate") == 0 || strcmp(input, "open tungsten gate with aluminum key") == 0 || strcmp(input, "open tungsten gate with aluminum") == 0 || strcmp(input, "open tungsten gate using aluminum key") == 0 || strcmp(input, "open tungsten gate using aluminum") == 0 || strcmp(input, "unlock tungsten gate with aluminum key") == 0 || strcmp(input, "unlock tungsten gate with aluminum") == 0 || strcmp(input, "unlock tungsten gate using aluminum key") == 0 || strcmp(input, "unlock tungsten gate using aluminum") == 0) { printf("\nThere isn't any tungsten gate here."); } if (strcmp(input, "use aluminum key on tungsten") == 0 || strcmp(input, "use aluminum on tungsten") == 0 || strcmp(input, "use aluminum key to open tungsten") == 0 || strcmp(input, "use aluminum to open tungsten") == 0 || strcmp(input, "use aluminum key to unlock tungsten") == 0 || strcmp(input, "open tungsten with aluminum key") == 0 || strcmp(input, "open tungsten with aluminum") == 0 || strcmp(input, "open tungsten using aluminum key") == 0 || strcmp(input, "open tungsten using aluminum") == 0 || strcmp(input, "unlock tungsten with aluminum key") == 0 || strcmp(input, "unlock tungsten with aluminum") == 0 || strcmp(input, "unlock tungsten using aluminum key") == 0 || strcmp(input, "unlock tungsten using aluminum") == 0) { printf("\nThere isn't anything tungsten in here."); } } if (aluminumkey == 0) { if (strcmp(input, "use aluminum key on tungsten gate") == 0 || strcmp(input, "use aluminum key on gate") == 0 || strcmp(input, "use aluminum key on tungsten") == 0 || strcmp(input, "use aluminum key to open tungsten gate") == 0 || strcmp(input, "use aluminum key to open gate") == 0 || strcmp(input, "use aluminum key to open tungsten") == 0 || strcmp(input, "use aluminum key to unlock tungsten gate") == 0 || strcmp(input, "use aluminum key to unlock gate") == 0 || strcmp(input, "use aluminum key to unlock tungsten") == 0 || strcmp(input, "open tungsten gate with aluminum key") == 0 || strcmp(input, "open gate with aluminum key") == 0 || strcmp(input, "open tungsten with aluminum key") == 0 || strcmp(input, "open tungsten gate using aluminum key") == 0 || strcmp(input, "open gate using aluminum key") == 0 || strcmp(input, "open tungsten using aluminum key") == 0 || strcmp(input, "unlock tungsten gate with aluminum key") == 0 || strcmp(input, "unlock gate with aluminum key") == 0 || strcmp(input, "unlock tungsten with aluminum key") == 0 || strcmp(input, "unlock tungsten gate using aluminum key") == 0 || strcmp(input, "unlock gate using aluminum key") == 0 || strcmp(input, "unlock tungsten using aluminum key") == 0) { printf("\nWhat aluminum key?"); } if (strcmp(input, "use aluminum on tungsten gate") == 0 || strcmp(input, "use aluminum on gate") == 0 || strcmp(input, "use aluminum on tungsten") == 0 || strcmp(input, "use aluminum to open tungsten gate") == 0 || strcmp(input, "use aluminum to open gate") == 0 || strcmp(input, "use aluminum to open tungsten") == 0 || strcmp(input, "use aluminum to unlock tungsten gate") == 0 || strcmp(input, "use aluminum to unlock gate") == 0 || strcmp(input, "use aluminum to unlock tungsten") == 0 || strcmp(input, "open tungsten gate with aluminum") == 0 || strcmp(input, "open gate with aluminum") == 0 || strcmp(input, "open tungsten with aluminum") == 0 || strcmp(input, "open tungsten gate using aluminum") == 0 || strcmp(input, "open gate using aluminum") == 0 || strcmp(input, "open tungsten using aluminum") == 0 || strcmp(input, "unlock tungsten gate with aluminum") == 0 || strcmp(input, "unlock gate with aluminum") == 0 || strcmp(input, "unlock tungsten with aluminum") == 0 || strcmp(input, "unlock tungsten gate using aluminum") == 0 || strcmp(input, "unlock gate using aluminum") == 0 || strcmp(input, "unlock tungsten using aluminum") == 0) { printf("\nWhat aluminum?"); } } return; } // UNLOCK TUNGSTEN GATE WITH BRASS KEY if (strcmp(input, "use brass key on tungsten gate") == 0 || strcmp(input, "use brass key on gate") == 0 || strcmp(input, "use brass key on tungsten") == 0 || strcmp(input, "use brass on gate") == 0 || strcmp(input, "use brass on tungsten") == 0 || strcmp(input, "use brass on tungsten gate") == 0 || strcmp(input, "use brass key to open tungsten gate") == 0 || strcmp(input, "use brass key to open gate") == 0 || strcmp(input, "use brass key to open tungsten") == 0 || strcmp(input, "use brass to open gate") == 0 || strcmp(input, "use brass to open tungsten") == 0 || strcmp(input, "use brass to open tungsten gate") == 0 || strcmp(input, "use brass key to unlock tungsten gate") == 0 || strcmp(input, "use brass key to unlock gate") == 0 || strcmp(input, "use brass key to unlock tungsten") == 0 || strcmp(input, "use brass to unlock gate") == 0 || strcmp(input, "use brass to unlock tungsten") == 0 || strcmp(input, "use brass to unlock tungsten gate") == 0 || strcmp(input, "open tungsten gate with brass key") == 0 || strcmp(input, "open gate with brass key") == 0 || strcmp(input, "open tungsten with brass key") == 0 || strcmp(input, "open gate with brass") == 0 || strcmp(input, "open tungsten with brass") == 0 || strcmp(input, "open tungsten gate with brass") == 0 || strcmp(input, "open tungsten gate using brass key") == 0 || strcmp(input, "open gate using brass key") == 0 || strcmp(input, "open tungsten using brass key") == 0 || strcmp(input, "open gate using brass") == 0 || strcmp(input, "open tungsten using brass") == 0 || strcmp(input, "open tungsten gate using brass") == 0 || strcmp(input, "unlock tungsten gate with brass key") == 0 || strcmp(input, "unlock gate with brass key") == 0 || strcmp(input, "unlock tungsten with brass key") == 0 || strcmp(input, "unlock gate with brass") == 0 || strcmp(input, "unlock tungsten with brass") == 0 || strcmp(input, "unlock tungsten gate with brass") == 0 || strcmp(input, "unlock tungsten gate using brass key") == 0 || strcmp(input, "unlock gate using brass key") == 0 || strcmp(input, "unlock tungsten using brass key") == 0 || strcmp(input, "unlock gate using brass") == 0 || strcmp(input, "unlock tungsten using brass") == 0 || strcmp(input, "unlock tungsten gate using brass") == 0) { if (roomid == 5 && brasskey != 0) { printf("\nBrass key doesn't fit in the keyhole on the tungsten gate."); } if (roomid != 5) { if (strcmp(input, "use brass key on gate") == 0 || strcmp(input, "use brass on gate") == 0 || strcmp(input, "use brass key to open gate") == 0 || strcmp(input, "use brass to open gate") == 0 || strcmp(input, "use brass key to unlock gate") == 0 || strcmp(input, "use brass to unlock gate") == 0 || strcmp(input, "open gate with brass key") == 0 || strcmp(input, "open gate with brass") == 0 || strcmp(input, "open gate using brass key") == 0 || strcmp(input, "open gate using brass") == 0 || strcmp(input, "unlock gate with brass key") == 0 || strcmp(input, "unlock gate with brass") == 0 || strcmp(input, "unlock gate using brass key") == 0 || strcmp(input, "unlock gate using brass") == 0) { printf("\nThere isn't any gate here."); } if (strcmp(input, "use brass key on tungsten gate") == 0 || strcmp(input, "use brass on tungsten gate") == 0 || strcmp(input, "use brass key to open tungsten gate") == 0 || strcmp(input, "use brass to open tungsten gate") == 0 || strcmp(input, "use brass key to unlock tungsten gate") == 0 || strcmp(input, "use brass to unlock tungsten gate") == 0 || strcmp(input, "open tungsten gate with brass key") == 0 || strcmp(input, "open tungsten gate with brass") == 0 || strcmp(input, "open tungsten gate using brass key") == 0 || strcmp(input, "open tungsten gate using brass") == 0 || strcmp(input, "unlock tungsten gate with brass key") == 0 || strcmp(input, "unlock tungsten gate with brass") == 0 || strcmp(input, "unlock tungsten gate using brass key") == 0 || strcmp(input, "unlock tungsten gate using brass") == 0) { printf("\nThere isn't any tungsten gate here."); } if (strcmp(input, "use brass key on tungsten") == 0 || strcmp(input, "use brass on tungsten") == 0 || strcmp(input, "use brass key to open tungsten") == 0 || strcmp(input, "use brass to open tungsten") == 0 || strcmp(input, "use brass key to unlock tungsten") == 0 || strcmp(input, "open tungsten with brass key") == 0 || strcmp(input, "open tungsten with brass") == 0 || strcmp(input, "open tungsten using brass key") == 0 || strcmp(input, "open tungsten using brass") == 0 || strcmp(input, "unlock tungsten with brass key") == 0 || strcmp(input, "unlock tungsten with brass") == 0 || strcmp(input, "unlock tungsten using brass key") == 0 || strcmp(input, "unlock tungsten using brass") == 0) { printf("\nThere isn't anything tungsten in here."); } } if (brasskey == 0) { if (strcmp(input, "use brass key on tungsten gate") == 0 || strcmp(input, "use brass key on gate") == 0 || strcmp(input, "use brass key on tungsten") == 0 || strcmp(input, "use brass key to open tungsten gate") == 0 || strcmp(input, "use brass key to open gate") == 0 || strcmp(input, "use brass key to open tungsten") == 0 || strcmp(input, "use brass key to unlock tungsten gate") == 0 || strcmp(input, "use brass key to unlock gate") == 0 || strcmp(input, "use brass key to unlock tungsten") == 0 || strcmp(input, "open tungsten gate with brass key") == 0 || strcmp(input, "open gate with brass key") == 0 || strcmp(input, "open tungsten with brass key") == 0 || strcmp(input, "open tungsten gate using brass key") == 0 || strcmp(input, "open gate using brass key") == 0 || strcmp(input, "open tungsten using brass key") == 0 || strcmp(input, "unlock tungsten gate with brass key") == 0 || strcmp(input, "unlock gate with brass key") == 0 || strcmp(input, "unlock tungsten with brass key") == 0 || strcmp(input, "unlock tungsten gate using brass key") == 0 || strcmp(input, "unlock gate using brass key") == 0 || strcmp(input, "unlock tungsten using brass key") == 0) { printf("\nWhat brass key?"); } if (strcmp(input, "use brass on tungsten gate") == 0 || strcmp(input, "use brass on gate") == 0 || strcmp(input, "use brass on tungsten") == 0 || strcmp(input, "use brass to open tungsten gate") == 0 || strcmp(input, "use brass to open gate") == 0 || strcmp(input, "use brass to open tungsten") == 0 || strcmp(input, "use brass to unlock tungsten gate") == 0 || strcmp(input, "use brass to unlock gate") == 0 || strcmp(input, "use brass to unlock tungsten") == 0 || strcmp(input, "open tungsten gate with brass") == 0 || strcmp(input, "open gate with brass") == 0 || strcmp(input, "open tungsten with brass") == 0 || strcmp(input, "open tungsten gate using brass") == 0 || strcmp(input, "open gate using brass") == 0 || strcmp(input, "open tungsten using brass") == 0 || strcmp(input, "unlock tungsten gate with brass") == 0 || strcmp(input, "unlock gate with brass") == 0 || strcmp(input, "unlock tungsten with brass") == 0 || strcmp(input, "unlock tungsten gate using brass") == 0 || strcmp(input, "unlock gate using brass") == 0 || strcmp(input, "unlock tungsten using brass") == 0) { printf("\nWhat brass?"); } } return; } // UNLOCK TUNGSTEN GATE WITH IRON KEY if (strcmp(input, "use iron key on tungsten gate") == 0 || strcmp(input, "use iron key on gate") == 0 || strcmp(input, "use iron key on tungsten") == 0 || strcmp(input, "use iron on gate") == 0 || strcmp(input, "use iron on tungsten") == 0 || strcmp(input, "use iron on tungsten gate") == 0 || strcmp(input, "use iron key to open tungsten gate") == 0 || strcmp(input, "use iron key to open gate") == 0 || strcmp(input, "use iron key to open tungsten") == 0 || strcmp(input, "use iron to open gate") == 0 || strcmp(input, "use iron to open tungsten") == 0 || strcmp(input, "use iron to open tungsten gate") == 0 || strcmp(input, "use iron key to unlock tungsten gate") == 0 || strcmp(input, "use iron key to unlock gate") == 0 || strcmp(input, "use iron key to unlock tungsten") == 0 || strcmp(input, "use iron to unlock gate") == 0 || strcmp(input, "use iron to unlock tungsten") == 0 || strcmp(input, "use iron to unlock tungsten gate") == 0 || strcmp(input, "open tungsten gate with iron key") == 0 || strcmp(input, "open gate with iron key") == 0 || strcmp(input, "open tungsten with iron key") == 0 || strcmp(input, "open gate with iron") == 0 || strcmp(input, "open tungsten with iron") == 0 || strcmp(input, "open tungsten gate with iron") == 0 || strcmp(input, "open tungsten gate using iron key") == 0 || strcmp(input, "open gate using iron key") == 0 || strcmp(input, "open tungsten using iron key") == 0 || strcmp(input, "open gate using iron") == 0 || strcmp(input, "open tungsten using iron") == 0 || strcmp(input, "open tungsten gate using iron") == 0 || strcmp(input, "unlock tungsten gate with iron key") == 0 || strcmp(input, "unlock gate with iron key") == 0 || strcmp(input, "unlock tungsten with iron key") == 0 || strcmp(input, "unlock gate with iron") == 0 || strcmp(input, "unlock tungsten with iron") == 0 || strcmp(input, "unlock tungsten gate with iron") == 0 || strcmp(input, "unlock tungsten gate using iron key") == 0 || strcmp(input, "unlock gate using iron key") == 0 || strcmp(input, "unlock tungsten using iron key") == 0 || strcmp(input, "unlock gate using iron") == 0 || strcmp(input, "unlock tungsten using iron") == 0 || strcmp(input, "unlock tungsten gate using iron") == 0) { if (roomid == 5 && ironkey != 0) { if (tungstengate != 0) { printf("\nThe tungsten gate is already unlocked."); } if (tungstengate == 0) { printf("\nYou've successfully unlocked the tungsten gate."); tungstengate = 1; } } if (roomid != 5) { if (strcmp(input, "use iron key on gate") == 0 || strcmp(input, "use iron on gate") == 0 || strcmp(input, "use iron key to open gate") == 0 || strcmp(input, "use iron to open gate") == 0 || strcmp(input, "use iron key to unlock gate") == 0 || strcmp(input, "use iron to unlock gate") == 0 || strcmp(input, "open gate with iron key") == 0 || strcmp(input, "open gate with iron") == 0 || strcmp(input, "open gate using iron key") == 0 || strcmp(input, "open gate using iron") == 0 || strcmp(input, "unlock gate with iron key") == 0 || strcmp(input, "unlock gate with iron") == 0 || strcmp(input, "unlock gate using iron key") == 0 || strcmp(input, "unlock gate using iron") == 0) { printf("\nThere isn't any gate here."); } if (strcmp(input, "use iron key on tungsten gate") == 0 || strcmp(input, "use iron on tungsten gate") == 0 || strcmp(input, "use iron key to open tungsten gate") == 0 || strcmp(input, "use iron to open tungsten gate") == 0 || strcmp(input, "use iron key to unlock tungsten gate") == 0 || strcmp(input, "use iron to unlock tungsten gate") == 0 || strcmp(input, "open tungsten gate with iron key") == 0 || strcmp(input, "open tungsten gate with iron") == 0 || strcmp(input, "open tungsten gate using iron key") == 0 || strcmp(input, "open tungsten gate using iron") == 0 || strcmp(input, "unlock tungsten gate with iron key") == 0 || strcmp(input, "unlock tungsten gate with iron") == 0 || strcmp(input, "unlock tungsten gate using iron key") == 0 || strcmp(input, "unlock tungsten gate using iron") == 0) { printf("\nThere isn't any tungsten gate here."); } if (strcmp(input, "use iron key on tungsten") == 0 || strcmp(input, "use iron on tungsten") == 0 || strcmp(input, "use iron key to open tungsten") == 0 || strcmp(input, "use iron to open tungsten") == 0 || strcmp(input, "use iron key to unlock tungsten") == 0 || strcmp(input, "open tungsten with iron key") == 0 || strcmp(input, "open tungsten with iron") == 0 || strcmp(input, "open tungsten using iron key") == 0 || strcmp(input, "open tungsten using iron") == 0 || strcmp(input, "unlock tungsten with iron key") == 0 || strcmp(input, "unlock tungsten with iron") == 0 || strcmp(input, "unlock tungsten using iron key") == 0 || strcmp(input, "unlock tungsten using iron") == 0) { printf("\nThere isn't anything tungsten in here."); } } if (ironkey == 0) { if (strcmp(input, "use iron key on tungsten gate") == 0 || strcmp(input, "use iron key on gate") == 0 || strcmp(input, "use iron key on tungsten") == 0 || strcmp(input, "use iron key to open tungsten gate") == 0 || strcmp(input, "use iron key to open gate") == 0 || strcmp(input, "use iron key to open tungsten") == 0 || strcmp(input, "use iron key to unlock tungsten gate") == 0 || strcmp(input, "use iron key to unlock gate") == 0 || strcmp(input, "use iron key to unlock tungsten") == 0 || strcmp(input, "open tungsten gate with iron key") == 0 || strcmp(input, "open gate with iron key") == 0 || strcmp(input, "open tungsten with iron key") == 0 || strcmp(input, "open tungsten gate using iron key") == 0 || strcmp(input, "open gate using iron key") == 0 || strcmp(input, "open tungsten using iron key") == 0 || strcmp(input, "unlock tungsten gate with iron key") == 0 || strcmp(input, "unlock gate with iron key") == 0 || strcmp(input, "unlock tungsten with iron key") == 0 || strcmp(input, "unlock tungsten gate using iron key") == 0 || strcmp(input, "unlock gate using iron key") == 0 || strcmp(input, "unlock tungsten using iron key") == 0) { printf("\nWhat iron key?"); } if (strcmp(input, "use iron on tungsten gate") == 0 || strcmp(input, "use iron on gate") == 0 || strcmp(input, "use iron on tungsten") == 0 || strcmp(input, "use iron to open tungsten gate") == 0 || strcmp(input, "use iron to open gate") == 0 || strcmp(input, "use iron to open tungsten") == 0 || strcmp(input, "use iron to unlock tungsten gate") == 0 || strcmp(input, "use iron to unlock gate") == 0 || strcmp(input, "use iron to unlock tungsten") == 0 || strcmp(input, "open tungsten gate with iron") == 0 || strcmp(input, "open gate with iron") == 0 || strcmp(input, "open tungsten with iron") == 0 || strcmp(input, "open tungsten gate using iron") == 0 || strcmp(input, "open gate using iron") == 0 || strcmp(input, "open tungsten using iron") == 0 || strcmp(input, "unlock tungsten gate with iron") == 0 || strcmp(input, "unlock gate with iron") == 0 || strcmp(input, "unlock tungsten with iron") == 0 || strcmp(input, "unlock tungsten gate using iron") == 0 || strcmp(input, "unlock gate using iron") == 0 || strcmp(input, "unlock tungsten using iron") == 0) { printf("\nWhat iron?"); } } return; } // OPEN TUNGSTEN GATE if (strcmp(input, "open tungsten gate") == 0 || strcmp(input, "open gate") == 0 || strcmp(input, "open tungsten") == 0) { if (roomid == 5) { if (tungstengate == 0) { printf("\nThe tungsten gate is locked."); printf("\nThere is a keyhole on the gate."); printf("\nYou will need to unlock the gate with a key."); } if (tungstengate != 0) { escaped = 1; endgame(); } } if (roomid != 5) { if (strcmp(input, "open tungsten gate") == 0) { printf("\nThere isn't any tungsten gate here."); } if (strcmp(input, "open tungsten") == 0) { printf("\nThere isn't anything tungsten in here."); } if (strcmp(input, "open gate") == 0) { printf("\nThere isn't any gate here."); } } return; } // CLOSE TUNGSTEN GATE / LOCK TUNGSTEN GATE if (strcmp(input, "close gate") == 0 || strcmp(input, "close tungsten gate") == 0 || strcmp(input, "close tungsten") == 0 || strcmp(input, "lock gate") == 0 || strcmp(input, "lock tungsten gate") == 0 || strcmp(input, "lock tungsten") == 0) { if (roomid == 5) { if (tungstengate == 0) { printf("\nThe tungsten gate is already closed and locked."); } if (tungstengate != 0) { printf("\nYou lock the tungsten gate."); tungstengate = 0; } } if (roomid != 5) { if (strcmp(input, "close tungsten gate") == 0 || strcmp(input, "lock tungsten gate") == 0) { printf("\nThere isn't any tungsten gate here."); } if (strcmp(input, "close tungsten") == 0 || strcmp(input, "lock tungsten") == 0) { printf("\nThere isn't anything tungsten in here."); } if (strcmp(input, "close gate") == 0 || strcmp(input, "lock gate") == 0) { printf("\nThere isn't any gate here."); } } return; } // TAKE TUNGSTEN GATE if (strcmp(input, "take gate") == 0 || strcmp(input, "take tungsten gate") == 0 || strcmp(input, "take tungsten") == 0) { if (roomid == 5) { printf("\nIt is impossible to lift the tungsten gate off its hinge."); } if (roomid != 5) { if (strcmp(input, "take tungsten gate") == 0) { printf("\nThere isn't any tungsten gate here."); } if (strcmp(input, "take tungsten") == 0) { printf("\nThere isn't anything tungsten in here."); } if (strcmp(input, "take gate") == 0) { printf("\nThere isn't any gate here."); } } return; } // LOOK PASSAGE if (strcmp(input, "look passage") == 0) { if (roomid == 5) { printf("\nPeering through the tungsten gate and squinting to see beyond " "the passage, \nyou can see blue sky and grassy meadows."); } if (roomid != 5) { printf("\nWhat passage?"); } return; } // LOOK WALL if (strcmp(input, "look wall") == 0 || strcmp(input, "look walls") == 0) { printf("\nThe walls are made of metal."); return; } // TAKE WALL if (strcmp(input, "take wall") == 0 || strcmp(input, "take walls") == 0) { printf("\nAs much as you try to, you can't take down the wall."); return; } // LOOK FLOOR if (strcmp(input, "look floor") == 0) { printf("\nThe floor is made of metal."); return; } // TAKE FLOOR if (strcmp(input, "take floor") == 0) { printf("\nAs much as you try to, you can't tear up the floor."); return; } // LOOK CEILING if (strcmp(input, "look ceiling") == 0) { printf("\nThe ceiling is made of metal."); return; } // TAKE CEILING if (strcmp(input, "take ceiling") == 0) { printf("\nYou can't quite reach the ceiling despite jumping as high as you can."); return; } // LOOK DOOR if (strcmp(input, "look door") == 0 || strcmp(input, "look doors") == 0) { if (roomid == 1) { printf("\nThe doors are made of metal and opens automatically when you approach them."); printf("\nNone of the doors has window on them."); } if (roomid != 1) { printf("\nThe door is made of metal and opens automatically when you approach them."); printf("\nThere isn't any window on the door."); } return; } // TAKE DOOR if (strcmp(input, "take door") == 0 || strcmp(input, "take doors") == 0) { printf("\nAfter numerous attempts, you have came to conclusion that you can't tear the door out of its frame."); return; } // LOOK DOOR LIGHT / LOOK LIGHT ABOVE DOOR if (strcmp(input, "look door light") == 0 || strcmp(input, "look doors light") == 0 || strcmp(input, "look door lights") == 0 || strcmp(input, "look doors lights") == 0 || strcmp(input, "look light above door") == 0 || strcmp(input, "look lights above door") == 0 || strcmp(input, "look light above doors") == 0 || strcmp(input, "look lights above doors") == 0) { printf("\nThe light is an indicator of the status of the door."); printf("\nRed is locked and green is unlocked."); if (roomid == 1) { if (northdoor == 0) { printf("\nThe light above the door in the north is red."); } if (northdoor != 0) { printf("\nThe light above the door in the north is green."); } if (southdoor == 0) { printf("\nThe light above the door in the south is red."); } if (southdoor != 0) { printf("\nThe light above the door in the south is green."); } if (eastdoor == 0) { printf("\nThe light above the door in the east is red."); } if (eastdoor != 0) { printf("\nThe light above the door in the east is green."); } if (westdoor == 0) { printf("\nThe light above the door in the west is red."); } if (westdoor != 0) { printf("\nThe light above the door in the west is green."); } } if (roomid == 2) { if (eastdoor == 0) { printf("\nThe light above the door in the west is red."); } if (eastdoor != 0) { printf("\nThe light above the door in the west is green."); } } if (roomid == 3) { if (westdoor == 0) { printf("\nThe light above the door in the east is red."); } if (westdoor != 0) { printf("\nThe light above the door in the east is green."); } } if (roomid == 4) { if (southdoor == 0) { printf("\nThe light above the door in the north is red."); } if (southdoor != 0) { printf("\nThe light above the door in the north is green."); } } if (roomid == 5) { if (northdoor == 0) { printf("\nThe light above the door in the south is red."); } if (northdoor != 0) { printf("\nThe light above the door in the south is green."); } } return; } // TAKE DOOR LIGHT if (strcmp(input, "take door light") == 0 || strcmp(input, "take doors light") == 0 || strcmp(input, "take doors lights") == 0 || strcmp(input, "take door lights") == 0) { printf("\nAfter many attempts, you've given up. It's impossible to dislodge the light above the door."); return; } // LOOK LIGHT if (strcmp(input, "look light") == 0 || strcmp(input, "look lights") == 0) { if (roomid != 3) { printf("\nThere is a light source on the ceiling."); printf("\nIt looks like a very bright LED embedded in the ceiling."); } printf("\nThe light above the door is an indicator of the status of the door."); printf("\nRed is locked and green is unlocked."); if (roomid == 1) { if (northdoor == 0) { printf("\nThe light above the door in the north is red."); } if (northdoor != 0) { printf("\nThe light above the door in the north is green."); } if (southdoor == 0) { printf("\nThe light above the door in the south is red."); } if (southdoor != 0) { printf("\nThe light above the door in the south is green."); } if (eastdoor == 0) { printf("\nThe light above the door in the east is red."); } if (eastdoor != 0) { printf("\nThe light above the door in the east is green."); } if (westdoor == 0) { printf("\nThe light above the door in the west is red."); } if (westdoor != 0) { printf("\nThe light above the door in the west is green."); } } if (roomid == 2) { if (eastdoor == 0) { printf("\nThe light above the door in the west is red."); } if (eastdoor != 0) { printf("\nThe light above the door in the west is green."); } } if (roomid == 3) { if (westdoor == 0) { printf("\nThe light above the door in the east is red."); } if (westdoor != 0) { printf("\nThe light above the door in the east is green."); } } if (roomid == 4) { if (southdoor == 0) { printf("\nThe light above the door in the north is red."); } if (southdoor != 0) { printf("\nThe light above the door in the north is green."); } } if (roomid == 5) { if (northdoor == 0) { printf("\nThe light above the door in the south is red."); } if (northdoor != 0) { printf("\nThe light above the door in the south is green."); } } if (flashlighton != 0) { printf("\nLight is shining from the flashlight."); } return; } // TAKE LIGHT if (strcmp(input, "take light") == 0 || strcmp(input, "take lights") == 0) { if (roomid != 3) { printf("\nYou can't quite reach the light on the ceiling despite repeatedly jumping as high as you can."); } if (roomid == 3) { printf("\nThere is no light in here, other than the dim light above the door in the east."); } return; } // LOOK PAPER if (strcmp(input, "look paper") == 0) { if (paper != 0) { printf("\nIt's a piece of paper filled with strange scribbles."); printf("\nYou can't understand the scribbles."); } if (paper == 0) { if (roomid != 2) { printf("\nWhat paper?"); } if (roomid == 2) { printf("\nIt's a piece of paper, you can see scribbles on it."); printf("\nIt's currently laying on the floor."); } } return; } // TAKE PAPER if (strcmp(input, "take paper") == 0) { if (paper != 0) { printf("\nYou already took the paper."); } if (paper == 0) { if (roomid != 2) { printf("\nWhat paper?"); } if (roomid == 2) { printf("\nTaken."); printf("\nThe paper was covering a yellow switch."); paper = 1; emptyinventory = 0; } } return; } // LOOK FLASHLIGHT if (strcmp(input, "look flashlight") == 0) { if (flashlight == 0) { printf("\nWhat flashlight?"); } if (flashlight != 0) { if (flashlightbatteries == 0) { printf("\nIt's a simple flashlight. It needs some batteries, though."); } if (flashlightbatteries != 0) { if (flashlighton == 0) { printf("\nIt's a simple flashlight. It is currently off."); } if (flashlighton != 0) { printf("\nIt's a simple flashlight. It is currently on and illuminating the area."); } } } return; } // TAKE FLASHLIGHT if (strcmp(input, "take flashlight") == 0) { if (flashlight == 0) { printf("\nWhat flashlight?"); } if (flashlight != 0) { printf("\nYou already took the flashlight."); } return; } // LOOK BATTERIES if (strcmp(input, "look batteries") == 0 || strcmp(input, "look battery") == 0) { if (batteries != 0) { printf("\nThey're D cell batteries."); } if (roomid == 5 && batteries == 0 && steelbox != 0) { printf("\nThey're D cell batteries. The batteries are currently inside the steel box."); } if (batteries == 0) { if (strcmp(input, "look batteries") == 0) { printf("\nWhat batteries?"); } if (strcmp(input, "look battery") == 0) { printf("\nWhat battery?"); } } return; } // TAKE BATTERIES if (strcmp(input, "take batteries") == 0 || strcmp(input, "take battery") == 0) { if (batteries != 0) { printf("\nYou already took the batteries."); } if (roomid == 5 && batteries == 0 && steelbox != 0) { printf("\nTaken."); batteries = 1; emptyinventory = 0; } if (batteries == 0) { if (strcmp(input, "take batteries") == 0) { printf("\nWhat batteries?"); } if (strcmp(input, "take battery") == 0) { printf("\nWhat battery?"); } } return; } // INSERT BATTERIES INTO FLASHLIGHT if (strcmp(input, "put batteries in flashlight") == 0 || strcmp(input, "put batteries into flashlight") == 0 || strcmp(input, "put battery in flashlight") == 0 || strcmp(input, "put battery into flashlight") == 0 || strcmp(input, "insert batteries in flashlight") == 0 || strcmp(input, "insert batteries into flashlight") == 0 || strcmp(input, "insert battery in flashlight") == 0 || strcmp(input, "insert battery into flashlight") == 0) { if (flashlight != 0) { if (batteries != 0) { if (flashlightbatteries != 0) { printf("\nBatteries are already inside the flashlight."); } if (flashlightbatteries == 0) { printf("\nBatteries are now inside the flashlight."); flashlightbatteries = 1; } } if (batteries == 0) { printf("\nYou don't have any batteries."); } } if (flashlight == 0) { printf("\nWhat flashlight?"); if (batteries == 0) { if (strcmp(input, "put batteries in flashlight") == 0 || strcmp(input, "put batteries into flashlight") == 0 || strcmp(input, "insert batteries in flashlight") == 0 || strcmp(input, "insert batteries into flashlight") == 0) { printf("\nWhat batteries?"); } if (strcmp(input, "put battery in flashlight") == 0 || strcmp(input, "put battery into flashlight") == 0 || strcmp(input, "insert battery in flashlight") == 0 || strcmp(input, "insert battery into flashlight") == 0) { printf("\nWhat battery?"); } } } return; } // TURN FLASHLIGHT ON if (strcmp(input, "turn flashlight on") == 0 || strcmp(input, "turn on flashlight") == 0 || strcmp(input, "turn on light") == 0 || strcmp(input, "turn light on") == 0) { if (flashlight != 0) { if (flashlightbatteries != 0) { if (flashlighton != 0) { printf("\nThe flashlight is already turned on."); } if (flashlighton == 0) { printf("\nYou turn the flashlight on. Light is shining from it."); flashlighton = 1; } } if (flashlightbatteries == 0) { printf("\nFlashlight won't turn on. There are no batteries inside it."); } } if (flashlight == 0) { printf("\nWhat flashlight?"); } return; } // TURN FLASHLIGHT OFF if (strcmp(input, "turn flashlight off") == 0 || strcmp(input, "turn off flashlight") == 0 || strcmp(input, "turn off light") == 0 || strcmp(input, "turn light off") == 0) { if (flashlight != 0) { if (flashlighton == 0) { printf("\nThe flashlight is already off."); } if (flashlighton != 0) { flashlighton = 0; if (roomid != 3) { printf("\nYou turn the flashlight off."); } if (roomid == 3) { westRoom(); } } } if (flashlight == 0) { printf("\nWhat flashlight?"); } return; } // LOOK ALUMINUM KEY if (strcmp(input, "look aluminum key") == 0 || strcmp(input, "look aluminum") == 0) { if (aluminumkey != 0) { printf("\nIt's a lightweight key made out of aluminum."); } if (roomid == 2) { if (aluminumkey == 0 && bronzebox == 2) { printf("\nIt's a lightweight key made out of aluminum."); printf("\nThe aluminum key is currently sitting inside the bronze box."); } if (aluminumkey == 0 && bronzebox != 2){ if (strcmp(input, "look aluminum key") == 0) { printf("\nYou don't see any aluminum key in here."); } if (strcmp(input, "look aluminum") == 0) { printf("\nYou don't see anything aluminum in here."); } } } if (roomid != 2 && aluminumkey == 0) { if (strcmp(input, "look aluminum key") == 0) { printf("\nYou don't see any aluminum key in here."); } if (strcmp(input, "look aluminum") == 0) { printf("\nYou don't see anything aluminum in here."); } } return; } // TAKE ALUMINUM KEY if (strcmp(input, "take aluminum key") == 0 || strcmp(input, "take aluminum") == 0) { if (aluminumkey != 0) { printf("\nYou already took the aluminum key."); } if (roomid == 2) { if (aluminumkey == 0 && bronzebox == 2){ printf("\nTaken."); aluminumkey = 1; emptyinventory = 0; } if (aluminumkey == 0 && bronzebox != 2){ if (strcmp(input, "take aluminum key") == 0) { printf("\nYou don't see any aluminum key in here."); } if (strcmp(input, "take aluminum") == 0) { printf("\nYou don't see anything aluminum in here."); } } } if (roomid != 2 && aluminumkey == 0) { if (strcmp(input, "take aluminum key") == 0) { printf("\nYou don't see any aluminum key in here."); } if (strcmp(input, "take aluminum") == 0) { printf("\nYou don't see anything aluminum in here."); } } return; } // USE ALUMINUM KEY if (strcmp(input, "use aluminum key") == 0 || strcmp(input, "use aluminum") == 0) { if (aluminumkey != 0) { printf("\nPlease specify which lock to unlock using aluminum key."); } if (roomid == 2 && aluminumkey == 0 && bronzebox == 2){ printf("\nYou need to take the aluminum key first."); } else { if (strcmp(input, "use aluminum key") == 0) { printf("\nWhat aluminum key?"); } if (strcmp(input, "use aluminum") == 0) { printf("\nWhat aluminum?"); } } return; } // LOOK BRASS KEY / LOOK BRASS if (strcmp(input, "look brass key") == 0 || strcmp(input, "look brass") == 0) { if (brasskey != 0) { printf("\nIt's a key made of burnished brass."); } if (roomid == 4) { if (brasskey == 0 && planter != 0) { printf("\nIt's a key made of burnished brass."); printf("\nBrass key is currently partially buried in a pile of dirt."); } if (brasskey == 0 && planter == 0) { if (strcmp(input, "look brass key") == 0) { printf("\nYou don't see any brass key in here."); } if (strcmp(input, "look brass") == 0) { printf("\nYou don't see anything brass in here."); } } } if (roomid != 4 && brasskey == 0) { if (strcmp(input, "look brass key") == 0) { printf("\nYou don't see any brass key in here."); } if (strcmp(input, "look brass") == 0) { printf("\nYou don't see anything brass in here."); } } return; } // TAKE BRASS KEY if (strcmp(input, "take brass key") == 0 || strcmp(input, "take brass") == 0) { if (brasskey != 0) { printf("\nYou already took the brass key."); } if (roomid == 4) { if (brasskey == 0 && planter != 0) { printf("\nTaken."); brasskey = 1; emptyinventory = 0; } if (brasskey == 0 && planter != 0) { if (strcmp(input, "take brass key") == 0) { printf("\nYou don't see any brass key in here."); } if (strcmp(input, "take brass") == 0) { printf("\nYou don't see anything brass in here."); } } } if (roomid != 4 && brasskey == 0) { if (strcmp(input, "take brass key") == 0) { printf("\nYou don't see any brass key in here."); } if (strcmp(input, "take brass") == 0) { printf("\nYou don't see anything brass in here."); } } return; } // USE BRASS KEY if (strcmp(input, "use brass key") == 0 || strcmp(input, "use brass") == 0) { if (brasskey != 0) { printf("\nPlease specify which lock to unlock using brass key."); } if (roomid == 4 && planter != 0 && brasskey == 0){ printf("\nYou need to take the brass key first."); } else { if (strcmp(input, "use brass key") == 0) { printf("\nWhat brass key?"); } if (strcmp(input, "use brass") == 0) { printf("\nWhat brass?"); } } return; } // LOOK IRON KEY / LOOK IRON if (strcmp(input, "look iron key") == 0 || strcmp(input, "look iron") == 0) { if (ironkey != 0) { printf("\nIt's a heavy key made out of iron."); } if (roomid == 3) { if (ironkey == 0 && titaniumbox != 0){ printf("\nIt's a heavy key made out of iron."); printf("\nIron key is currently inside the titanium box."); } if (ironkey == 0 && titaniumbox == 0){ if (strcmp(input, "look iron key") == 0) { printf("\nYou don't see any iron key in here."); } if (strcmp(input, "look iron") == 0) { printf("\nYou don't see anything iron in here."); } } } if (roomid != 3 && ironkey == 0) { if (strcmp(input, "look iron key") == 0) { printf("\nYou don't see any iron key in here."); } if (strcmp(input, "look iron") == 0) { printf("\nYou don't see anything iron in here."); } } return; } // TAKE IRON KEY if (strcmp(input, "take iron key") == 0 || strcmp(input, "take iron") == 0) { if (ironkey != 0) { printf("\nYou already took the iron key."); } if (roomid == 3) { if (ironkey == 0 && titaniumbox != 0){ printf("\nTaken."); ironkey = 1; emptyinventory = 0; } if (ironkey == 0 && titaniumbox == 0){ if (strcmp(input, "take iron key") == 0) { printf("\nYou don't see any iron key in here."); } if (strcmp(input, "take iron") == 0) { printf("\nYou don't see anything iron in here."); } } } if (roomid != 3 && ironkey == 0) { if (strcmp(input, "take iron key") == 0) { printf("\nYou don't see any iron key in here."); } if (strcmp(input, "take iron") == 0) { printf("\nYou don't see anything iron in here."); } } return; } // USE IRON KEY if (strcmp(input, "use iron key") == 0 || strcmp(input, "use iron") == 0) { if (ironkey != 0) { printf("\nPlease specify which lock to unlock using iron key."); } if (roomid == 3 && ironkey == 0 && titaniumbox != 0){ printf("\nYou need to take the iron key first."); } else { if (strcmp(input, "use iron key") == 0) { printf("\nWhat iron key?"); } if (strcmp(input, "use iron") == 0) { printf("\nWhat iron?"); } } return; } // LOOK KEY if (strcmp(input, "look key") == 0) { if (roomid == 1 || roomid == 5) { if (ironkey != 0 || brasskey != 0 || aluminumkey != 0) { printf("\nPlease specify which key to look at."); } if (ironkey == 0 && brasskey == 0 && aluminumkey == 0) { printf("\nWhat key?"); } } if (roomid == 2) { if (aluminumkey == 0 && bronzebox == 2) { if (ironkey == 0 && brasskey == 0) { printf("\nIt's a lightweight key made out of aluminum."); printf("\nAluminum key is currently sitting inside the bronze box."); } if (ironkey != 0 || brasskey != 0) { printf("\nPlease specify which key to look at."); } } if (aluminumkey == 0 && bronzebox != 2) { if (ironkey != 0 || brasskey != 0) { printf("\nPlease specify which key to look at."); } if (ironkey == 0 && brasskey == 0) { printf("\nWhat key?"); } } } if (roomid == 3) { if (ironkey == 0 && titaniumbox != 0) { if (aluminumkey == 0 && brasskey == 0) { printf("\nIt's a very heavy key made of iron."); printf("\nIron key is currently sitting inside the titanium box."); } if (aluminumkey != 0 || brasskey != 0) { printf("\nPlease specify which key to look at."); } } if (ironkey == 0 && titaniumbox == 0) { if (aluminumkey != 0 || brasskey != 0) { printf("\nPlease specify which key to look at."); } if (aluminumkey == 0 && brasskey == 0) { printf("\nWhat key?"); } } } if (roomid == 4) { if (planter != 0 && brasskey == 0) { if (aluminumkey == 0 && ironkey == 0) { printf("\nIt's a key made of burnished brass."); printf("\nBrass key is currently partially buried in a pile of dirt."); } if (aluminumkey != 0 || ironkey != 0) { printf("\nPlease specify which key to look at."); } } if (planter == 0 && brasskey == 0) { if (aluminumkey != 0 || ironkey != 0) { printf("\nPlease specify which key to look at."); } if (aluminumkey == 0 && ironkey == 0) { printf("\nWhat key?"); } } // THIS CONDITION ONLY EXISTS IN DEBUG MODE! if (planter == 0 && brasskey != 0) { if (aluminumkey == 0 && ironkey == 0) { printf("\n*DEBUG* It's a key made of burnished brass."); printf("\n*DEBUG* Brass key is currently partially buried in a pile of dirt."); } if (aluminumkey != 0 || ironkey != 0) { printf("\n*DEBUG* Please specify which key to look at."); } } } return; } // TAKE KEY if (strcmp(input, "take key") == 0) { if (roomid == 1 || roomid == 5) { printf("\nYou don't see any key here."); } if (roomid == 2) { if (aluminumkey != 0) { printf("\nYou already took the aluminum key."); } if (aluminumkey == 0 && bronzebox == 2) { printf("\nTaken."); aluminumkey = 1; emptyinventory = 0; } if (aluminumkey == 0 && bronzebox != 2) { printf("\nYou don't see any key here."); } } if (roomid == 3) { if (ironkey != 0) { printf("\nYou already took the iron key."); } if (ironkey == 0 && titaniumbox != 0) { printf("\nTaken."); ironkey = 1; emptyinventory = 0; } if (ironkey == 0 && titaniumbox == 0) { printf("\nYou don't see any key here."); } } if (roomid == 4) { if (planter != 0 && brasskey != 0) { printf("\nYou already took the brass key."); } if (planter == 0 && brasskey != 0) { //THIS CONDITION EXISTS ONLY IN DEBUG MODE. printf("\n*DEBUG* You already took the brass key."); } if (planter != 0 && brasskey == 0) { printf("\nTaken."); brasskey = 1; emptyinventory = 0; } if (planter == 0 && brasskey == 0) { printf("\nYou don't see any key here."); } } return; } // USE KEY if (strcmp(input, "use key") == 0) { if (ironkey != 0 || brasskey != 0 || aluminumkey != 0) { printf("\nPlease specify the key to use and the lock to unlock using the key."); } if (ironkey == 0 && brasskey == 0 && aluminumkey == 0) { printf("\nWhat key?"); } return; } // LOOK SWITCH if (strcmp(input, "look switch") == 0 || strcmp(input, "look switches") == 0) { if (roomid == 1 || roomid == 3 || (roomid == 5 && northaccesspanel == 0) || (roomid == 4 && southaccesspanel == 0)) { printf("\nYou don't see any switch here."); } if (roomid == 2) { printf("\nGreen switch on the wall is a small push button switch the size of a coin."); if (paper != 0) { printf("\nYellow switch on the floor is a small oval switch."); } } if (roomid == 4 && southaccesspanel == 2) { printf("\nThere is a red switch and a blue switch inside the metal access panel."); printf("\nBoth red and blue switches are square push button switch the size of a coin."); } if (roomid == 5 && northaccesspanel != 0) { printf("\nThere is a white switch and a black switch inside the metal access panel."); printf("\nBoth black and white switches are round push button switch the size of a coin."); } return; } // TAKE SWITCH if (strcmp(input, "take switch") == 0 || strcmp(input, "take switches") == 0) { if (roomid == 1 || roomid == 3 || (roomid == 5 && northaccesspanel == 0) || (roomid == 4 && southaccesspanel == 0)) { printf("\nYou don't see any switch here."); } if (roomid == 2) { printf("\nGreen switch is securely affixed to the wall. You can't take it."); if (paper != 0) { printf("\nYellow switch is securely affixed to the floor. You can't take it."); } } if (roomid == 4 && southaccesspanel == 2) { printf("\nBlue switch is securely affixed to inside of the panel. You can't take it."); printf("\nRed switch is securely affixed to inside of the panel. You can't take it."); } if (roomid == 5 && northaccesspanel != 0) { printf("\nBlack switch is securely affixed to inside of the panel. You can't take it."); printf("\nWhite switch is securely affixed to inside of the panel. You can't take it."); } return; } // PRESS SWITCH if (strcmp(input, "press switch") == 0 || strcmp(input, "push switch") == 0) { if (roomid == 1 || roomid == 3) { printf("\nYou don't see any switch here."); } if (roomid == 2) { if (paper != 0) { printf("\nYou press the green switch."); if (northdoor == 0 && bronzebox != 2) { northdoor = 1; return; } if (northdoor != 0 && bronzebox != 2) { northdoor = 0; return; } if (northdoor != 0 && bronzebox == 2) { northdoor = 0; return; } if (northdoor == 0 && bronzebox == 2) { northdoor = 0; return; } } if (paper == 0) { printf("\nPlease specify which switch to press."); } } if (roomid == 4) { if (southaccesspanel != 2) { printf("\nYou don't see any switch here."); } if (southaccesspanel == 2) { printf("\nPlease specify which switch to press."); } } if (roomid == 5) { if (northaccesspanel == 0) { printf("\nYou don't see any switch here."); } if (northaccesspanel != 0) { printf("\nPlease specify which switch to press."); } } return; } // LOOK RED SWITCH if (strcmp(input, "look red switch") == 0 || strcmp(input, "look red") == 0) { if (roomid == 4 && southaccesspanel == 2) { printf("\nRed switch inside the access panel is a square push button switch the size of a coin."); } else { if (strcmp(input, "look red switch") == 0) { printf("\nYou don't see any red switch here."); } if (strcmp(input, "look red") == 0) { printf("\nYou don't see anything red in here."); } } return; } // TAKE RED SWITCH if (strcmp(input, "take red switch") == 0 || strcmp(input, "take red") == 0) { if (roomid == 4 && southaccesspanel == 2) { printf("\nRed switch is securely affixed to inside of the panel. You can't take it."); } else { if (strcmp(input, "take red switch") == 0) { printf("\nYou don't see any red switch here."); } if (strcmp(input, "take red") == 0) { printf("\nYou don't see anything red in here."); } } return; } // PRESS/PUSH RED SWITCH if (strcmp(input, "press red switch") == 0 || strcmp(input, "press red") == 0 || strcmp(input, "push red switch") == 0 || strcmp(input, "push red") == 0) { if (roomid == 4 && southaccesspanel == 2) { printf("\nYou press the red switch."); if (bronzebox == 0 && bronzebox != 2) { bronzebox = 1; return; } if (bronzebox != 0 && bronzebox != 2) { bronzebox = 0; return; } if (bronzebox == 0 && bronzebox == 2) { bronzebox = 1; printf("\n**DEBUG ONLY SITUATION - SETTING BRONZE BOX STATE TO 1**"); return; } if (bronzebox == 1 && bronzebox == 2) { bronzebox = 0; printf("\n**DEBUG ONLY SITUATION - SETTING BRONZE BOX STATE TO 0**"); return; } } else { if (strcmp(input, "press red switch") == 0 || strcmp(input, "push red switch") == 0) { printf("\nYou don't see any red switch here."); } if (strcmp(input, "press red") == 0 || strcmp(input, "push red") == 0) { printf("\nYou don't see anything red in here."); } } return; } // LOOK BLUE SWITCH if (strcmp(input, "look blue switch") == 0 || strcmp(input, "look blue") == 0) { if (roomid == 4 && southaccesspanel == 2) { printf("\nBlue switch inside the access panel is a square push button switch the size of a coin."); } else { if (strcmp(input, "look blue switch") == 0) { printf("\nYou don't see any blue switch here."); } if (strcmp(input, "look blue") == 0) { printf("\nYou don't see anything blue in here."); } } return; } // TAKE BLUE SWITCH if (strcmp(input, "take blue switch") == 0 || strcmp(input, "take blue") == 0) { if (roomid == 4 && southaccesspanel == 2) { printf("\nBlue switch is securely affixed to inside of the panel. You can't take it."); } else { if (strcmp(input, "take blue switch") == 0) { printf("\nYou don't see any blue switch here."); } if (strcmp(input, "take blue") == 0) { printf("\nYou don't see anything blue in here."); } } return; } // PRESS/PUSH BLUE SWITCH if (strcmp(input, "press blue switch") == 0 || strcmp(input, "press blue") == 0 || strcmp(input, "push blue switch") == 0 || strcmp(input, "push blue") == 0) { if (roomid == 4 && southaccesspanel == 2) { printf("\nYou press the blue switch."); if (eastdoor == 0) { eastdoor = 1; return; } if (eastdoor != 0) { eastdoor = 0; return; } } else { if (strcmp(input, "press blue switch") == 0 || strcmp(input, "push blue switch") == 0) { printf("\nYou don't see any blue switch here."); } if (strcmp(input, "press blue") == 0 || strcmp(input, "push blue") == 0) { printf("\nYou don't see anything blue in here."); } } return; } // LOOK BLACK SWITCH if (strcmp(input, "look black switch") == 0 || strcmp(input, "look black") == 0) { if (roomid == 5 && northaccesspanel != 0) { printf("\nBlack switch inside the access panel is a round push button switch the size of a coin."); } else { if (strcmp(input, "look black switch") == 0) { printf("\nYou don't see any black switch here."); } if (strcmp(input, "look black") == 0) { printf("\nYou don't see anything black in here."); } } return; } // TAKE BLACK SWITCH if (strcmp(input, "take black switch") == 0 || strcmp(input, "take black") == 0) { if (roomid == 5 && northaccesspanel != 0) { printf("\nBlack switch is securely affixed to inside of the panel. You can't take it."); } else { if (strcmp(input, "take black switch") == 0) { printf("\nYou don't see any black switch here."); } if (strcmp(input, "take black") == 0) { printf("\nYou don't see anything black in here."); } } return; } // PRESS/PUSH BLACK SWITCH if (strcmp(input, "press black switch") == 0 || strcmp(input, "press black") == 0 || strcmp(input, "push black switch") == 0 || strcmp(input, "push black") == 0) { if (roomid == 5 && northaccesspanel != 0) { printf("\nYou press the black switch."); if (southdoor == 0) { southdoor = 1; return; } if (southdoor != 0) { southdoor = 0; return; } } else { if (strcmp(input, "press black switch") == 0 || strcmp(input, "push black switch") == 0) { printf("\nYou don't see any black switch here."); } if (strcmp(input, "press black") == 0 || strcmp(input, "push black") == 0) { printf("\nYou don't see anything black in here."); } } return; } // LOOK WHITE SWITCH if (strcmp(input, "look white switch") == 0 || strcmp(input, "look white") == 0) { if (roomid == 5 && northaccesspanel != 0) { printf("\nWhite switch inside the access panel is a round push button switch the size of a coin."); } else { if (strcmp(input, "look white switch") == 0) { printf("\nYou don't see any white switch here."); } if (strcmp(input, "look white") == 0) { printf("\nYou don't see anything white in here."); } } return; } // TAKE WHITE SWITCH if (strcmp(input, "take white switch") == 0 || strcmp(input, "take white") == 0) { if (roomid == 5 && northaccesspanel != 0) { printf("\nWhite switch is securely affixed to inside of the panel. You can't take it."); } else { if (strcmp(input, "take white switch") == 0) { printf("\nYou don't see any white switch here."); } if (strcmp(input, "take white") == 0) { printf("\nYou don't see anything white in here."); } } return; } // PRESS/PUSH WHITE SWITCH if (strcmp(input, "press white switch") == 0 || strcmp(input, "press white") == 0 || strcmp(input, "push white switch") == 0 || strcmp(input, "push white") == 0) { if (roomid == 5 && northaccesspanel != 0) { printf("\nYou press the white switch."); if (southaccesspanel == 0) { southaccesspanel = 1; return; } if (southaccesspanel != 0) { southaccesspanel = 0; return; } } else { if (strcmp(input, "press white switch") == 0 || strcmp(input, "push white switch") == 0) { printf("\nYou don't see any white switch here."); } if (strcmp(input, "press white") == 0 || strcmp(input, "push white") == 0) { printf("\nYou don't see anything white in here."); } } return; } // LOOK GREEN SWITCH if (strcmp(input, "look green switch") == 0 || strcmp(input, "look green") == 0) { if (roomid == 2) { printf("\nGreen switch on the wall is a push button switch the size of a coin."); } else{ if (strcmp(input, "look green switch") == 0) { printf("\nYou don't see any green switch here."); } if (strcmp(input, "look green") == 0) { printf("\nYou don't see anything green in here."); } } return; } // TAKE GREEN SWITCH if (strcmp(input, "take green switch") == 0 || strcmp(input, "take green") == 0) { if (roomid == 2) { printf("\nGreen switch is securely affixed to the wall. You can't take it."); } else { if (strcmp(input, "take green switch") == 0) { printf("\nYou don't see any green switch here."); } if (strcmp(input, "take green switch") == 0) { printf("\nYou don't see anything green in here."); } } return; } // PRESS GREEN SWITCH if (strcmp(input, "press green switch") == 0 || strcmp(input, "push green switch") == 0 || strcmp(input, "press green") == 0 || strcmp(input, "push green") == 0) { if (roomid == 2) { printf("\nYou press the green switch."); if (northdoor == 0 && bronzebox != 2) { northdoor = 1; return; } if ((northdoor != 0 && bronzebox != 2) || bronzebox == 2) { northdoor = 0; return; } } else { if (strcmp(input, "press green switch") == 0 || strcmp(input, "push green switch") == 0) { printf("\nYou don't see any green switch here."); } if (strcmp(input, "press green") == 0 || strcmp(input, "push green") == 0) { printf("\nYou don't see anything green in here."); } } return; } // LOOK YELLOW SWITCH if (strcmp(input, "look yellow switch") == 0 || strcmp(input, "look yellow") == 0) { if (roomid == 2 && paper != 0) { printf("\nYellow switch on the floor is a small oval switch."); } else { if (strcmp(input, "look yellow switch") == 0) { printf("\nYou don't see any yellow switch here."); } if (strcmp(input, "look yellow") == 0) { printf("\nYou don't see anything yellow in here."); } } return; } // TAKE YELLOW SWITCH if (strcmp(input, "take yellow switch") == 0 || strcmp(input, "take yellow") == 0) { if (roomid == 2 && paper != 0) { printf("\nYellow switch is securely affixed to the floor. You can't take it."); } else { if (strcmp(input, "take yellow switch") == 0) { printf("\nYou don't see any yellow switch here."); } if (strcmp(input, "take yellow") == 0) { printf("\nYou don't see anything yellow in here."); } } return; } // PRESS YELLOW SWITCH if (strcmp(input, "press yellow switch") == 0 || strcmp(input, "push yellow switch") == 0 || strcmp(input, "press yellow") == 0 || strcmp(input, "push yellow") == 0) { if (roomid == 2 & paper != 0) { printf("\nYou press the yellow switch."); if (eastdoor != 0) { printf("\nThe light above the door in the west is now red."); eastdoor = 0; return; } if (eastdoor == 0) { printf("\nThe light above the door in the west is now green."); eastdoor = 1; return; } } else { if (strcmp(input, "press yellow switch") == 0 || strcmp(input, "push yellow switch") == 0) { printf("\nYou don't see any yellow switch here."); } if (strcmp(input, "press yellow") == 0 || strcmp(input, "push yellow") == 0) { printf("\nYou don't see anything yellow in here."); } } return; } // LOOK BOX if (strcmp(input, "look box") == 0) { if (roomid == 1 || roomid == 4) { printf("\nThere isn't any box here."); } if (roomid == 2) { printf("\nIt's a box made out of bronze."); printf("\nYou can't see any keyhole on it."); if (bronzebox != 2) { printf("\nThe bronze box is currently closed."); } if (bronzebox == 2) { printf("\nThe bronze box is currently open."); if (aluminumkey == 0) { printf("\nThere is an aluminum key inside the bronze box."); } if (aluminumkey != 0) { printf("\nThe bronze box is empty."); } } } if (roomid == 3) { printf("\nThe box is made out of titanium."); printf("\nThere is a keyhole on a side of the titanium box."); if (titaniumbox == 0) { printf("\nThe titanium box is currently closed."); } if (titaniumbox != 0) { printf("\nThe titanium box is currently open."); if (ironkey == 0) { printf("\nThere is an iron key inside the titanium box."); } if (ironkey != 0) { printf("\nThe titanium box is empty."); } } } if (roomid == 5) { printf("\nThe box is made out of steel."); printf("\nThere is a keyhole on a side of the steel box."); if (steelbox == 0) { printf("\nThe steel box is currently closed."); } if (steelbox != 0) { printf("\nThe steel box is currently open."); if (batteries == 0) { printf("\nThere are batteries inside the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } } return; } // OPEN BOX if (strcmp(input, "open box") == 0) { if (roomid == 1 || roomid == 4) { printf("\nThere isn't any box here."); } if (roomid == 2) { if (bronzebox == 2) { printf("\nThe bronze box is already open."); if (aluminumkey == 0) { printf("\nThere is an aluminum key inside the bronze box."); } if (aluminumkey != 0) { printf("\nThe bronze box is empty."); } } if (bronzebox == 1) { printf("\nYou open the bronze box."); bronzebox = 2; northdoor = 0; southdoor = 0; westdoor = 1; if (aluminumkey == 0) { printf("\nThere is an aluminum key inside the bronze box."); } if (aluminumkey != 0) { printf("\nThe bronze box is empty."); } } if (bronzebox == 0) { printf("\nThe bronze box is securely locked. You can't open it."); } } if (roomid == 3) { if (titaniumbox == 0) { printf("\nYou can't open the titanium box."); printf("\nYou will need to unlock the titanium box with a key."); } if (titaniumbox != 0) { printf("\nThe titanium box is already open."); if (ironkey == 0) { printf("\nThere is a iron key inside the titanium box."); } if (ironkey != 0) { printf("\nThe titanium box is empty."); } } } if (roomid == 5) { if (steelbox == 0) { printf("\nYou can't open the steel box."); printf("\nYou will need to unlock the steel box with a key."); } if (steelbox != 0) { printf("\nThe steel box is already open."); if (batteries == 0) { printf("\nThere are batteries inside the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } } return; } // UNLOCK BOX WITH KEY / OPEN BOX WITH KEY // UNLOCK BOX if (strcmp(input, "use key on box") == 0 || strcmp(input, "use key to open box") == 0 || strcmp(input, "use key to unlock box") == 0 || strcmp(input, "open box with key") == 0 || strcmp(input, "open box using key") == 0 || strcmp(input, "unlock box using key") == 0 || strcmp(input, "unlock box") == 0 || strcmp(input, "unlock box with key") == 0) { if (roomid == 1 || roomid == 4){ printf("\nThere isn't any in box here."); } if (roomid == 2){ printf("\nThere is no keyhole on the bronze box."); printf("\nThere must be a way to unlock the box."); } if (roomid == 3 || roomid == 5){ if (aluminumkey != 0 || brasskey != 0 || ironkey != 0) { printf("\nPlease specify which key to unlock the box with."); } if (aluminumkey == 0 && brasskey == 0 && ironkey == 0) { printf("\nYou don't have any key."); } } return; } // UNLOCK BOX WITH ALUMINUM KEY / OPEN BOX WITH ALUMINUM KEY if (strcmp(input, "use aluminum key on box") == 0 || strcmp(input, "use aluminum on box") == 0 || strcmp(input, "use aluminum key to open box") == 0 || strcmp(input, "use aluminum to open box") == 0 || strcmp(input, "use aluminum key to unlock box") == 0 || strcmp(input, "use aluminum to unlock box") == 0 || strcmp(input, "open box with aluminum key") == 0 || strcmp(input, "open box with aluminum") == 0 || strcmp(input, "open box using aluminum key") == 0 || strcmp(input, "open box using aluminum") == 0 || strcmp(input, "unlock box using aluminum key") == 0 || strcmp(input, "unlock box using aluminum") == 0 || strcmp(input, "unlock box with aluminum key") == 0 || strcmp(input, "unlock box with aluminum") == 0) { if (roomid == 2 && aluminumkey != 0) { printf("\nThere is no keyhole on the bronze box."); } if (roomid == 3 && aluminumkey != 0) { printf("\nYou attempted to use aluminum key to unlock the " "titanium box, but the aluminum key doesn't fit " "in the keyhole."); } if (roomid == 5 && aluminumkey != 0) { if (steelbox != 0){ printf("\nThe steel box is already open."); } if (steelbox == 0){ printf("\nYou insert the aluminum key into the keyhole on the steel box."); printf("\nThe key fits. After turning the key, the steel box automatically opens."); printf("\nYou take the aluminum key out of the keyhole."); steelbox = 1; } if (batteries == 0) { printf("\nThere are batteries inside the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } if (aluminumkey == 0) { if (strcmp(input, "use aluminum key on box") == 0 || strcmp(input, "use aluminum key to open box") == 0 || strcmp(input, "use aluminum key to unlock box") == 0 || strcmp(input, "open box with aluminum key") == 0 || strcmp(input, "open box using aluminum key") == 0 || strcmp(input, "unlock box using aluminum key") == 0 || strcmp(input, "unlock box with aluminum key") == 0) { printf("\nWhat aluminum key?"); } if (strcmp(input, "use aluminum on box") == 0 || strcmp(input, "use aluminum to open box") == 0 || strcmp(input, "use aluminum to unlock box") == 0 || strcmp(input, "open box with aluminum") == 0 || strcmp(input, "open box using aluminum") == 0 || strcmp(input, "unlock box using aluminum") == 0 || strcmp(input, "unlock box with aluminum") == 0 || strcmp(input, "unlock box with aluminum") == 0) { printf("\nWhat aluminum?"); } if (roomid == 1 || roomid == 4){ printf("\nYou don't see any box here."); } } return; } // UNLOCK BOX WITH BRASS KEY / OPEN BOX WITH BRASS KEY if (strcmp(input, "use brass key on box") == 0 || strcmp(input, "use brass on box") == 0 || strcmp(input, "use brass key to open box") == 0 || strcmp(input, "use brass to open box") == 0 || strcmp(input, "use brass key to unlock box") == 0 || strcmp(input, "use brass to unlock box") == 0 || strcmp(input, "open box with brass key") == 0 || strcmp(input, "open box with brass") == 0 || strcmp(input, "open box using brass key") == 0 || strcmp(input, "open box using brass") == 0 || strcmp(input, "unlock box using brass key") == 0 || strcmp(input, "unlock box using brass") == 0 || strcmp(input, "unlock box with brass key") == 0 || strcmp(input, "unlock box with brass") == 0) { if (roomid == 1 || roomid == 4){ printf("\nYou don't see any box here."); } if (roomid == 2 && brasskey != 0) { printf("\nThere is no keyhole on the bronze box."); } if (roomid == 3 && brasskey != 0) { if (titaniumbox != 0){ printf("\nThe titanium box is already open."); } if (titaniumbox == 0){ printf("\nYou insert the brass key into the keyhole on the titanium box."); printf("\nThe key fits. After turning the key, the titanium box automatically opens."); printf("\nYou take the brass key out of the keyhole."); titaniumbox = 1; } if (ironkey == 0) { printf("\nThere is an iron key inside the titanium box."); } if (ironkey != 0) { printf("\nThe titanium box is empty."); } } if (roomid == 5 && brasskey != 0) { printf("\nYou attempted to use brass key to unlock the " "steel box, but the brass key doens't fit " "in the keyhole."); } if (brasskey == 0) { if (strcmp(input, "use brass key on box") == 0 || strcmp(input, "use brass key to open box") == 0 || strcmp(input, "use brass key to unlock box") == 0 || strcmp(input, "open box with brass key") == 0 || strcmp(input, "open box using brass key") == 0 || strcmp(input, "unlock box using brass key") == 0 || strcmp(input, "unlock box with brass key") == 0) { printf("\nWhat brass key?"); } if (strcmp(input, "use brass on box") == 0 || strcmp(input, "use brass to open box") == 0 || strcmp(input, "use brass to unlock box") == 0 || strcmp(input, "open box with brass") == 0 || strcmp(input, "open box using brass") == 0 || strcmp(input, "unlock box using brass") == 0 || strcmp(input, "unlock box with brass") == 0 || strcmp(input, "unlock box with brass") == 0) { printf("\nWhat brass?"); } } return; } // UNLOCK BOX WITH IRON KEY / OPEN BOX WITH IRON KEY if (strcmp(input, "use iron key on box") == 0 || strcmp(input, "use iron on box") == 0 || strcmp(input, "use iron key to open box") == 0 || strcmp(input, "use iron to open box") == 0 || strcmp(input, "use iron key to unlock box") == 0 || strcmp(input, "use iron to unlock box") == 0 || strcmp(input, "open box with iron key") == 0 || strcmp(input, "open box with iron") == 0 || strcmp(input, "open box using iron key") == 0 || strcmp(input, "open box using iron") == 0 || strcmp(input, "unlock box using iron key") == 0 || strcmp(input, "unlock box using iron") == 0 || strcmp(input, "unlock box with iron key") == 0 || strcmp(input, "unlock box with iron") == 0) { if (roomid == 2 && ironkey != 0) { printf("\nThere is no keyhole on the bronze box."); } if (roomid == 3 && ironkey != 0) { printf("\nYou attempted to use iron key to unlock the " "titanium box, but the iron key doens't fit " "in the keyhole."); } if (roomid == 3 && ironkey != 0) { printf("\nYou attempted to use iron key to unlock the " "steel box, but the iron key doens't fit " "in the keyhole."); } if (ironkey == 0) { if (strcmp(input, "use iron key on box") == 0 || strcmp(input, "use iron key to open box") == 0 || strcmp(input, "use iron key to unlock box") == 0 || strcmp(input, "open box with iron key") == 0 || strcmp(input, "open box using iron key") == 0 || strcmp(input, "unlock box using iron key") == 0 || strcmp(input, "unlock box with iron key") == 0) { printf("\nWhat iron key?"); } if (strcmp(input, "use iron on box") == 0 || strcmp(input, "use iron to open box") == 0 || strcmp(input, "use iron to unlock box") == 0 || strcmp(input, "open box with iron") == 0 || strcmp(input, "open box using iron") == 0 || strcmp(input, "unlock box using iron") == 0 || strcmp(input, "unlock box with iron") == 0 || strcmp(input, "unlock box with iron") == 0) { printf("\nWhat iron?"); } if (roomid == 1 || roomid == 4){ printf("\nYou don't see any box here."); } } return; } // CLOSE BOX if (strcmp(input, "close box") == 0) { if (roomid == 1 || roomid == 4) { printf("\nThere isn't any box here."); } if (roomid == 2) { if (bronzebox != 2) { printf("\nThe bronze box is already closed."); } if (bronzebox == 2) { printf("\nYou close the bronze box."); bronzebox = 1; northdoor = 0; southdoor = 0; westdoor = 0; } } if (roomid == 3) { if (titaniumbox == 0) { printf("\nThe titanium box is already closed."); } if (titaniumbox != 0) { printf("\nYou close the titanium box. The titanium box is now locked."); titaniumbox = 0; } } if (roomid == 5) { if (steelbox == 0) { printf("\nThe steel box is already closed."); } if (steelbox != 0) { printf("\nYou close the steel box. The steel box is now locked."); steelbox = 0; } } return; } // TAKE BOX if (strcmp(input, "take box") == 0) { if (roomid == 1 || roomid == 4) { printf("\nThere isn't any box here."); } if (roomid == 2) { printf("\nThe bronze box seems to be an integral part of the floor, you can't take it."); } if (roomid == 3) { printf("\nThe titanium box seems to be fused to the floor, you can't take it."); } if (roomid == 5) { printf("\nThe steel box is too heavy to lift, you can't take it."); } return; } // LOOK BRONZE BOX if (strcmp(input, "look bronze") == 0 || strcmp(input, "look bronze box") == 0) { if (roomid == 2) { printf("\nThe box is made out of bronze."); printf("\nYou can't see any keyhole on it."); if (bronzebox != 2) { printf("\nThe bronze box is currently closed."); } if (bronzebox == 2) { printf("\nThe bronze box is currently open."); if (aluminumkey == 0) { printf("\nThere is an aluminum key inside the bronze box."); } if (aluminumkey != 0) { printf("\nThe bronze box is empty."); } } } if (roomid != 2) { if (strcmp(input, "look bronze box") == 0) { printf("\nThere isn't any bronze box here."); } if (strcmp(input, "look bronze") == 0) { printf("\nThere isn't anything bronze in here."); } } return; } // UNLOCK BRONZE BOX if (strcmp(input, "unlock bronze box") == 0 || strcmp(input, "unlock bronze") == 0) { if (roomid == 2) { printf("\nThere is no keyhole on the bronze box."); printf("\nThere must be a way to unlock the box."); } if (roomid != 2) { if (strcmp(input, "unlock bronze box") == 0) { printf("\nThere is no bronze box here."); } if (strcmp(input, "unlock bronze") == 0) { printf("\nThere isn't anything bronze in here."); } } return; } // UNLOCK BRONZE BOX WITH KEY / OPEN BRONZE BOX WITH KEY if (strcmp(input, "use key on bronze box") == 0 || strcmp(input, "use key on bronze") == 0 || strcmp(input, "use key to open bronze box") == 0 || strcmp(input, "use key to open bronze") == 0 || strcmp(input, "use key to unlock bronze box") == 0 || strcmp(input, "use key to unlock bronze") == 0 || strcmp(input, "open bronze box with key") == 0 || strcmp(input, "open bronze box using key") == 0 || strcmp(input, "open bronze with key") == 0 || strcmp(input, "open bronze using key") == 0 || strcmp(input, "unlock bronze box using key") == 0 || strcmp(input, "unlock bronze box with key") == 0 || strcmp(input, "unlock bronze using key") == 0 || strcmp(input, "unlock bronze with key") == 0) { if (roomid == 2) { if (aluminumkey != 0 || brasskey != 0 || ironkey != 0) { printf("\nThere is no keyhole on the bronze box."); } } if (roomid != 2) { if (strcmp(input, "use key on bronze box") == 0 || strcmp(input, "use key to open bronze box") == 0 || strcmp(input, "open bronze box with key") == 0 || strcmp(input, "open bronze box using key") == 0 || strcmp(input, "unlock bronze box using key") == 0 || strcmp(input, "unlock bronze box with key") == 0 || strcmp(input, "use key to unlock bronze box") == 0) { printf("\nThere is no bronze box here."); } if (strcmp(input, "use key on bronze") == 0 || strcmp(input, "use key to open bronze") == 0 || strcmp(input, "open bronze with key") == 0 || strcmp(input, "open bronze using key") == 0 || strcmp(input, "unlock bronze using key") == 0 || strcmp(input, "unlock bronze with key") == 0 || strcmp(input, "use key to unlock bronze") == 0) { printf("\nThere isn't anything bronze in here."); } } if (aluminumkey == 0 && brasskey == 0 && ironkey == 0) { printf("\nWhat key?"); } return; } // UNLOCK BRONZE BOX WITH ALUMINUM KEY if (strcmp(input, "use aluminum key on bronze box") == 0 || strcmp(input, "use aluminum key on bronze") == 0 || strcmp(input, "use aluminum on bronze box") == 0 || strcmp(input, "use aluminum on bronze") == 0 || strcmp(input, "use aluminum key to open bronze box") == 0 || strcmp(input, "use aluminum key to open bronze") == 0 || strcmp(input, "use aluminum to open bronze box") == 0 || strcmp(input, "use aluminum to open bronze") == 0 || strcmp(input, "use aluminum key to unlock bronze") == 0 || strcmp(input, "use aluminum key to unlock bronze box") == 0 || strcmp(input, "use aluminum to unlock bronze") == 0 || strcmp(input, "use aluminum to unlock bronze box") == 0 || strcmp(input, "open bronze box with aluminum key") == 0 || strcmp(input, "open bronze with aluminum key") == 0 || strcmp(input, "open bronze box with aluminum") == 0 || strcmp(input, "open bronze with aluminum") == 0 || strcmp(input, "open bronze box using aluminum key") == 0 || strcmp(input, "open bronze using aluminum key") == 0 || strcmp(input, "open bronze box using aluminum") == 0 || strcmp(input, "open bronze using aluminum") == 0 || strcmp(input, "unlock bronze box using aluminum key") == 0 || strcmp(input, "unlock bronze using aluminum key") == 0 || strcmp(input, "unlock bronze box using aluminum") == 0 || strcmp(input, "unlock bronze using aluminum") == 0 || strcmp(input, "unlock bronze box with aluminum key") == 0 || strcmp(input, "unlock bronze with aluminum key") == 0 || strcmp(input, "unlock bronze box with aluminum") == 0 || strcmp(input, "unlock bronze with aluminum") == 0) { if (roomid == 2 && aluminumkey != 0) { printf("\nThere is no keyhole on the bronze box."); } if (roomid != 2) { if (strcmp(input, "use aluminum key on bronze box") == 0 || strcmp(input, "use aluminum on bronze box") == 0 || strcmp(input, "use aluminum key to open bronze box") == 0 || strcmp(input, "use aluminum to open bronze box") == 0 || strcmp(input, "use aluminum key to unlock bronze box") == 0 || strcmp(input, "use aluminum to unlock bronze box") == 0 || strcmp(input, "open bronze box with aluminum key") == 0 || strcmp(input, "open bronze box with aluminum") == 0 || strcmp(input, "open bronze box using aluminum key") == 0 || strcmp(input, "open bronze box using aluminum") == 0 || strcmp(input, "unlock bronze box using aluminum key") == 0 || strcmp(input, "unlock bronze box using aluminum") == 0 || strcmp(input, "unlock bronze box with aluminum key") == 0 || strcmp(input, "unlock bronze box with aluminum") == 0) { printf("\nThere is no bronze box here."); } if (strcmp(input, "use aluminum key on bronze") == 0 || strcmp(input, "use aluminum on bronze") == 0 || strcmp(input, "use aluminum key to open bronze") == 0 || strcmp(input, "use aluminum to open bronze") == 0 || strcmp(input, "use aluminum key to unlock bronze") == 0 || strcmp(input, "use aluminum to unlock bronze") == 0 || strcmp(input, "open bronze with aluminum key") == 0 || strcmp(input, "open bronze with aluminum") == 0 || strcmp(input, "open bronze using aluminum key") == 0 || strcmp(input, "open bronze using aluminum") == 0 || strcmp(input, "unlock bronze using aluminum key") == 0 || strcmp(input, "unlock bronze using aluminum") == 0 || strcmp(input, "unlock bronze with aluminum key") == 0 || strcmp(input, "unlock bronze with aluminum") == 0) { printf("\nThere isn't anything bronze in here."); } } if (aluminumkey == 0) { if (strcmp(input, "use aluminum key on bronze box") == 0 || strcmp(input, "use aluminum key on bronze") == 0 || strcmp(input, "use aluminum key to open bronze box") == 0 || strcmp(input, "use aluminum key to open bronze") == 0 || strcmp(input, "use aluminum key to unlock bronze") == 0 || strcmp(input, "use aluminum key to unlock bronze box") == 0 || strcmp(input, "open bronze box with aluminum key") == 0 || strcmp(input, "open bronze with aluminum key") == 0 || strcmp(input, "open bronze box using aluminum key") == 0 || strcmp(input, "open bronze using aluminum key") == 0 || strcmp(input, "unlock bronze box using aluminum key") == 0 || strcmp(input, "unlock bronze using aluminum key") == 0 || strcmp(input, "unlock bronze box with aluminum key") == 0 || strcmp(input, "unlock bronze with aluminum key") == 0) { printf("\nWhat aluminum key?"); } if (strcmp(input, "use aluminum on bronze box") == 0 || strcmp(input, "use aluminum on bronze") == 0 || strcmp(input, "use aluminum to open bronze box") == 0 || strcmp(input, "use aluminum to open bronze") == 0 || strcmp(input, "use aluminum to unlock bronze") == 0 || strcmp(input, "use aluminum to unlock bronze box") == 0 || strcmp(input, "open bronze box with aluminum") == 0 || strcmp(input, "open bronze with aluminum") == 0 || strcmp(input, "open bronze box using aluminum") == 0 || strcmp(input, "open bronze using aluminum") == 0 || strcmp(input, "unlock bronze box using aluminum") == 0 || strcmp(input, "unlock bronze using aluminum") == 0 || strcmp(input, "unlock bronze box with aluminum") == 0 || strcmp(input, "unlock bronze with aluminum") == 0 || strcmp(input, "unlock bronze box with aluminum") == 0) { printf("\nWhat aluminum?"); } } return; } // UNLOCK BRONZE BOX WITH BRASS KEY if (strcmp(input, "use brass key on bronze box") == 0 || strcmp(input, "use brass key on bronze") == 0 || strcmp(input, "use brass on bronze box") == 0 || strcmp(input, "use brass on bronze") == 0 || strcmp(input, "use brass key to open bronze box") == 0 || strcmp(input, "use brass key to open bronze") == 0 || strcmp(input, "use brass to open bronze box") == 0 || strcmp(input, "use brass to open bronze") == 0 || strcmp(input, "use brass key to unlock bronze") == 0 || strcmp(input, "use brass key to unlock bronze box") == 0 || strcmp(input, "use brass to unlock bronze") == 0 || strcmp(input, "use brass to unlock bronze box") == 0 || strcmp(input, "open bronze box with brass key") == 0 || strcmp(input, "open bronze with brass key") == 0 || strcmp(input, "open bronze box with brass") == 0 || strcmp(input, "open bronze with brass") == 0 || strcmp(input, "open bronze box using brass key") == 0 || strcmp(input, "open bronze using brass key") == 0 || strcmp(input, "open bronze box using brass") == 0 || strcmp(input, "open bronze using brass") == 0 || strcmp(input, "unlock bronze box using brass key") == 0 || strcmp(input, "unlock bronze using brass key") == 0 || strcmp(input, "unlock bronze box using brass") == 0 || strcmp(input, "unlock bronze using brass") == 0 || strcmp(input, "unlock bronze box with brass key") == 0 || strcmp(input, "unlock bronze with brass key") == 0 || strcmp(input, "unlock bronze box with brass") == 0 || strcmp(input, "unlock bronze with brass") == 0) { if (roomid == 2 && brasskey != 0) { printf("\nThere is no keyhole on the bronze box."); } if (roomid != 2) { if (strcmp(input, "use brass key on bronze box") == 0 || strcmp(input, "use brass on bronze box") == 0 || strcmp(input, "use brass key to open bronze box") == 0 || strcmp(input, "use brass to open bronze box") == 0 || strcmp(input, "use brass key to unlock bronze box") == 0 || strcmp(input, "use brass to unlock bronze box") == 0 || strcmp(input, "open bronze box with brass key") == 0 || strcmp(input, "open bronze box with brass") == 0 || strcmp(input, "open bronze box using brass key") == 0 || strcmp(input, "open bronze box using brass") == 0 || strcmp(input, "unlock bronze box using brass key") == 0 || strcmp(input, "unlock bronze box using brass") == 0 || strcmp(input, "unlock bronze box with brass key") == 0 || strcmp(input, "unlock bronze box with brass") == 0) { printf("\nThere is no bronze box here."); } if (strcmp(input, "use brass key on bronze") == 0 || strcmp(input, "use brass on bronze") == 0 || strcmp(input, "use brass key to open bronze") == 0 || strcmp(input, "use brass to open bronze") == 0 || strcmp(input, "use brass key to unlock bronze") == 0 || strcmp(input, "use brass to unlock bronze") == 0 || strcmp(input, "open bronze with brass key") == 0 || strcmp(input, "open bronze with brass") == 0 || strcmp(input, "open bronze using brass key") == 0 || strcmp(input, "open bronze using brass") == 0 || strcmp(input, "unlock bronze using brass key") == 0 || strcmp(input, "unlock bronze using brass") == 0 || strcmp(input, "unlock bronze with brass key") == 0 || strcmp(input, "unlock bronze with brass") == 0) { printf("\nThere isn't anything bronze in here."); } } if (brasskey == 0) { if (strcmp(input, "use brass key on bronze box") == 0 || strcmp(input, "use brass key on bronze") == 0 || strcmp(input, "use brass key to open bronze box") == 0 || strcmp(input, "use brass key to open bronze") == 0 || strcmp(input, "use brass key to unlock bronze") == 0 || strcmp(input, "use brass key to unlock bronze box") == 0 || strcmp(input, "open bronze box with brass key") == 0 || strcmp(input, "open bronze with brass key") == 0 || strcmp(input, "open bronze box using brass key") == 0 || strcmp(input, "open bronze using brass key") == 0 || strcmp(input, "unlock bronze box using brass key") == 0 || strcmp(input, "unlock bronze using brass key") == 0 || strcmp(input, "unlock bronze box with brass key") == 0 || strcmp(input, "unlock bronze with brass key") == 0) { printf("\nWhat brass key?"); } if (strcmp(input, "use brass on bronze box") == 0 || strcmp(input, "use brass on bronze") == 0 || strcmp(input, "use brass to open bronze box") == 0 || strcmp(input, "use brass to open bronze") == 0 || strcmp(input, "use brass to unlock bronze") == 0 || strcmp(input, "use brass to unlock bronze box") == 0 || strcmp(input, "open bronze box with brass") == 0 || strcmp(input, "open bronze with brass") == 0 || strcmp(input, "open bronze box using brass") == 0 || strcmp(input, "open bronze using brass") == 0 || strcmp(input, "unlock bronze box using brass") == 0 || strcmp(input, "unlock bronze using brass") == 0 || strcmp(input, "unlock bronze box with brass") == 0 || strcmp(input, "unlock bronze with brass") == 0 || strcmp(input, "unlock bronze box with brass") == 0) { printf("\nWhat brass?"); } } return; } // UNLOCK BRONZE BOX WITH IRON KEY if (strcmp(input, "use iron key on bronze box") == 0 || strcmp(input, "use iron key on bronze") == 0 || strcmp(input, "use iron on bronze box") == 0 || strcmp(input, "use iron on bronze") == 0 || strcmp(input, "use iron key to open bronze box") == 0 || strcmp(input, "use iron key to open bronze") == 0 || strcmp(input, "use iron to open bronze box") == 0 || strcmp(input, "use iron to open bronze") == 0 || strcmp(input, "use iron key to unlock bronze") == 0 || strcmp(input, "use iron key to unlock bronze box") == 0 || strcmp(input, "use iron to unlock bronze") == 0 || strcmp(input, "use iron to unlock bronze box") == 0 || strcmp(input, "open bronze box with iron key") == 0 || strcmp(input, "open bronze with iron key") == 0 || strcmp(input, "open bronze box with iron") == 0 || strcmp(input, "open bronze with iron") == 0 || strcmp(input, "open bronze box using iron key") == 0 || strcmp(input, "open bronze using iron key") == 0 || strcmp(input, "open bronze box using iron") == 0 || strcmp(input, "open bronze using iron") == 0 || strcmp(input, "unlock bronze box using iron key") == 0 || strcmp(input, "unlock bronze using iron key") == 0 || strcmp(input, "unlock bronze box using iron") == 0 || strcmp(input, "unlock bronze using iron") == 0 || strcmp(input, "unlock bronze box with iron key") == 0 || strcmp(input, "unlock bronze with iron key") == 0 || strcmp(input, "unlock bronze box with iron") == 0 || strcmp(input, "unlock bronze with iron") == 0) { if (roomid == 2 && ironkey != 0) { printf("\nThere is no keyhole on the bronze box."); } if (roomid != 2) { if (strcmp(input, "use iron key on bronze box") == 0 || strcmp(input, "use iron on bronze box") == 0 || strcmp(input, "use iron key to open bronze box") == 0 || strcmp(input, "use iron to open bronze box") == 0 || strcmp(input, "use iron key to unlock bronze box") == 0 || strcmp(input, "use iron to unlock bronze box") == 0 || strcmp(input, "open bronze box with iron key") == 0 || strcmp(input, "open bronze box with iron") == 0 || strcmp(input, "open bronze box using iron key") == 0 || strcmp(input, "open bronze box using iron") == 0 || strcmp(input, "unlock bronze box using iron key") == 0 || strcmp(input, "unlock bronze box using iron") == 0 || strcmp(input, "unlock bronze box with iron key") == 0 || strcmp(input, "unlock bronze box with iron") == 0) { printf("\nThere is no bronze box here."); } if (strcmp(input, "use iron key on bronze") == 0 || strcmp(input, "use iron on bronze") == 0 || strcmp(input, "use iron key to open bronze") == 0 || strcmp(input, "use iron to open bronze") == 0 || strcmp(input, "use iron key to unlock bronze") == 0 || strcmp(input, "use iron to unlock bronze") == 0 || strcmp(input, "open bronze with iron key") == 0 || strcmp(input, "open bronze with iron") == 0 || strcmp(input, "open bronze using iron key") == 0 || strcmp(input, "open bronze using iron") == 0 || strcmp(input, "unlock bronze using iron key") == 0 || strcmp(input, "unlock bronze using iron") == 0 || strcmp(input, "unlock bronze with iron key") == 0 || strcmp(input, "unlock bronze with iron") == 0) { printf("\nThere isn't anything bronze in here."); } } if (ironkey == 0) { if (strcmp(input, "use iron key on bronze box") == 0 || strcmp(input, "use iron key on bronze") == 0 || strcmp(input, "use iron key to open bronze box") == 0 || strcmp(input, "use iron key to open bronze") == 0 || strcmp(input, "use iron key to unlock bronze") == 0 || strcmp(input, "use iron key to unlock bronze box") == 0 || strcmp(input, "open bronze box with iron key") == 0 || strcmp(input, "open bronze with iron key") == 0 || strcmp(input, "open bronze box using iron key") == 0 || strcmp(input, "open bronze using iron key") == 0 || strcmp(input, "unlock bronze box using iron key") == 0 || strcmp(input, "unlock bronze using iron key") == 0 || strcmp(input, "unlock bronze box with iron key") == 0 || strcmp(input, "unlock bronze with iron key") == 0) { printf("\nWhat iron key?"); } if (strcmp(input, "use iron on bronze box") == 0 || strcmp(input, "use iron on bronze") == 0 || strcmp(input, "use iron to open bronze box") == 0 || strcmp(input, "use iron to open bronze") == 0 || strcmp(input, "use iron to unlock bronze") == 0 || strcmp(input, "use iron to unlock bronze box") == 0 || strcmp(input, "open bronze box with iron") == 0 || strcmp(input, "open bronze with iron") == 0 || strcmp(input, "open bronze box using iron") == 0 || strcmp(input, "open bronze using iron") == 0 || strcmp(input, "unlock bronze box using iron") == 0 || strcmp(input, "unlock bronze using iron") == 0 || strcmp(input, "unlock bronze box with iron") == 0 || strcmp(input, "unlock bronze with iron") == 0 || strcmp(input, "unlock bronze box with iron") == 0) { printf("\nWhat iron?"); } } return; } // OPEN BRONZE BOX if (strcmp(input, "open bronze box") == 0 || strcmp(input, "open bronze") == 0) { if (roomid == 2) { if (bronzebox == 2) { printf("\nThe bronze box is already open."); } if (bronzebox == 1) { printf("\nYou open the bronze box."); bronzebox = 2; northdoor = 0; southdoor = 0; westdoor = 1; if (aluminumkey == 0) { printf("\nThere is an aluminum key inside the bronze box."); } if (aluminumkey != 0) { printf("\nThe bronze box is empty."); } } if (bronzebox == 0) { printf("\nThe bronze box is securely locked. You can't open it."); } } if (roomid != 2) { if (strcmp(input, "open bronze box") == 0) { printf("\nThere isn't any bronze box here."); } if (strcmp(input, "open bronze") == 0) { printf("\nThere isn't anything bronze in here."); } } return; } // CLOSE BLACK BOX if (strcmp(input, "close bronze") == 0 || strcmp(input, "close bronze box") == 0) { if (roomid == 2) { if (bronzebox != 2) { printf("\nThe bronze box is already closed."); } if (bronzebox == 2) { printf("\nYou close the bronze box."); bronzebox = 1; northdoor = 0; southdoor = 0; westdoor = 0; } } if (roomid != 2) { if (strcmp(input, "close bronze box") == 0) { printf("\nThere isn't any bronze box here."); } if (strcmp(input, "close bronze") == 0) { printf("\nThere isn't anything bronze in here."); } } return; } // TAKE BRONZE BOX if (strcmp(input, "take bronze box") == 0 || strcmp(input, "take bronze") == 0) { if (roomid == 2) { printf("\nThe bronze box seems to be an integral part of the floor, you can't take it."); } if (roomid != 2) { if (strcmp(input, "take bronze box") == 0) { printf("\nThere isn't any bronze box here."); } if (strcmp(input, "take bronze") == 0) { printf("\nThere isn't anything bronze in here."); } } return; } // LOOK STEEL BOX if (strcmp(input, "look steel box") == 0 || strcmp(input, "look steel") == 0) { if (roomid == 5) { printf("\nIt's a box made out of steel."); printf("\nThere is a keyhole on a side of the steel box."); if (steelbox == 0) { printf("\nThe steel box is currently closed."); } if (steelbox != 0) { printf("\nThe steel box is currently open."); if (batteries == 0) { printf("\nThere are batteries inside the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } } if (roomid != 5) { if (strcmp(input, "look steel box") == 0) { printf("\nThere isn't any steel box here."); } if (strcmp(input, "look steel") == 0) { printf("\nThere isn't anything steel in here."); } } return; } // UNLOCK STEEL BOX if (strcmp(input, "unlock steel box") == 0 || strcmp(input, "unlock steel") == 0) { if (roomid == 5) { if (aluminumkey != 0 || brasskey != 0 || ironkey != 0) { printf("\nPlease specify which key to use to unlock the steel box."); } if (aluminumkey == 0 && brasskey == 0 && ironkey == 0) { printf("\nYou don't have any key."); } } if (roomid != 5) { if (strcmp(input, "unlock steel box") == 0) { printf("\nThere isn't any steel box here."); } if (strcmp(input, "unlock steel") == 0) { printf("\nThere isn't anything steel in here."); } } return; } // UNLOCK STEEL BOX WITH KEY / OPEN STEEL BOX WITH KEY if (strcmp(input, "use key on steel box") == 0 || strcmp(input, "use key on steel") == 0 || strcmp(input, "use key to open steel box") == 0 || strcmp(input, "use key to open steel") == 0 || strcmp(input, "use key to unlock steel box") == 0 || strcmp(input, "use key to unlock steel") == 0 || strcmp(input, "open steel box with key") == 0 || strcmp(input, "open steel box using key") == 0 || strcmp(input, "open steel with key") == 0 || strcmp(input, "open steel using key") == 0 || strcmp(input, "unlock steel box using key") == 0 || strcmp(input, "unlock steel box with key") == 0 || strcmp(input, "unlock steel using key") == 0 || strcmp(input, "unlock steel with key") == 0) { if (roomid == 5) { if (aluminumkey != 0 || brasskey != 0 || ironkey != 0) { printf("\nPlease specify which key to use to unlock the steel box."); } } if (roomid != 5) { if (strcmp(input, "use key on steel box") == 0 || strcmp(input, "use key to open steel box") == 0 || strcmp(input, "open steel box with key") == 0 || strcmp(input, "open steel box using key") == 0 || strcmp(input, "unlock steel box using key") == 0 || strcmp(input, "unlock steel box with key") == 0 || strcmp(input, "use key to unlock steel box") == 0) { printf("\nThere is no steel box here."); } if (strcmp(input, "use key on steel") == 0 || strcmp(input, "use key to open steel") == 0 || strcmp(input, "open steel with key") == 0 || strcmp(input, "open steel using key") == 0 || strcmp(input, "unlock steel using key") == 0 || strcmp(input, "unlock steel with key") == 0 || strcmp(input, "use key to unlock steel") == 0) { printf("\nThere isn't anything steel in here."); } } if (aluminumkey == 0 && brasskey == 0 && ironkey == 0) { printf("\nWhat key?"); } return; } // UNLOCK STEEL BOX WITH ALUMINUM KEY / OPEN STEEL BOX WITH ALUMINUM KEY if (strcmp(input, "use aluminum key on steel box") == 0 || strcmp(input, "use aluminum key on steel") == 0 || strcmp(input, "use aluminum on steel box") == 0 || strcmp(input, "use aluminum on steel") == 0 || strcmp(input, "use aluminum key to open steel box") == 0 || strcmp(input, "use aluminum key to open steel") == 0 || strcmp(input, "use aluminum to open steel box") == 0 || strcmp(input, "use aluminum to open steel") == 0 || strcmp(input, "use aluminum key to unlock steel") == 0 || strcmp(input, "use aluminum key to unlock steel box") == 0 || strcmp(input, "use aluminum to unlock steel") == 0 || strcmp(input, "use aluminum to unlock steel box") == 0 || strcmp(input, "open steel box with aluminum key") == 0 || strcmp(input, "open steel with aluminum key") == 0 || strcmp(input, "open steel box with aluminum") == 0 || strcmp(input, "open steel with aluminum") == 0 || strcmp(input, "open steel box using aluminum key") == 0 || strcmp(input, "open steel using aluminum key") == 0 || strcmp(input, "open steel box using aluminum") == 0 || strcmp(input, "open steel using aluminum") == 0 || strcmp(input, "unlock steel box using aluminum key") == 0 || strcmp(input, "unlock steel using aluminum key") == 0 || strcmp(input, "unlock steel box using aluminum") == 0 || strcmp(input, "unlock steel using aluminum") == 0 || strcmp(input, "unlock steel box with aluminum key") == 0 || strcmp(input, "unlock steel with aluminum key") == 0 || strcmp(input, "unlock steel box with aluminum") == 0 || strcmp(input, "unlock steel with aluminum") == 0) { if (roomid == 5 && aluminumkey != 0) { if (steelbox != 0){ printf("\nThe steel box is already open."); } if (steelbox == 0){ printf("\nYou insert the aluminum key into the keyhole on the steel box."); printf("\nThe key fits. After turning the key, the steel box automatically opens."); printf("\nYou take the aluminum key out of the keyhole."); steelbox = 1; } if (batteries == 0) { printf("\nThere are batteries inside the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } if (roomid != 5) { if (strcmp(input, "use aluminum key on steel box") == 0 || strcmp(input, "use aluminum on steel box") == 0 || strcmp(input, "use aluminum key to open steel box") == 0 || strcmp(input, "use aluminum to open steel box") == 0 || strcmp(input, "use aluminum key to unlock steel box") == 0 || strcmp(input, "use aluminum to unlock steel box") == 0 || strcmp(input, "open steel box with aluminum key") == 0 || strcmp(input, "open steel box with aluminum") == 0 || strcmp(input, "open steel box using aluminum key") == 0 || strcmp(input, "open steel box using aluminum") == 0 || strcmp(input, "unlock steel box using aluminum key") == 0 || strcmp(input, "unlock steel box using aluminum") == 0 || strcmp(input, "unlock steel box with aluminum key") == 0 || strcmp(input, "unlock steel box with aluminum") == 0) { printf("\nThere is no steel box here."); } if (strcmp(input, "use aluminum key on steel") == 0 || strcmp(input, "use aluminum on steel") == 0 || strcmp(input, "use aluminum key to open steel") == 0 || strcmp(input, "use aluminum to open steel") == 0 || strcmp(input, "use aluminum key to unlock steel") == 0 || strcmp(input, "use aluminum to unlock steel") == 0 || strcmp(input, "open steel with aluminum key") == 0 || strcmp(input, "open steel with aluminum") == 0 || strcmp(input, "open steel using aluminum key") == 0 || strcmp(input, "open steel using aluminum") == 0 || strcmp(input, "unlock steel using aluminum key") == 0 || strcmp(input, "unlock steel using aluminum") == 0 || strcmp(input, "unlock steel with aluminum key") == 0 || strcmp(input, "unlock steel with aluminum") == 0) { printf("\nThere isn't anything steel in here."); } } if (aluminumkey == 0) { if (strcmp(input, "use aluminum key on steel box") == 0 || strcmp(input, "use aluminum key on steel") == 0 || strcmp(input, "use aluminum key to open steel box") == 0 || strcmp(input, "use aluminum key to open steel") == 0 || strcmp(input, "use aluminum key to unlock steel") == 0 || strcmp(input, "use aluminum key to unlock steel box") == 0 || strcmp(input, "open steel box with aluminum key") == 0 || strcmp(input, "open steel with aluminum key") == 0 || strcmp(input, "open steel box using aluminum key") == 0 || strcmp(input, "open steel using aluminum key") == 0 || strcmp(input, "unlock steel box using aluminum key") == 0 || strcmp(input, "unlock steel using aluminum key") == 0 || strcmp(input, "unlock steel box with aluminum key") == 0 || strcmp(input, "unlock steel with aluminum key") == 0) { printf("\nWhat aluminum key?"); } if (strcmp(input, "use aluminum on steel box") == 0 || strcmp(input, "use aluminum on steel") == 0 || strcmp(input, "use aluminum to open steel box") == 0 || strcmp(input, "use aluminum to open steel") == 0 || strcmp(input, "use aluminum to unlock steel") == 0 || strcmp(input, "use aluminum to unlock steel box") == 0 || strcmp(input, "open steel box with aluminum") == 0 || strcmp(input, "open steel with aluminum") == 0 || strcmp(input, "open steel box using aluminum") == 0 || strcmp(input, "open steel using aluminum") == 0 || strcmp(input, "unlock steel box using aluminum") == 0 || strcmp(input, "unlock steel using aluminum") == 0 || strcmp(input, "unlock steel box with aluminum") == 0 || strcmp(input, "unlock steel with aluminum") == 0) { printf("\nWhat aluminum?"); } } return; } // UNLOCK STEEL BOX WITH BRASS KEY / OPEN STEEL BOX WITH BRASS KEY if (strcmp(input, "use brass key on steel box") == 0 || strcmp(input, "use brass key on steel") == 0 || strcmp(input, "use brass on steel box") == 0 || strcmp(input, "use brass on steel") == 0 || strcmp(input, "use brass key to open steel box") == 0 || strcmp(input, "use brass key to open steel") == 0 || strcmp(input, "use brass to open steel box") == 0 || strcmp(input, "use brass to open steel") == 0 || strcmp(input, "use brass key to unlock steel") == 0 || strcmp(input, "use brass key to unlock steel box") == 0 || strcmp(input, "use brass to unlock steel") == 0 || strcmp(input, "use brass to unlock steel box") == 0 || strcmp(input, "open steel box with brass key") == 0 || strcmp(input, "open steel with brass key") == 0 || strcmp(input, "open steel box with brass") == 0 || strcmp(input, "open steel with brass") == 0 || strcmp(input, "open steel box using brass key") == 0 || strcmp(input, "open steel using brass key") == 0 || strcmp(input, "open steel box using brass") == 0 || strcmp(input, "open steel using brass") == 0 || strcmp(input, "unlock steel box using brass key") == 0 || strcmp(input, "unlock steel using brass key") == 0 || strcmp(input, "unlock steel box using brass") == 0 || strcmp(input, "unlock steel using brass") == 0 || strcmp(input, "unlock steel box with brass key") == 0 || strcmp(input, "unlock steel with brass key") == 0 || strcmp(input, "unlock steel box with brass") == 0 || strcmp(input, "unlock steel with brass") == 0) { if (roomid == 5 && brasskey != 0) { printf("\nYou attempted to use brass key to unlock the steel box, but the brass key doens't fit in the keyhole."); } if (roomid != 5) { if (strcmp(input, "use brass key on steel box") == 0 || strcmp(input, "use brass on steel box") == 0 || strcmp(input, "use brass key to open steel box") == 0 || strcmp(input, "use brass to open steel box") == 0 || strcmp(input, "use brass key to unlock steel box") == 0 || strcmp(input, "use brass to unlock steel box") == 0 || strcmp(input, "open steel box with brass key") == 0 || strcmp(input, "open steel box with brass") == 0 || strcmp(input, "open steel box using brass key") == 0 || strcmp(input, "open steel box using brass") == 0 || strcmp(input, "unlock steel box using brass key") == 0 || strcmp(input, "unlock steel box using brass") == 0 || strcmp(input, "unlock steel box with brass key") == 0 || strcmp(input, "unlock steel box with brass") == 0) { printf("\nThere is no steel box here."); } if (strcmp(input, "use brass key on steel") == 0 || strcmp(input, "use brass on steel") == 0 || strcmp(input, "use brass key to open steel") == 0 || strcmp(input, "use brass to open steel") == 0 || strcmp(input, "use brass key to unlock steel") == 0 || strcmp(input, "use brass to unlock steel") == 0 || strcmp(input, "open steel with brass key") == 0 || strcmp(input, "open steel with brass") == 0 || strcmp(input, "open steel using brass key") == 0 || strcmp(input, "open steel using brass") == 0 || strcmp(input, "unlock steel using brass key") == 0 || strcmp(input, "unlock steel using brass") == 0 || strcmp(input, "unlock steel with brass key") == 0 || strcmp(input, "unlock steel with brass") == 0) { printf("\nThere isn't anything steel in here."); } } if (brasskey == 0) { if (strcmp(input, "use brass key on steel box") == 0 || strcmp(input, "use brass key on steel") == 0 || strcmp(input, "use brass key to open steel box") == 0 || strcmp(input, "use brass key to open steel") == 0 || strcmp(input, "use brass key to unlock steel") == 0 || strcmp(input, "use brass key to unlock steel box") == 0 || strcmp(input, "open steel box with brass key") == 0 || strcmp(input, "open steel with brass key") == 0 || strcmp(input, "open steel box using brass key") == 0 || strcmp(input, "open steel using brass key") == 0 || strcmp(input, "unlock steel box using brass key") == 0 || strcmp(input, "unlock steel using brass key") == 0 || strcmp(input, "unlock steel box with brass key") == 0 || strcmp(input, "unlock steel with brass key") == 0) { printf("\nWhat brass key?"); } if (strcmp(input, "use brass on steel box") == 0 || strcmp(input, "use brass on steel") == 0 || strcmp(input, "use brass to open steel box") == 0 || strcmp(input, "use brass to open steel") == 0 || strcmp(input, "use brass to unlock steel") == 0 || strcmp(input, "use brass to unlock steel box") == 0 || strcmp(input, "open steel box with brass") == 0 || strcmp(input, "open steel with brass") == 0 || strcmp(input, "open steel box using brass") == 0 || strcmp(input, "open steel using brass") == 0 || strcmp(input, "unlock steel box using brass") == 0 || strcmp(input, "unlock steel using brass") == 0 || strcmp(input, "unlock steel box with brass") == 0 || strcmp(input, "unlock steel with brass") == 0 || strcmp(input, "unlock steel box with brass") == 0) { printf("\nWhat brass?"); } } return; } // UNLOCK STEEL BOX WITH IRON KEY / OPEN STEEL BOX WITH IRON KEY if (strcmp(input, "use iron key on steel box") == 0 || strcmp(input, "use iron key on steel") == 0 || strcmp(input, "use iron on steel box") == 0 || strcmp(input, "use iron on steel") == 0 || strcmp(input, "use iron key to open steel box") == 0 || strcmp(input, "use iron key to open steel") == 0 || strcmp(input, "use iron to open steel box") == 0 || strcmp(input, "use iron to open steel") == 0 || strcmp(input, "use iron key to unlock steel") == 0 || strcmp(input, "use iron key to unlock steel box") == 0 || strcmp(input, "use iron to unlock steel") == 0 || strcmp(input, "use iron to unlock steel box") == 0 || strcmp(input, "open steel box with iron key") == 0 || strcmp(input, "open steel with iron key") == 0 || strcmp(input, "open steel box with iron") == 0 || strcmp(input, "open steel with iron") == 0 || strcmp(input, "open steel box using iron key") == 0 || strcmp(input, "open steel using iron key") == 0 || strcmp(input, "open steel box using iron") == 0 || strcmp(input, "open steel using iron") == 0 || strcmp(input, "unlock steel box using iron key") == 0 || strcmp(input, "unlock steel using iron key") == 0 || strcmp(input, "unlock steel box using iron") == 0 || strcmp(input, "unlock steel using iron") == 0 || strcmp(input, "unlock steel box with iron key") == 0 || strcmp(input, "unlock steel with iron key") == 0 || strcmp(input, "unlock steel box with iron") == 0 || strcmp(input, "unlock steel with iron") == 0) { if (roomid == 5 && ironkey != 0) { printf("\nYou attempted to use iron key to open the steel box, but the iron key doens't fit in the keyhole."); } if (roomid != 5) { if (strcmp(input, "use iron key on steel box") == 0 || strcmp(input, "use iron on steel box") == 0 || strcmp(input, "use iron key to open steel box") == 0 || strcmp(input, "use iron to open steel box") == 0 || strcmp(input, "use iron key to unlock steel box") == 0 || strcmp(input, "use iron to unlock steel box") == 0 || strcmp(input, "open steel box with iron key") == 0 || strcmp(input, "open steel box with iron") == 0 || strcmp(input, "open steel box using iron key") == 0 || strcmp(input, "open steel box using iron") == 0 || strcmp(input, "unlock steel box using iron key") == 0 || strcmp(input, "unlock steel box using iron") == 0 || strcmp(input, "unlock steel box with iron key") == 0 || strcmp(input, "unlock steel box with iron") == 0) { printf("\nThere is no steel box here."); } if (strcmp(input, "use iron key on steel") == 0 || strcmp(input, "use iron on steel") == 0 || strcmp(input, "use iron key to open steel") == 0 || strcmp(input, "use iron to open steel") == 0 || strcmp(input, "use iron key to unlock steel") == 0 || strcmp(input, "use iron to unlock steel") == 0 || strcmp(input, "open steel with iron key") == 0 || strcmp(input, "open steel with iron") == 0 || strcmp(input, "open steel using iron key") == 0 || strcmp(input, "open steel using iron") == 0 || strcmp(input, "unlock steel using iron key") == 0 || strcmp(input, "unlock steel using iron") == 0 || strcmp(input, "unlock steel with iron key") == 0 || strcmp(input, "unlock steel with iron") == 0) { printf("\nThere isn't anything steel in here."); } } if (ironkey == 0) { if (strcmp(input, "use iron key on steel box") == 0 || strcmp(input, "use iron key on steel") == 0 || strcmp(input, "use iron key to open steel box") == 0 || strcmp(input, "use iron key to open steel") == 0 || strcmp(input, "use iron key to unlock steel") == 0 || strcmp(input, "use iron key to unlock steel box") == 0 || strcmp(input, "open steel box with iron key") == 0 || strcmp(input, "open steel with iron key") == 0 || strcmp(input, "open steel box using iron key") == 0 || strcmp(input, "open steel using iron key") == 0 || strcmp(input, "unlock steel box using iron key") == 0 || strcmp(input, "unlock steel using iron key") == 0 || strcmp(input, "unlock steel box with iron key") == 0 || strcmp(input, "unlock steel with iron key") == 0) { printf("\nWhat iron key?"); } if (strcmp(input, "use iron on steel box") == 0 || strcmp(input, "use iron on steel") == 0 || strcmp(input, "use iron to open steel box") == 0 || strcmp(input, "use iron to open steel") == 0 || strcmp(input, "use iron to unlock steel") == 0 || strcmp(input, "use iron to unlock steel box") == 0 || strcmp(input, "open steel box with iron") == 0 || strcmp(input, "open steel with iron") == 0 || strcmp(input, "open steel box using iron") == 0 || strcmp(input, "open steel using iron") == 0 || strcmp(input, "unlock steel box using iron") == 0 || strcmp(input, "unlock steel using iron") == 0 || strcmp(input, "unlock steel box with iron") == 0 || strcmp(input, "unlock steel with iron") == 0 || strcmp(input, "unlock steel box with iron") == 0) { printf("\nWhat iron?"); } } return; } // OPEN STEEL BOX if (strcmp(input, "open steel box") == 0 || strcmp(input, "open steel") == 0) { if (roomid == 5) { if (steelbox == 0) { printf("\nYou can't open the steel box."); printf("\nYou will need to unlock the steel box with a key."); } if (steelbox != 0) { printf("\nThe steel box is already open."); if (batteries == 0) { printf("\nThere are batteries inside the steel box."); } if (batteries != 0) { printf("\nThe steel box is empty."); } } } if (roomid != 5) { if (strcmp(input, "open steel box") == 0) { printf("\nThere isn't any steel box here."); } if (strcmp(input, "open steel") == 0) { printf("\nThere isn't anything steel in here."); } } return; } // CLOSE STEEL BOX if (strcmp(input, "close steel box") == 0 || strcmp(input, "close steel") == 0) { if (roomid == 5) { if (steelbox == 0) { printf("\nThe steel box is already closed."); } if (steelbox != 0) { printf("\nYou close the steel box."); steelbox = 0; } } if (roomid != 5) { if (strcmp(input, "close steel box") == 0) { printf("\nThere isn't any steel box here."); } if (strcmp(input, "close steel") == 0) { printf("\nThere isn't anyything steel here."); } } return; } // TAKE STEEL BOX if (strcmp(input, "take steel box") == 0 || strcmp(input, "take steel") == 0) { if (roomid == 5) { printf("\nThe steel box is too heavy to lift, you can't take it."); } if (roomid != 5) { if (strcmp(input, "take steel box") == 0) { printf("\nThere isn't any steel box here."); } if (strcmp(input, "take steel") == 0) { printf("\nThere isn't anyything steel here."); } } return; } // LOOK TITANIUM BOX if (strcmp(input, "look titanium box") == 0 || strcmp(input, "look titanium") == 0) { if (roomid == 3) { printf("\nIt's a box made out of titanium."); printf("\nThere is a keyhole on a side of the titanium box."); if (titaniumbox == 0) { printf("\nThe titanium box is currently closed."); } if (titaniumbox != 0) { printf("\nThe titanium box is currently open."); if (ironkey == 0) { printf("\nThere is a iron key inside the titanium box."); } if (ironkey != 0) { printf("\nThe titanium box is empty."); } } } if (roomid != 3) { if (strcmp(input, "look titanium box") == 0) { printf("\nThere isn't any titanium box here."); } if (strcmp(input, "look titanium") == 0) { printf("\nThere isn't anything titanium in here."); } } return; } // UNLOCK TITANIUM BOX / UNLOCK TITANIUM BOX WITH KEY if (strcmp(input, "unlock titanium box") == 0 || strcmp(input, "unlock titanium") == 0 || strcmp(input, "unlock titanium with key") == 0 || strcmp(input, "unlock titanium using key") == 0 || strcmp(input, "unlock titanium box with key") == 0 || strcmp(input, "unlock titanium box using key") == 0 || strcmp(input, "use key to unlock titanium box") == 0 || strcmp(input, "use key on titanium box") == 0 || strcmp(input, "use key to unlock titanium") == 0 || strcmp(input, "use key on titanium") == 0) { if (roomid == 3 && (aluminumkey != 0 || brasskey != 0 || ironkey != 0)) { printf("\nPlease specify which key to use to unlock the titanium box."); } if (roomid != 3) { if (strcmp(input, "unlock titanium box") == 0 || strcmp(input, "unlock titanium box with key") == 0 || strcmp(input, "unlock titanium box using key") == 0 || strcmp(input, "use key to unlock titanium box") == 0 || strcmp(input, "use key on titanium box") == 0) { printf("\nThere isn't any titanium box here."); } if (strcmp(input, "unlock titanium") == 0 || strcmp(input, "unlock titanium with key") == 0 || strcmp(input, "unlock titanium using key") == 0 || strcmp(input, "use key to unlock titanium") == 0 || strcmp(input, "use key on titanium") == 0) { printf("\nThere isn't anything titanium in here."); } if (aluminumkey == 0 && brasskey == 0 && ironkey == 0) { printf("\nYou don't have any key."); } } return; } // UNLOCK TITANIUM BOX WITH ALUMINUM KEY / OPEN TITANIUM BOX WITH ALUMINUM KEY if (strcmp(input, "use aluminum key on titanium box") == 0 || strcmp(input, "use aluminum key on titanium") == 0 || strcmp(input, "use aluminum on titanium box") == 0 || strcmp(input, "use aluminum on titanium") == 0 || strcmp(input, "use aluminum key to open titanium box") == 0 || strcmp(input, "use aluminum key to open titanium") == 0 || strcmp(input, "use aluminum to open titanium box") == 0 || strcmp(input, "use aluminum to open titanium") == 0 || strcmp(input, "use aluminum key to unlock titanium") == 0 || strcmp(input, "use aluminum key to unlock titanium box") == 0 || strcmp(input, "use aluminum to unlock titanium") == 0 || strcmp(input, "use aluminum to unlock titanium box") == 0 || strcmp(input, "open titanium box with aluminum key") == 0 || strcmp(input, "open titanium with aluminum key") == 0 || strcmp(input, "open titanium box with aluminum") == 0 || strcmp(input, "open titanium with aluminum") == 0 || strcmp(input, "open titanium box using aluminum key") == 0 || strcmp(input, "open titanium using aluminum key") == 0 || strcmp(input, "open titanium box using aluminum") == 0 || strcmp(input, "open titanium using aluminum") == 0 || strcmp(input, "unlock titanium box using aluminum key") == 0 || strcmp(input, "unlock titanium using aluminum key") == 0 || strcmp(input, "unlock titanium box using aluminum") == 0 || strcmp(input, "unlock titanium using aluminum") == 0 || strcmp(input, "unlock titanium box with aluminum key") == 0 || strcmp(input, "unlock titanium with aluminum key") == 0 || strcmp(input, "unlock titanium box with aluminum") == 0 || strcmp(input, "unlock titanium with aluminum") == 0) { if (roomid == 3 && aluminumkey != 0) { printf("\nYou attempted to use aluminum key to unlock the titanium box, but the aluminum key doens't fit in the keyhole."); } if (roomid != 3) { if (strcmp(input, "use aluminum key on titanium box") == 0 || strcmp(input, "use aluminum on titanium box") == 0 || strcmp(input, "use aluminum key to open titanium box") == 0 || strcmp(input, "use aluminum to open titanium box") == 0 || strcmp(input, "use aluminum key to unlock titanium box") == 0 || strcmp(input, "use aluminum to unlock titanium box") == 0 || strcmp(input, "open titanium box with aluminum key") == 0 || strcmp(input, "open titanium box with aluminum") == 0 || strcmp(input, "open titanium box using aluminum key") == 0 || strcmp(input, "open titanium box using aluminum") == 0 || strcmp(input, "unlock titanium box using aluminum key") == 0 || strcmp(input, "unlock titanium box using aluminum") == 0 || strcmp(input, "unlock titanium box with aluminum key") == 0 || strcmp(input, "unlock titanium box with aluminum") == 0) { printf("\nThere is no titanium box here."); } if (strcmp(input, "use aluminum key on titanium") == 0 || strcmp(input, "use aluminum on titanium") == 0 || strcmp(input, "use aluminum key to open titanium") == 0 || strcmp(input, "use aluminum to open titanium") == 0 || strcmp(input, "use aluminum key to unlock titanium") == 0 || strcmp(input, "use aluminum to unlock titanium") == 0 || strcmp(input, "open titanium with aluminum key") == 0 || strcmp(input, "open titanium with aluminum") == 0 || strcmp(input, "open titanium using aluminum key") == 0 || strcmp(input, "open titanium using aluminum") == 0 || strcmp(input, "unlock titanium using aluminum key") == 0 || strcmp(input, "unlock titanium using aluminum") == 0 || strcmp(input, "unlock titanium with aluminum key") == 0 || strcmp(input, "unlock titanium with aluminum") == 0) { printf("\nThere isn't anything titanium in here."); } } if (aluminumkey == 0) { if (strcmp(input, "use aluminum key on titanium box") == 0 || strcmp(input, "use aluminum key on titanium") == 0 || strcmp(input, "use aluminum key to open titanium box") == 0 || strcmp(input, "use aluminum key to open titanium") == 0 || strcmp(input, "use aluminum key to unlock titanium") == 0 || strcmp(input, "use aluminum key to unlock titanium box") == 0 || strcmp(input, "open titanium box with aluminum key") == 0 || strcmp(input, "open titanium with aluminum key") == 0 || strcmp(input, "open titanium box using aluminum key") == 0 || strcmp(input, "open titanium using aluminum key") == 0 || strcmp(input, "unlock titanium box using aluminum key") == 0 || strcmp(input, "unlock titanium using aluminum key") == 0 || strcmp(input, "unlock titanium box with aluminum key") == 0 || strcmp(input, "unlock titanium with aluminum key") == 0) { printf("\nWhat aluminum key?"); } if (strcmp(input, "use aluminum on titanium box") == 0 || strcmp(input, "use aluminum on titanium") == 0 || strcmp(input, "use aluminum to open titanium box") == 0 || strcmp(input, "use aluminum to open titanium") == 0 || strcmp(input, "use aluminum to unlock titanium") == 0 || strcmp(input, "use aluminum to unlock titanium box") == 0 || strcmp(input, "open titanium box with aluminum") == 0 || strcmp(input, "open titanium with aluminum") == 0 || strcmp(input, "open titanium box using aluminum") == 0 || strcmp(input, "open titanium using aluminum") == 0 || strcmp(input, "unlock titanium box using aluminum") == 0 || strcmp(input, "unlock titanium using aluminum") == 0 || strcmp(input, "unlock titanium box with aluminum") == 0 || strcmp(input, "unlock titanium with aluminum") == 0 || strcmp(input, "unlock titanium box with aluminum") == 0) { printf("\nWhat aluminum?"); } } return; } // UNLOCK TITANIUM BOX WITH BRASS KEY / OPEN TITANIUM BOX WITH BRASS KEY if (strcmp(input, "use brass key on titanium box") == 0 || strcmp(input, "use brass key on titanium") == 0 || strcmp(input, "use brass on titanium box") == 0 || strcmp(input, "use brass on titanium") == 0 || strcmp(input, "use brass key to open titanium box") == 0 || strcmp(input, "use brass key to open titanium") == 0 || strcmp(input, "use brass to open titanium box") == 0 || strcmp(input, "use brass to open titanium") == 0 || strcmp(input, "use brass key to unlock titanium") == 0 || strcmp(input, "use brass key to unlock titanium box") == 0 || strcmp(input, "use brass to unlock titanium") == 0 || strcmp(input, "use brass to unlock titanium box") == 0 || strcmp(input, "open titanium box with brass key") == 0 || strcmp(input, "open titanium with brass key") == 0 || strcmp(input, "open titanium box with brass") == 0 || strcmp(input, "open titanium with brass") == 0 || strcmp(input, "open titanium box using brass key") == 0 || strcmp(input, "open titanium using brass key") == 0 || strcmp(input, "open titanium box using brass") == 0 || strcmp(input, "open titanium using brass") == 0 || strcmp(input, "unlock titanium box using brass key") == 0 || strcmp(input, "unlock titanium using brass key") == 0 || strcmp(input, "unlock titanium box using brass") == 0 || strcmp(input, "unlock titanium using brass") == 0 || strcmp(input, "unlock titanium box with brass key") == 0 || strcmp(input, "unlock titanium with brass key") == 0 || strcmp(input, "unlock titanium box with brass") == 0 || strcmp(input, "unlock titanium with brass") == 0) { if (roomid == 3 && brasskey != 0) { if (titaniumbox != 0){ printf("\nThe titanium box is already open."); } if (titaniumbox == 0){ printf("\nYou insert the brass key into the keyhole on the titanium box."); printf("\nThe key fits. After turning the key, the titanium box automatically opens."); printf("\nYou take the brass key out of the keyhole."); titaniumbox = 1; } if (ironkey == 0) { printf("\nThere is an iron key inside the titanium box."); } if (ironkey != 0) { printf("\nThe titanium box is empty."); } } if (roomid != 3) { if (strcmp(input, "use brass key on titanium box") == 0 || strcmp(input, "use brass on titanium box") == 0 || strcmp(input, "use brass key to open titanium box") == 0 || strcmp(input, "use brass to open titanium box") == 0 || strcmp(input, "use brass key to unlock titanium box") == 0 || strcmp(input, "use brass to unlock titanium box") == 0 || strcmp(input, "open titanium box with brass key") == 0 || strcmp(input, "open titanium box with brass") == 0 || strcmp(input, "open titanium box using brass key") == 0 || strcmp(input, "open titanium box using brass") == 0 || strcmp(input, "unlock titanium box using brass key") == 0 || strcmp(input, "unlock titanium box using brass") == 0 || strcmp(input, "unlock titanium box with brass key") == 0 || strcmp(input, "unlock titanium box with brass") == 0) { printf("\nThere is no titanium box here."); } if (strcmp(input, "use brass key on titanium") == 0 || strcmp(input, "use brass on titanium") == 0 || strcmp(input, "use brass key to open titanium") == 0 || strcmp(input, "use brass to open titanium") == 0 || strcmp(input, "use brass key to unlock titanium") == 0 || strcmp(input, "use brass to unlock titanium") == 0 || strcmp(input, "open titanium with brass key") == 0 || strcmp(input, "open titanium with brass") == 0 || strcmp(input, "open titanium using brass key") == 0 || strcmp(input, "open titanium using brass") == 0 || strcmp(input, "unlock titanium using brass key") == 0 || strcmp(input, "unlock titanium using brass") == 0 || strcmp(input, "unlock titanium with brass key") == 0 || strcmp(input, "unlock titanium with brass") == 0) { printf("\nThere isn't anything titanium in here."); } } if (brasskey == 0) { if (strcmp(input, "use brass key on titanium box") == 0 || strcmp(input, "use brass key on titanium") == 0 || strcmp(input, "use brass key to open titanium box") == 0 || strcmp(input, "use brass key to open titanium") == 0 || strcmp(input, "use brass key to unlock titanium") == 0 || strcmp(input, "use brass key to unlock titanium box") == 0 || strcmp(input, "open titanium box with brass key") == 0 || strcmp(input, "open titanium with brass key") == 0 || strcmp(input, "open titanium box using brass key") == 0 || strcmp(input, "open titanium using brass key") == 0 || strcmp(input, "unlock titanium box using brass key") == 0 || strcmp(input, "unlock titanium using brass key") == 0 || strcmp(input, "unlock titanium box with brass key") == 0 || strcmp(input, "unlock titanium with brass key") == 0) { printf("\nWhat brass key?"); } if (strcmp(input, "use brass on titanium box") == 0 || strcmp(input, "use brass on titanium") == 0 || strcmp(input, "use brass to open titanium box") == 0 || strcmp(input, "use brass to open titanium") == 0 || strcmp(input, "use brass to unlock titanium") == 0 || strcmp(input, "use brass to unlock titanium box") == 0 || strcmp(input, "open titanium box with brass") == 0 || strcmp(input, "open titanium with brass") == 0 || strcmp(input, "open titanium box using brass") == 0 || strcmp(input, "open titanium using brass") == 0 || strcmp(input, "unlock titanium box using brass") == 0 || strcmp(input, "unlock titanium using brass") == 0 || strcmp(input, "unlock titanium box with brass") == 0 || strcmp(input, "unlock titanium with brass") == 0 || strcmp(input, "unlock titanium box with brass") == 0) { printf("\nWhat brass?"); } } return; } // UNLOCK TITANIUM BOX WITH IRON KEY / OPEN TITANIUM BOX WITH IRON KEY if (strcmp(input, "use iron key on titanium box") == 0 || strcmp(input, "use iron key on titanium") == 0 || strcmp(input, "use iron on titanium box") == 0 || strcmp(input, "use iron on titanium") == 0 || strcmp(input, "use iron key to open titanium box") == 0 || strcmp(input, "use iron key to open titanium") == 0 || strcmp(input, "use iron to open titanium box") == 0 || strcmp(input, "use iron to open titanium") == 0 || strcmp(input, "use iron key to unlock titanium") == 0 || strcmp(input, "use iron key to unlock titanium box") == 0 || strcmp(input, "use iron to unlock titanium") == 0 || strcmp(input, "use iron to unlock titanium box") == 0 || strcmp(input, "open titanium box with iron key") == 0 || strcmp(input, "open titanium with iron key") == 0 || strcmp(input, "open titanium box with iron") == 0 || strcmp(input, "open titanium with iron") == 0 || strcmp(input, "open titanium box using iron key") == 0 || strcmp(input, "open titanium using iron key") == 0 || strcmp(input, "open titanium box using iron") == 0 || strcmp(input, "open titanium using iron") == 0 || strcmp(input, "unlock titanium box using iron key") == 0 || strcmp(input, "unlock titanium using iron key") == 0 || strcmp(input, "unlock titanium box using iron") == 0 || strcmp(input, "unlock titanium using iron") == 0 || strcmp(input, "unlock titanium box with iron key") == 0 || strcmp(input, "unlock titanium with iron key") == 0 || strcmp(input, "unlock titanium box with iron") == 0 || strcmp(input, "unlock titanium with iron") == 0) { if (roomid == 3 && ironkey != 0) { printf("\nYou attempted to use iron key to unlock the titanium box, but the iron key doens't fit in the keyhole."); } if (roomid != 3) { if (strcmp(input, "use iron key on titanium box") == 0 || strcmp(input, "use iron on titanium box") == 0 || strcmp(input, "use iron key to open titanium box") == 0 || strcmp(input, "use iron to open titanium box") == 0 || strcmp(input, "use iron key to unlock titanium box") == 0 || strcmp(input, "use iron to unlock titanium box") == 0 || strcmp(input, "open titanium box with iron key") == 0 || strcmp(input, "open titanium box with iron") == 0 || strcmp(input, "open titanium box using iron key") == 0 || strcmp(input, "open titanium box using iron") == 0 || strcmp(input, "unlock titanium box using iron key") == 0 || strcmp(input, "unlock titanium box using iron") == 0 || strcmp(input, "unlock titanium box with iron key") == 0 || strcmp(input, "unlock titanium box with iron") == 0) { printf("\nThere is no titanium box here."); } if (strcmp(input, "use iron key on titanium") == 0 || strcmp(input, "use iron on titanium") == 0 || strcmp(input, "use iron key to open titanium") == 0 || strcmp(input, "use iron to open titanium") == 0 || strcmp(input, "use iron key to unlock titanium") == 0 || strcmp(input, "use iron to unlock titanium") == 0 || strcmp(input, "open titanium with iron key") == 0 || strcmp(input, "open titanium with iron") == 0 || strcmp(input, "open titanium using iron key") == 0 || strcmp(input, "open titanium using iron") == 0 || strcmp(input, "unlock titanium using iron key") == 0 || strcmp(input, "unlock titanium using iron") == 0 || strcmp(input, "unlock titanium with iron key") == 0 || strcmp(input, "unlock titanium with iron") == 0) { printf("\nThere isn't anything titanium in here."); } } if (ironkey == 0) { if (strcmp(input, "use iron key on titanium box") == 0 || strcmp(input, "use iron key on titanium") == 0 || strcmp(input, "use iron key to open titanium box") == 0 || strcmp(input, "use iron key to open titanium") == 0 || strcmp(input, "use iron key to unlock titanium") == 0 || strcmp(input, "use iron key to unlock titanium box") == 0 || strcmp(input, "open titanium box with iron key") == 0 || strcmp(input, "open titanium with iron key") == 0 || strcmp(input, "open titanium box using iron key") == 0 || strcmp(input, "open titanium using iron key") == 0 || strcmp(input, "unlock titanium box using iron key") == 0 || strcmp(input, "unlock titanium using iron key") == 0 || strcmp(input, "unlock titanium box with iron key") == 0 || strcmp(input, "unlock titanium with iron key") == 0) { printf("\nWhat iron key?"); } if (strcmp(input, "use iron on titanium box") == 0 || strcmp(input, "use iron on titanium") == 0 || strcmp(input, "use iron to open titanium box") == 0 || strcmp(input, "use iron to open titanium") == 0 || strcmp(input, "use iron to unlock titanium") == 0 || strcmp(input, "use iron to unlock titanium box") == 0 || strcmp(input, "open titanium box with iron") == 0 || strcmp(input, "open titanium with iron") == 0 || strcmp(input, "open titanium box using iron") == 0 || strcmp(input, "open titanium using iron") == 0 || strcmp(input, "unlock titanium box using iron") == 0 || strcmp(input, "unlock titanium using iron") == 0 || strcmp(input, "unlock titanium box with iron") == 0 || strcmp(input, "unlock titanium with iron") == 0 || strcmp(input, "unlock titanium box with iron") == 0) { printf("\nWhat iron?"); } } return; } // OPEN TITANIUM BOX if (strcmp(input, "open titanium box") == 0 || strcmp(input, "open titanium") == 0) { if (roomid == 3) { if (titaniumbox == 0) { printf("\nYou can't open the titanium box."); printf("\nYou will need to unlock the titanium box with a key."); } if (titaniumbox != 0) { printf("\nThe titanium box is already open."); if (ironkey == 0) { printf("\nThere is a iron key inside the titanium box."); } if (ironkey != 0) { printf("\nThe titanium box is empty."); } } } if (roomid != 3) { if (strcmp(input, "open titanium box") == 0) { printf("\nThere isn't any titanium box here."); } if (strcmp(input, "open titanium") == 0) { printf("\nThere isn't anything titanium in here."); } } return; } // CLOSE TITANIUM BOX if (strcmp(input, "close titanium box") == 0 || strcmp(input, "close titanium") == 0) { if (roomid == 3) { if (titaniumbox == 0) { printf("\nThe titanium box is already closed."); } if (titaniumbox != 0) { printf("\nYou close the titanium box."); titaniumbox = 0; } } if (roomid != 3) { if (strcmp(input, "close titanium box") == 0) { printf("\nThere isn't any titanium box here."); } if (strcmp(input, "close titanium") == 0) { printf("\nThere isn't anything titanium in here."); } } return; } // TAKE TITANIUM BOX if (strcmp(input, "take titanium box") == 0 || strcmp(input, "take titanium") == 0) { if (roomid == 3) { printf("\nThe titanium box seems to be fused to the floor, you can't take it."); } if (roomid != 3) { if (strcmp(input, "take titanium box") == 0) { printf("\nThere isn't any titanium box here."); } if (strcmp(input, "take titanium") == 0) { printf("\nThere isn't anything titanium in here."); } } return; } // LOOK METAL ACCESS PANEL if (strcmp(input, "look access panel") == 0 || strcmp(input, "look panel") == 0 || strcmp(input, "look access") == 0 || strcmp(input, "look metal access") == 0 || strcmp(input, "look metal panel") == 0 || strcmp(input, "look metal access panel") == 0) { if (roomid == 1 || roomid == 2 || roomid == 3) { if (strcmp(input, "look access panel") == 0) { printf("\nThere isn't any access panel here."); } if (strcmp(input, "look panel") == 0) { printf("\nThere isn't any panel here."); } if (strcmp(input, "look access") == 0) { printf("\nWhat access?"); } if (strcmp(input, "look metal access") == 0) { printf("\nWhat metal access?"); } if (strcmp(input, "look metal access panel") == 0) { printf("\nThere isn't any metal access panel here."); } if (strcmp(input, "look metal panel") == 0) { printf("\nThere isn't any metal panel here."); } } if (roomid == 4) { if (southaccesspanel != 0) { printf("\nIt's a metal access panel. It's currently open."); printf("\nYou can see red and blue switches in the access panel."); } if (southaccesspanel == 0) { printf("\nIt's a metal access panel. It's currently closed."); } } if (roomid == 5) { if (northaccesspanel != 0) { printf("\nIt's a metal access panel. It's currently open."); printf("\nYou can see black and white switches in the access panel."); } if (northaccesspanel == 0) { printf("\nIt's a metal access panel. It's currently closed."); } } return; } // OPEN METAL ACCESS PANEL if (strcmp(input, "open access panel") == 0 || strcmp(input, "open panel") == 0 || strcmp(input, "open access") == 0 || strcmp(input, "open metal access") == 0 || strcmp(input, "open metal panel") == 0 || strcmp(input, "open metal access panel") == 0) { if (roomid == 1 || roomid == 2 || roomid == 3) { if (strcmp(input, "open access panel") == 0) { printf("\nThere isn't any access panel here."); } if (strcmp(input, "open panel") == 0) { printf("\nThere isn't any panel here."); } if (strcmp(input, "open access") == 0) { printf("\nWhat access?"); } if (strcmp(input, "open metal access") == 0) { printf("\nWhat metal access?"); } if (strcmp(input, "open metal access panel") == 0) { printf("\nThere isn't any metal access panel here."); } if (strcmp(input, "open metal panel") == 0) { printf("\nThere isn't any metal panel here."); } } if (roomid == 4) { if (southaccesspanel == 2) { printf("\nIt's already open."); } if (southaccesspanel == 1) { southaccesspanel = 2; southdoor = 0; printf("\nOpening the metal access panel reveals two switches."); printf("\nYou can see a red switch here."); printf("\nYou can see a blue switch here."); printf("\nThe light above the door in the north is now red."); } if (southaccesspanel == 0) { printf("\nIt's securely locked."); } } if (roomid == 5) { if (northaccesspanel != 0) { printf("\nIt's already open."); } if (northaccesspanel == 0) { northaccesspanel = 1; northdoor = 0; printf("\nOpening the metal access panel reveals two switches."); printf("\nYou can see a black switch here."); printf("\nYou can see a white switch here."); printf("\nThe light above the door in the south is now red."); } } return; } // CLOSE METAL ACCESS PANEL if (strcmp(input, "close access panel") == 0 || strcmp(input, "close panel") == 0 || strcmp(input, "close access") == 0 || strcmp(input, "close metal access") == 0 || strcmp(input, "close metal panel") == 0 || strcmp(input, "close metal access panel") == 0) { if (roomid == 1 || roomid == 2 || roomid == 3) { if (strcmp(input, "close access panel") == 0) { printf("\nThere isn't any access panel here."); } if (strcmp(input, "close panel") == 0) { printf("\nThere isn't any panel here."); } if (strcmp(input, "close access") == 0) { printf("\nWhat access?"); } if (strcmp(input, "close metal access") == 0) { printf("\nWhat metal access?"); } if (strcmp(input, "close metal access panel") == 0) { printf("\nThere isn't any metal access panel here."); } if (strcmp(input, "close metal panel") == 0) { printf("\nThere isn't any metal panel here."); } } if (roomid == 4) { if (southaccesspanel == 0 || southaccesspanel == 1) { printf("\nIt's already closed."); } if (southaccesspanel == 2) { southaccesspanel = 1; southdoor = 1; printf("\nYou close the metal access panel."); printf("\nThe light above the door in the north is now green."); } } if (roomid == 5) { if (northaccesspanel == 0) { printf("\nIt's already closed."); } if (northaccesspanel != 0) { northaccesspanel = 0; northdoor = 1; printf("\nYou close the metal access panel."); printf("\nThe light above the door in the south is now green."); } } return; } // TAKE METAL ACCESS PANEL if (strcmp(input, "take access panel") == 0 || strcmp(input, "take panel") == 0 || strcmp(input, "take access") == 0 || strcmp(input, "take metal access") == 0 || strcmp(input, "take metal panel") == 0 || strcmp(input, "take metal access panel") == 0) { if (roomid == 1 || roomid == 2 || roomid == 3) { if (strcmp(input, "take access panel") == 0) { printf("\nThere isn't any access panel here."); } if (strcmp(input, "take panel") == 0) { printf("\nThere isn't any panel here."); } if (strcmp(input, "take access") == 0) { printf("\nWhat access?"); } if (strcmp(input, "take metal access") == 0) { printf("\nWhat metal access?"); } if (strcmp(input, "take metal access panel") == 0) { printf("\nThere isn't any metal access panel here."); } if (strcmp(input, "take metal panel") == 0) { printf("\nThere isn't any metal panel here."); } } if (roomid == 4 || roomid == 5) { printf("\nYou try to tear the metal access panel out of the wall but it's proving to be impossible."); } return; } // LOOK SENSOR if (strcmp(input, "look sensor") == 0 || strcmp(input, "look light sensor") == 0) { if (roomid == 3) { printf("\nIt's a light sensor embedded in the ceiling."); } if (roomid != 3) { printf("\nWhat sensor?"); } return; } // TAKE SENSOR if (strcmp(input, "take sensor") == 0 || strcmp(input, "take light sensor") == 0) { if (roomid == 3) { printf("\nThe sensor is firmly embedded in the ceiling, you can't dislodge it."); } if (roomid != 3) { printf("\nWhat sensor?"); } return; } // LOOK PILE OF RUBBISH if (strcmp(input, "look rubbish") == 0 || strcmp(input, "look pile of rubbish") == 0 || strcmp(input, "look rubbish pile") == 0 || strcmp(input, "look pile rubbish") == 0) { if (roomid == 4) { printf("\nIt's a pile of rubbish."); } if (roomid != 4) { printf("\nWhat rubbish?"); } return; } // TAKE PILE OF RUBBISH / SEARCH PILE OF RUBBISH if (strcmp(input, "take rubbish") == 0 || strcmp(input, "take pile of rubbish") == 0 || strcmp(input, "take pile rubbish") == 0 || strcmp(input, "take rubbish pile") == 0 || strcmp(input, "move rubbish") == 0 || strcmp(input, "move pile of rubbish") == 0 || strcmp(input, "move pile rubbish") == 0 || strcmp(input, "move rubbish pile") == 0 || strcmp(input, "search rubbish") == 0 || strcmp(input, "search pile rubbish") == 0 || strcmp(input, "search pile of rubbish") == 0 || strcmp(input, "search rubbish pile") == 0) { if (roomid == 4) { printf("\nYou decide to search the pile of rubbish."); if (flashlight != 0) { printf("\nAfter a few minutes of searching, you haven't found anything useful."); } if (flashlight == 0) { printf("\nAfter a few minutes of searching, you find a flashlight."); printf("\nYou take the flashlight."); flashlight = 1; emptyinventory = 0; } } if (roomid != 4) { printf("\nWhat rubbish?"); } return; } // LOOK PLANTER if (strcmp(input, "look planter") == 0 || strcmp(input, "look large planter") == 0) { if (roomid == 4) { if (planter == 0) { printf("\nIt's a large planter. It's broken and beginning to crumble."); } if (planter != 0) { printf("\nThe planter had crumbled into a pile of dirt."); } } if (roomid != 4) { printf("\nWhat planter?"); } return; } // TAKE PLANTER if (strcmp(input, "take planter") == 0 || strcmp(input, "take large planter") == 0) { if (roomid == 4) { if (planter != 0) { printf("\nThe planter is just a pile of dirt now. You can't take it."); } if (planter == 0) { printf("\nYou try to move the planter."); printf("\nSince it is already crumbling, it readily collapses and crumbles into a pile of dirt."); printf("\nThere is a brass key partially buried in the pile of dirt."); deadplant = 1; planter = 1; } } if (roomid != 4) { printf("\nWhat planter?"); } return; } // LOOK PILE OF DIRT / LOOK DIRT if (strcmp(input, "look dirt") == 0 || strcmp(input, "look pile of dirt") == 0 || strcmp(input, "look dirt pile") == 0 || strcmp(input, "look pile dirt") == 0) { if (roomid == 4 && planter != 0) { printf("\nIt's a pile of dried soil."); } else { printf("\nWhat dirt?"); } return; } // TAKE PILE OF DIRT / TAKE DIRT if (strcmp(input, "take dirt") == 0 || strcmp(input, "take pile of dirt") == 0 || strcmp(input, "take dirt pile") == 0 || strcmp(input, "take pile dirt") == 0) { if (roomid == 4 && planter != 0) { printf("\nYou can't take it, you don't have anything to carry the pile of dirt in."); } else { printf("\nWhat dirt?"); } return; } // LOOK DEAD PLANT / LOOK PLANT if (strcmp(input, "look dead plant") == 0 || strcmp(input, "look plant") == 0) { if (roomid == 4) { if (deadplant == 0) { printf("\nIt's a long-dead plant."); } if (deadplant != 0) { printf("\nThe dead plant is just a pile of dust now."); } } if (roomid != 4) { printf("\nWhat plant?"); } return; } // TAKE DEAD PLANT / TAKE PLANT if (strcmp(input, "take dead plant") == 0 || strcmp(input, "take plant") == 0) { if (roomid == 4) { if (deadplant != 0) { printf("\nThe dead plant is just a pile of dust now. You can't take it."); } if (deadplant == 0) { printf("\nAs soon as you touch it, the plant crumbles into a pile of dust."); deadplant = 1; } } if (roomid != 4) { printf("\nWhat plant?"); } return; } // LOOK PILE OF DUST / LOOK DUST if (strcmp(input, "look dust") == 0 || strcmp(input, "look pile of dust") == 0 || strcmp(input, "look dust pile") == 0 || strcmp(input, "look pile dust") == 0) { if (roomid == 4 && deadplant != 0) { printf("\nIt's a dead plant that had crumbled into a pile of dust."); } else { printf("\nWhat dust?"); } return; } // TAKE PILE OF DUST / TAKE DUST if (strcmp(input, "take dust") == 0 || strcmp(input, "take pile of dust") == 0 || strcmp(input, "take dust pile") == 0 || strcmp(input, "take pile dust") == 0) { if (roomid == 4 && deadplant != 0) { printf("\nYou can't take the pile of dust. They're too fine to take ahold of."); } else { printf("\nWhat dust?"); } return; } // LOOK GEARS if (strcmp(input, "look gears") == 0 || strcmp(input, "look gear") == 0 || strcmp(input, "look large gear") == 0 || strcmp(input, "look large gears") == 0) { if (roomid == 4) { printf("\nLarge and heavy-looking rusting gears are stacked up in a corner."); printf("\nYou're not sure if you'll be able to lift a gear."); } if (roomid != 4){ if (strcmp(input, "look gears") == 0 || strcmp(input, "look large gears") == 0) { printf("\nWhat gears?"); } if (strcmp(input, "look gear") == 0 || strcmp(input, "look large gear") == 0) { printf("\nWhat gear?"); } } return; } // TAKE GEARS if (strcmp(input, "take gears") == 0 || strcmp(input, "take gear") == 0 || strcmp(input, "take large gear") == 0 || strcmp(input, "take large gears") == 0) { if (roomid == 4) { printf("\nYou try to lift one of gears, but they're too heavy. You can't take them."); } if (roomid != 4){ if (strcmp(input, "take gears") == 0 || strcmp(input, "take large gears") == 0) { printf("\nWhat gears?"); } if (strcmp(input, "take gear") == 0 || strcmp(input, "take large gear") == 0) { printf("\nWhat gear?"); } } return; } // LOOK SPRINGS if (strcmp(input, "look springs") == 0 || strcmp(input, "look spring") == 0) { if (roomid == 4) { printf("\nSprings of varying sizes are scattered all over the room."); printf("\nThey're severely rusted."); } if (roomid != 4) { if (strcmp(input, "look springs") == 0) { printf("\nWhat springs?"); } if (strcmp(input, "look spring") == 0) { printf("\nWhat spring?"); } } return; } // TAKE SPRINGS if (strcmp(input, "take springs") == 0 || strcmp(input, "take spring") == 0) { if (roomid == 4) { printf("\nYou try to take some, but they're heavily rusted and crumbled in your hand."); printf("\nYou can't take them."); } if (roomid != 4) { if (strcmp(input, "take springs") == 0) { printf("\nWhat springs?"); } if (strcmp(input, "take spring") == 0) { printf("\nWhat spring?"); } } return; } // LOOK PRESSURE PLATE if (strcmp(input, "look pressure plate") == 0 || strcmp(input, "look pressure") == 0 || strcmp(input, "look plate") == 0) { if (roomid == 5) { printf("\nThe pressure plate is almost invisible on the floor."); printf("\nThe only reason you know it is there is because you felt it " "as you entered the room."); } if (roomid != 5) { if (strcmp(input, "look pressure plate") == 0) { printf("\nThere isn't any pressure plate here."); } if (strcmp(input, "look pressure") == 0) { printf("\nWhat pressure?"); } if (strcmp(input, "look plate") == 0) { printf("\nThere isn't any plate here."); } } return; } // TAKE PRESSURE PLATE if (strcmp(input, "take pressure plate") == 0 || strcmp(input, "take pressure") == 0 || strcmp(input, "take plate") == 0) { if (roomid == 5) { printf("\nThe pressure plate seems to be an integral part of the floor."); printf("\nAs much as you try to, you can't take it."); } if (roomid != 5) { if (strcmp(input, "take pressure plate") == 0) { printf("\nThere isn't any pressure plate here."); } if (strcmp(input, "take pressure") == 0) { printf("\nWhat pressure?"); } if (strcmp(input, "take plate") == 0) { printf("\nThere isn't any plate here."); } } return; } // QUITTING GAME if (strcmp(input, "q") == 0 || strcmp(input, "quit") == 0) { endgame(); } // SAVE if (strcmp(input, "save") == 0) { saveGame(); } // LOAD if (strcmp(input, "load") == 0){ loadGame(); } // CATCH-ALL FOR EVERYTHING ELSE else { printf("\nI don't understand \"%s.\"", input); return; } } /********************************************************************** * END GAME * **********************************************************************/ void endgame() { roomid = 6; if (escaped == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t ESCAPE\n"); printf("\t\t-----------------------------------------------"); printf("\n\n\nThanks for playing.\n\n\n\n"); getchar(); clearscreen(); exit(0); } } if (escaped != 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t THE ESCAPE\n"); printf("\t\t-----------------------------------------------"); printf("\n\n\nAfter pushing the tungsten gate open, you run down the " "passage..."); printf("\nand you step out of the passage into an open grassy " "meadow!"); printf("\n\n\n\n\n\n"); printf("You have escaped! Congratulations!\n\n"); getchar(); clearscreen(); exit(0); } } } /********************************************************************** * INVENTORY * **********************************************************************/ void playerinventory() { if (emptyinventory != 1) { printf("\n-----------------------------"); printf("\n\t INVENTORY\n"); printf("-----------------------------"); printf("\n\nYou're carrying:"); if (paper != 0) { printf("\nPaper"); } if (flashlight != 0) { printf("\nFlashlight"); } if (batteries != 0) { printf("\nBatteries"); } if (aluminumkey != 0) { printf("\nAluminum Key"); } if (brasskey != 0) { printf("\nBrass Key"); } if (ironkey != 0) { printf("\nIron Key"); } } if (emptyinventory == 1) { printf("\n-----------------------------"); printf("\n\t INVENTORY\n"); printf("-----------------------------"); printf("\n\nYou're not carrying anything."); } return; } /********************************************************************** * DEBUG * **********************************************************************/ void debugmode() { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\n\nWhich action do you want to take?"); printf("\n1: Add item to inventory"); printf("\n2: Remove item from inventory"); printf("\n3: Modify game states"); printf("\n4: Change room"); printf("\n5: Exit to the game"); printf("\n6: Quit the game."); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { for(;;) { if (paper != 0 || flashlight != 0 || batteries != 0 || aluminumkey != 0 || brasskey != 0 || ironkey != 0) { emptyinventory = 0; } if (paper == 0 && flashlight == 0 && batteries == 0 && aluminumkey == 0 && brasskey == 0 && ironkey == 0) { emptyinventory = 1; } clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\n\nAdd which item to the inventory?"); printf("\n1: Paper"); printf("\n2: Flashlight"); printf("\n3: Batteries"); printf("\n4: Aluminum Key"); printf("\n5: Brass Key"); printf("\n6: Iron Key"); printf("\n7: Add Everything"); printf("\n8: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { paper = 1; printf("\nPaper added to inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { flashlight = 1; printf("\nFlashlight added to inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { batteries = 1; printf("\nBatteries added to inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "4") == 0) { aluminumkey = 1; printf("\nAluminum Key added to inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "5") == 0) { brasskey = 1; printf("\nBrass Key added to inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "6") == 0) { ironkey = 1; printf("\nIron Key added to inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "7") == 0) { paper = 1; flashlight = 1; batteries = 1; aluminumkey = 1; brasskey = 1; ironkey = 1; printf("\nAll items added to inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "8") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); } } } if (strcmp(input, "2") == 0) { for(;;) { if (paper != 0 || flashlight != 0 || batteries != 0 || aluminumkey != 0 || brasskey != 0 || ironkey != 0) { emptyinventory = 0; } if (paper == 0 && flashlight == 0 && batteries == 0 && aluminumkey == 0 && brasskey == 0 && ironkey == 0) { emptyinventory = 1; } clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\n\nRemove which item from the inventory?"); printf("\n1: Paper"); printf("\n2: Flashlight"); printf("\n3: Batteries"); printf("\n4: Aluminum Key"); printf("\n5: Brass Key"); printf("\n6: Iron Key"); printf("\n7: Remove Everything"); printf("\n8: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { paper = 0; printf("\nPaper removed from inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { flashlight = 0; printf("\nFlashlight removed from inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { batteries = 0; printf("\nBatteries removed from inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "4") == 0) { aluminumkey = 0; printf("\nAluminum Key removed from inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "5") == 0) { brasskey = 0; printf("\nBrass Key removed from inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "6") == 0) { ironkey = 0; printf("\nIron Key removed from inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "7") == 0) { paper = 0; flashlight = 0; batteries = 0; aluminumkey = 0; brasskey = 0; ironkey = 0; printf("\nAll items removed from inventory. Press enter to continue."); getchar(); continue; } if (strcmp(input, "8") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "3") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\n\nEnter the game state to modify."); printf("\n\nList of states in the game:"); printf("\n\"roomid\", \"northdoor\", \"southdoor\", \"eastdoor\", " "\"westdoor\", \n\"bronzebox\", \"northaccesspanel\", " "\"steelbox\", \"southaccesspanel\", \n\"deadplant\", " "\"planter\", \"flashlighton\", \"flashlightbatteries\", " "\n\"titaniumbox\", \"tungstengate\", \"escaped\", \"debug\""); printf("\n\nType \"exit\" when you are done."); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "roomid") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the room id."); printf("\n0: Opening"); printf("\n1: Center Room"); printf("\n2: East Room"); printf("\n3: West Room"); printf("\n4: South Room"); printf("\n5: North Room"); printf("\n6: End Game"); printf("\n7: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "0") == 0) { roomid = 0; printf("\nRoom id changed to 0 - Opening. Press enter to continue."); getchar(); continue; } if (strcmp(input, "1") == 0) { roomid = 1; printf("\nRoom id changed to 1 - Center Room. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { roomid = 2; printf("\nRoom id changed to 2 - East Room. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { roomid = 3; printf("\nRoom id changed to 3 - West Room. Press enter to continue."); getchar(); continue; } if (strcmp(input, "4") == 0) { roomid = 4; printf("\nRoom id changed to 4 - South Room. Press enter to continue."); getchar(); continue; } if (strcmp(input, "5") == 0) { roomid = 5; printf("\nRoom id changed to 5 - North Room. Press enter to continue."); getchar(); continue; } if (strcmp(input, "6") == 0) { roomid = 6; printf("\nRoom id changed to 6 - Ending. Press enter to continue."); getchar(); continue; } if (strcmp(input, "7") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "northdoor") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the north door."); printf("\n1: Locked"); printf("\n2: Unlocked"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { northdoor = 0; printf("\nNorth door is now locked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { northdoor = 1; printf("\nNorth door is now unlocked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "southdoor") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the south door."); printf("\n1: Locked"); printf("\n2: Unlocked"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { southdoor = 0; printf("\nSouth door is now locked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { southdoor = 1; printf("\nSouth door is now unlocked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "eastdoor") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the east door."); printf("\n1: Locked"); printf("\n2: Unlocked"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { eastdoor = 0; printf("\nEast door is now locked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { eastdoor = 1; printf("\nEast door is now unlocked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "westdoor") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the west door."); printf("\n1: Locked"); printf("\n2: Unlocked"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { westdoor = 0; printf("\nWest door is now locked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { westdoor = 1; printf("\nWest door is now unlocked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "bronzebox") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the bronze box."); printf("\n1: Closed, Locked"); printf("\n2: Closed, Unlocked"); printf("\n3: Open"); printf("\n4: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { bronzebox = 0; printf("\nBronze Box is now closed and locked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { bronzebox = 1; printf("\nBronze Box is now closed and unlocked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { bronzebox = 2; printf("\nBronze Box is now open. Press enter to continue."); getchar(); continue; } if (strcmp(input, "4") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "northaccesspanel") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the north access panel."); printf("\n1: Closed"); printf("\n2: Open"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { northaccesspanel = 0; printf("\nNorth Access Panel is now closed. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { northaccesspanel = 1; printf("\nNorth Access Panel is now open. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "southaccesspanel") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the south access panel."); printf("\n1: Closed, Locked"); printf("\n2: Closed, Unlocked"); printf("\n3: Open"); printf("\n4: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { southaccesspanel = 0; printf("\nSouth Access Panel is now closed and locked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { southaccesspanel = 1; printf("\nSouth Access Panel is now closed and unlocked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { southaccesspanel = 2; printf("\nSouth Access Panel is now open. Press enter to continue."); getchar(); continue; } if (strcmp(input, "4") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "steelbox") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the steel box."); printf("\n1: Closed, Locked"); printf("\n2: Open"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { steelbox = 0; printf("\nSteel Box is now closed. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { steelbox = 1; printf("\nSteel Box is now open. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "titaniumbox") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the titanium box."); printf("\n1: Closed, Locked"); printf("\n2: Open"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { titaniumbox = 0; printf("\nTitanium Box is now closed. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { titaniumbox = 1; printf("\nTitanium Box is now open. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "flashlighton") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the flashlight."); printf("\n1: Off"); printf("\n2: On"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { flashlighton = 0; printf("\nFlashlight is now off. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { flashlighton = 1; printf("\nFlashlight is now on. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "flashlightbatteries") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the flashlight batteries."); printf("\n1: Not Inserted"); printf("\n2: Inserted"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { flashlightbatteries = 0; printf("\nBatteries is now not inserted into flashlight. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { flashlightbatteries = 1; printf("\nBatteries is now inserted into flashlight. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "planter") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the planter."); printf("\n1: Intact"); printf("\n2: Crumbled into a pile of dirt"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { planter = 0; printf("\nPlanter is now intact and not crumbled. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { planter = 1; printf("\nPlanter is now crumbled. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "deadplant") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the dead plant."); printf("\n1: Intact"); printf("\n2: Crumbled into a pile of dust"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { deadplant = 0; printf("\nDead Plant is now intact and not crumbled. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { deadplant = 1; printf("\nDead Plant is now crumbled into a pile of dust. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "tungstengate") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of the tungsten gate."); printf("\n1: Locked"); printf("\n2: Unlocked"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { tungstengate = 0; printf("\nTungsten Gate is now locked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { tungstengate = 1; printf("\nTungsten Gate is now unlocked. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "escaped") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the status of escaped."); printf("\n1: Not Escaped"); printf("\n2: Escaped"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { escaped = 0; printf("\nPlayer has not escaped. Press enter to continue."); getchar(); continue; } if (strcmp(input, "2") == 0) { escaped = 1; printf("\nPlayer has escaped. Press enter to continue."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "debug") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\nEnter the state of debug mode."); printf("\n1: Disabled"); printf("\n2: Enabled"); printf("\n3: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "1") == 0) { debug = 0; printf("\nDebug disabled."); getchar(); continue; } if (strcmp(input, "2") == 0) { debug = 1; printf("\nDebug enabled."); getchar(); continue; } if (strcmp(input, "3") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "exit") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "4") == 0) { for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t DEBUG\n"); printf("\t\t-----------------------------------------------"); printf("\n\nChange to which room?"); printf("\n0: Opening"); printf("\n1: Center Room"); printf("\n2: East Room"); printf("\n3: West Room"); printf("\n4: South Room"); printf("\n5: North Room"); printf("\n6: End Game"); printf("\n7: Return to Debug Menu"); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); if (strcmp(input, "0") == 0) { opening(); } if (strcmp(input, "1") == 0) { centerRoom(); } if (strcmp(input, "2") == 0) { eastRoom(); } if (strcmp(input, "3") == 0) { westRoom(); } if (strcmp(input, "4") == 0) { southRoom(); } if (strcmp(input, "5") == 0) { northRoom(); } if (strcmp(input, "6") == 0) { endgame(); } if (strcmp(input, "7") == 0) { debugmode(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } if (strcmp(input, "5") == 0) { if (roomid == 0) { opening(); } if (roomid == 1) { centerRoom(); } if (roomid == 2) { eastRoom(); } if (roomid == 3) { westRoom(); } if (roomid == 4) { southRoom(); } if (roomid == 5) { northRoom(); } if (roomid == 6) { endgame(); } } if (strcmp(input, "6") == 0) { endgame(); } else { printf("\nInvalid input. Press enter to continue."); getchar(); continue; } } } /********************************************************************** * SAVING THE GAME TO FILE * **********************************************************************/ void saveGame(){ for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t SAVE\n"); printf("\t\t-----------------------------------------------"); printf("\n\nPlease enter the name of the save file."); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); // USING ".escape" AS FILE EXTENSION FOR THE SAVE FILE char *fileext = ".escape"; // CONCENTATING PLAYER'S INPUT WITH FILE EXTENSION TO GET FULL FILE NAME strcat(input, fileext); FILE *savefile; // OPEN/CREATE THE SAVE FILE savefile = fopen(input, "w"); // SAVING GAME STATES TO SAVE FILE fprintf(savefile, "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", roomid, northdoor, southdoor, eastdoor, westdoor, bronzebox, northaccesspanel, steelbox, southaccesspanel, deadplant, planter, flashlighton, flashlightbatteries, titaniumbox, tungstengate, escaped, paper, brasskey, aluminumkey, ironkey, flashlight, batteries); // CLOSING THE SAVE FILE fclose (savefile); printf("\nGame saved to %s.\n", input); printf("\nPress enter to return to the game."); getchar(); if (roomid == 0) { opening(); } if (roomid == 1) { centerRoom(); } if (roomid == 2) { eastRoom(); } if (roomid == 3) { westRoom(); } if (roomid == 4) { southRoom(); } if (roomid == 5) { northRoom(); } if (roomid == 6) { endgame(); } } } /********************************************************************** * LOADING THE GAME FROM FILE * **********************************************************************/ // C VERSION OF ESCAPE ALSO ACCEPT SAVE FILES FROM PYTHON3 VERSION OF // ESCAPE, AND VICE VERSA. void loadGame(){ for(;;) { clearscreen(); printf("\t\t-----------------------------------------------"); printf("\n\t\t\t\t LOAD\n"); printf("\t\t-----------------------------------------------"); printf("\n\nPlease enter the name of the save file."); printf("\n\n>"); // GET PLAYER'S INPUT AND CLEAN IT fgets(rawinput, sizeof(rawinput), stdin); char *input = CleanRawInput(rawinput, strlen(rawinput)); // USING ".escape" AS FILE EXTENSION FOR THE SAVE FILE char *fileext = ".escape"; // CONCENTATING PLAYER'S INPUT WITH FILE EXTENSION TO GET FULL FILE NAME strcat(input, fileext); FILE *savefile; // OPENING THE SAVE FILE savefile = fopen(input, "r"); // ERROR HANDLING if (savefile == NULL) { printf("\nThe save file could not be opened."); printf("\nPress enter to return to the game."); getchar(); // RETURNING THE PLAYER TO THE GAME AFTER ERROR if (roomid == 0) { opening(); } if (roomid == 1) { centerRoom(); } if (roomid == 2) { eastRoom(); } if (roomid == 3) { westRoom(); } if (roomid == 4) { southRoom(); } if (roomid == 5) { northRoom(); } if (roomid == 6) { endgame(); } } // RESTORING THE GAME STATES USING DATA IN SAVE FILE fscanf(savefile, "%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d", &roomid, &northdoor, &southdoor, &eastdoor, &westdoor, &bronzebox, &northaccesspanel, &steelbox, &southaccesspanel, &deadplant, &planter, &flashlighton, &flashlightbatteries, &titaniumbox, &tungstengate, &escaped, &paper, &brasskey, &aluminumkey, &ironkey, &flashlight, &batteries); // CLOSING THE SAVE FILE fclose (savefile); if (paper != 0 || flashlight != 0 || batteries != 0 || aluminumkey != 0 || brasskey != 0 || ironkey != 0) { emptyinventory = 0; } if (paper == 0 && flashlight == 0 && batteries == 0 && aluminumkey == 0 && brasskey == 0 && ironkey == 0) { emptyinventory = 1; } printf("\nGame loaded from %s.\n", input); printf("\nPress enter to return to the game."); getchar(); if (roomid == 0) { opening(); } if (roomid == 1) { centerRoom(); } if (roomid == 2) { eastRoom(); } if (roomid == 3) { westRoom(); } if (roomid == 4) { southRoom(); } if (roomid == 5) { northRoom(); } if (roomid == 6) { endgame(); } } }