Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2013
2,818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 11.28 KB | None | 0 0
  1. using System;
  2.  
  3. namespace IntenseWizardy
  4. {
  5.     class MainClass
  6.     {
  7.         static int hasClub = 0;
  8.         static int hasCoinPurse = 0;
  9.  
  10.         public static void Main (string[] args)
  11.         {
  12.             Console.Title = "Intense Wizardy";
  13.             Console.WriteLine();
  14.             Console.WriteLine();
  15.             Console.WriteLine();
  16.             Console.WriteLine();
  17.             Console.WriteLine();
  18.             Console.WriteLine();
  19.             Console.WriteLine();
  20.             Console.WriteLine();
  21.             Console.WriteLine();
  22.             Console.WriteLine("                     Intense Wizardy! - A Text Adventure Game! ");
  23.             Console.WriteLine("                   : Created by Sips and written by Puddleduck :         ");
  24.             Console.WriteLine ();
  25.             Console.WriteLine ("                             Press enter to begin!");
  26.             Console.ReadLine();
  27.             Console.Clear();
  28.             showNotes();
  29.         }
  30.  
  31.         public static void showNotes()
  32.         {
  33.             Console.WriteLine ();
  34.             Console.WriteLine ("Welcome to Intense Wizardy!");
  35.             Console.WriteLine ();
  36.             Console.WriteLine ("Notes:");
  37.             Console.WriteLine ("This is my first complete game, so forgive any bugs and hopefully they aren't");
  38.             Console.WriteLine ("too game breaking. This game will parse your text to the best of my ability,");
  39.             Console.WriteLine ("but it may not understand what you mean.");
  40.             Console.WriteLine ("Try and keep any imput short and sweet, and please listen to what it tells you");
  41.             Console.WriteLine ("to do!");
  42.             Console.WriteLine ();
  43.             Console.WriteLine ("                             Press enter to continue!");
  44.             Console.ReadLine();
  45.             Console.Clear();
  46.             showIntro ();
  47.         }
  48.  
  49.         public static void showIntro()
  50.         {
  51.             Console.WriteLine ();
  52.             Console.WriteLine ("You wake in a cabin, you notice you are wearing blue robes.");
  53.             Console.WriteLine ("This is unusual.");
  54.             Console.WriteLine ("You do not usually wear blue robes.");
  55.             Console.WriteLine ("You rub your eyes to try and see more in the dark cabin.");
  56.             Console.WriteLine ("Your hands feel dry yet soft against your face.");
  57.             Console.WriteLine ("You clamber to your feet and search the walls of the cabin for an opening.");
  58.             Console.WriteLine ("The walls of the cabin are cold, they feel like stone.");
  59.             Console.WriteLine ("I lied, you are not in a cabin. You are in a cave.");
  60.             Console.WriteLine ("A mystical cave.");
  61.             Console.WriteLine ("In the darkness, you find what you think is an opening.");
  62.             Console.WriteLine ();
  63.             Console.WriteLine ("                             Press enter to continue!");
  64.             Console.ReadLine();
  65.             Console.Clear();
  66.             exitCave ();
  67.         }
  68.  
  69.         public static void exitCave()
  70.         {
  71.             Console.WriteLine();
  72.             Console.WriteLine ("Do you go through the opening?");
  73.             Console.WriteLine ("(Type your answer and then press enter!)");
  74.             Console.WriteLine ();
  75.  
  76.             string checkOpen = Console.ReadLine ();
  77.  
  78.             if (checkOpen == "yes" || checkOpen == "Yes" || checkOpen == "y" || checkOpen == "Y" || checkOpen == "YES") {
  79.                 Console.Clear ();
  80.                 openOut ();
  81.             }
  82.             else if (checkOpen == "no" || checkOpen == "No" || checkOpen == "n" || checkOpen == "N" || checkOpen == "NO")
  83.             {
  84.                 Console.Clear ();
  85.                 openIn ();
  86.             }
  87.             else {
  88.                 Console.WriteLine ("Invalid input, try again!");
  89.                 exitCave ();
  90.             }
  91.         }
  92.  
  93.         public static void openOut()
  94.         {
  95.             Console.WriteLine ();
  96.             Console.WriteLine ("You scramble through the opening into another dark chamber.");
  97.             Console.WriteLine ("This room is slightly warmer than the previous one.");
  98.             Console.WriteLine ("You see a tiny strip of light coming from one of the walls.");
  99.             Console.WriteLine ("You walk over and investigate.");
  100.             Console.WriteLine ("Staring at the strip of light, you can see that it is a crack in the wall.");
  101.             Console.WriteLine ("Through the crack you can see a room, with a fireplace.");
  102.             Console.WriteLine ("You search the chamber for a way through to the room.");
  103.             Console.WriteLine ();
  104.             Console.WriteLine ("                             Press enter to continue!");
  105.             Console.ReadLine();
  106.             Console.Clear();
  107.             searchChamber ();
  108.         }
  109.  
  110.         public static void openIn()
  111.         {
  112.             Console.WriteLine ();
  113.             Console.WriteLine ("You continue to explore the dark room.");
  114.             Console.WriteLine ("You walk to the other side of the cave and discover a pot on the ground.");
  115.             Console.WriteLine ("You reach into the pot.");
  116.             Console.WriteLine ("You cry out in pain as you feel the fangs of a snake clamp down on your hand.");
  117.             Console.WriteLine ("You fall back, the snake still attatched to your hand, hissing loudly.");
  118.             Console.WriteLine ("You feel your life draining from you.");
  119.             Console.WriteLine ("You die.");
  120.             Console.WriteLine ("Due to the fact that this is a game, you are allowed to return to your previous decision. Try and pick an option that doesn't get you killed this time.");
  121.             Console.WriteLine ();
  122.             Console.WriteLine ("                             Press enter to continue!");
  123.             Console.ReadLine();
  124.             Console.Clear();
  125.             exitCave ();
  126.         }
  127.  
  128.         public static void searchChamber()
  129.         {
  130.             Console.WriteLine ();
  131.             Console.WriteLine ("You see a rock and a puddle, which do you investigate first?");
  132.             Console.WriteLine ("(Type your answer and then press enter!)");
  133.             Console.WriteLine ();
  134.  
  135.             string puddleOrRock = Console.ReadLine ();
  136.  
  137.             if (puddleOrRock == "rock" || puddleOrRock == "Rock" || puddleOrRock == "ROCK" || puddleOrRock == "the rock") {
  138.                 Console.Clear ();
  139.                 examineRock ();
  140.             }else if(puddleOrRock == "puddle" || puddleOrRock == "Puddle" || puddleOrRock == "PUDDLE" || puddleOrRock == "the puddle")
  141.             {
  142.                 Console.Clear ();
  143.                 examinePuddle ();
  144.             }else{
  145.                 Console.WriteLine ("Invalid input, try again!");
  146.                 searchChamber ();
  147.             }
  148.         }
  149.  
  150.         public static void examineRock()
  151.         {
  152.             Console.WriteLine ();
  153.             Console.WriteLine ("You place your hands on the rock and instantly feel it give way.");
  154.             Console.WriteLine ("The wall crumbles away revealing a passage behind.");
  155.             Console.WriteLine ("You make your way into the passage, the light getting a little brighter.");
  156.             Console.WriteLine ("You emerge from the passage into a hallway, and you see a wooden club.");
  157.             Console.WriteLine ("You also see an open door, with from which you can hear a crackling fire.");
  158.             Console.WriteLine ();
  159.             Console.WriteLine ("                             Press enter to continue!");
  160.             Console.ReadLine();
  161.             Console.Clear();
  162.             hallwayChoice ();
  163.         }
  164.  
  165.         public static void examinePuddle()
  166.         {
  167.             Console.WriteLine ();
  168.             Console.WriteLine ("You kneel down and look into the puddle.");
  169.             Console.WriteLine ("By the dim light you are able to make out a figure in the reflection.");
  170.             Console.WriteLine ("You look at the puddle in horror, you are an old man, with a beard!");
  171.             Console.WriteLine ("You recoil in horror, this isn't how you are supposed to look!");
  172.             Console.WriteLine ("You scramble back towards rock to sit and rest.");
  173.             Console.WriteLine ("After all, you are now an old man. You need your rest.");
  174.             Console.WriteLine ("You lean back against the rock and instantly feel it give way.");
  175.             Console.WriteLine ("The wall crumbles away revealing a passage behind.");
  176.             Console.WriteLine ("You make your way into the passage, the light getting a little brighter.");
  177.             Console.WriteLine ("You emerge from the passage into a hallway, and you see a wooden club.");
  178.             Console.WriteLine ("You also see an open door, with from which you can hear a crackling fire.");
  179.             Console.WriteLine ();
  180.             Console.WriteLine ("                             Press enter to continue!");
  181.             Console.ReadLine();
  182.             Console.Clear();
  183.             hallwayChoice ();
  184.  
  185.             string age = "old";
  186.         }
  187.  
  188.         public static void hallwayChoice()
  189.         {
  190.             Console.WriteLine ();
  191.             Console.WriteLine ("What do you do?");
  192.             Console.WriteLine ("(Type your answer and then press enter, try and keep it pretty simple!)");
  193.             Console.WriteLine ();
  194.  
  195.             string hallway = Console.ReadLine ();
  196.  
  197.             if (hallway.Contains ("pick up") || hallway.Contains ("club")) {
  198.                 Console.Clear ();
  199.                  hasClub = 1;
  200.                 hallWithClub ();
  201.             } else if (hallway.Contains ("door") || hallway.Contains ("go to")) {
  202.                 Console.Clear ();
  203.                  hasClub = 0;
  204.                 hallNoClub ();
  205.             } else {
  206.                 Console.WriteLine ("Invalid input, try again!");
  207.                 hallwayChoice ();
  208.             }
  209.         }
  210.  
  211.         public static void hallWithClub()
  212.         {
  213.             Console.WriteLine ();
  214.             Console.WriteLine ("You picked up the club, that could prove useful soon!");
  215.             Console.WriteLine ("Armed with your newly obtained club, you advance towards the door.");
  216.             Console.WriteLine ();
  217.             Console.WriteLine ("                             Press enter to continue!");
  218.             Console.ReadLine();
  219.             Console.Clear();
  220.             enterRoom ();
  221.         }
  222.  
  223.         public static void hallNoClub()
  224.         {
  225.             Console.WriteLine ();
  226.             Console.WriteLine ("You choose to ignore the club, and go straight towards the door.");
  227.             Console.WriteLine ();
  228.             Console.WriteLine ("                             Press enter to continue!");
  229.             Console.ReadLine();
  230.             Console.Clear();
  231.             enterRoom ();
  232.  
  233.         }
  234.  
  235.         public static void enterRoom()
  236.         {
  237.             Console.WriteLine ();
  238.             Console.WriteLine ("You enter the room and take in your surroundings.");
  239.             Console.WriteLine ("There is a troll standing in one corner, you spot each other.");
  240.             Console.WriteLine ("The troll pounces on you.");
  241.             if (hasClub == 0) {
  242.                 Console.WriteLine ();
  243.                 Console.WriteLine ("You are defenceless, the troll grabs your butt hard and throws you back out the room.");
  244.                 Console.WriteLine ();
  245.                 Console.WriteLine ("                             Press enter to continue!");
  246.                 Console.ReadLine();
  247.                 Console.Clear();
  248.                 outRoomHallway ();
  249.             } else if (hasClub == 1) {
  250.                 Console.WriteLine ();
  251.                 Console.WriteLine ("You swing your club and hit the troll on the back of the head.");
  252.                 Console.WriteLine ("The troll dies.");
  253.                 Console.WriteLine ("The troll drops a bag of gold coins.");
  254.                 Console.WriteLine ();
  255.                 Console.WriteLine ("                             Press enter to continue!");
  256.                 Console.ReadLine();
  257.                 Console.Clear();
  258.                 coinChoice ();
  259.             } else {
  260.                 Console.WriteLine ("Something has gone terribly wrong, please contact the developer!");
  261.             }
  262.         }
  263.  
  264.         public static void outRoomHallway()
  265.         {
  266.             Console.WriteLine ();
  267.             Console.WriteLine ("You fly out the room into the hallway, and you see the wooden club.");
  268.             Console.WriteLine ("The door is still open, and the troll is still inside.");
  269.             Console.WriteLine ();
  270.             Console.WriteLine ("                             Press enter to continue!");
  271.             Console.ReadLine();
  272.             Console.Clear();
  273.             hallwayChoice ();
  274.         }
  275.  
  276.         public static void coinChoice()
  277.         {
  278.             Console.WriteLine ();
  279.             Console.WriteLine ("Do you pick up the coin purse?");
  280.             Console.WriteLine ("(Type your answer and then press enter)");
  281.             Console.WriteLine ();
  282.  
  283.             string coinPurse = Console.ReadLine ();
  284.  
  285.             if (coinPurse == "yes" || coinPurse == "Yes" || coinPurse == "y" || coinPurse == "Y" || coinPurse == "YES") {
  286.                 Console.Clear ();
  287.                 hasCoinPurse = 1;
  288.                 afterTroll ();
  289.             }
  290.             else if (coinPurse == "no" || coinPurse == "No" || coinPurse == "n" || coinPurse == "N" || coinPurse == "NO")
  291.             {
  292.                 Console.Clear ();
  293.                 hasCoinPurse = 0;
  294.                 afterTroll ();
  295.             }
  296.             else {
  297.                 Console.WriteLine ("Invalid input, try again!");
  298.                 coinChoice ();
  299.             }
  300.         }
  301.  
  302.         public static void afterTroll()
  303.         {
  304.             Console.WriteLine ();
  305.         }
  306.     }
  307. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement