コード例 #1
0
        public void Timer()
        {
            _timer--;
            switch (_timer)
            {
            case 40:
                Services.ScrollText("There are 4 minutes until he makes it to that stage; you must eliminate the target soon!", 500);
                break;

            case 30:
                Services.ScrollText("There are 3 minutes until he makes it to that stage; you must eliminate the target soon!", 500);
                break;

            case 20:
                Services.ScrollText("There are 2 minutes until he makes it to that stage; you must eliminate the target soon!", 500);
                break;

            case 10:
                Services.ScrollText("There is 1 minute until he makes it to that stage; you must eliminate the target soon!", 500);
                break;

            case 0:
                Services.ScrollText("You're too late! The speech is starting. Mission failed.", 500);
                Services.PlayAgain();
                break;
            }
        }
コード例 #2
0
        public void GameOver()
        {
            Services.ScrollText("Game Over", 1000);
            Services.ScrollText("You made it through " + (CurrentLevel - 1) + " levels.", 1000);

            Services.PlayAgain();
        }
コード例 #3
0
        public void Intro()
        {
            Services.ScrollText("Welcome to the Impossible Game!", 1500);
            Services.ScrollText("You are about to start out on a string of wild and bizarre adventures.", 1500);
            Services.ScrollText("But first... What is your name?");

            Console.Write("> ");
            string name = Console.ReadLine();

            int check = CheckForSkip(name);

            if (check != 0)
            {
                CurrentLevel = check;
                Services.ScrollText("You have skipped to level " + CurrentLevel + "!", 500);
                Services.ScrollText("But I do still need to know your name..");
                Console.Write("> ");
                name = Console.ReadLine();
            }

            player.Name = name;

            Services.ScrollText("Great! Nice to meet you " + player.Name + ".", 1500);
            Services.ScrollText("I won't keep you here any longer... Your first adventure starts now!", 3500);

            Console.Clear();

            Thread.Sleep(1000);

            StartLevel();
        }
コード例 #4
0
        public void RoomTwo()
        {
            Location = "Room Two";
            EnterArea(room2, "A room.", roomtwotargets);


            Services.ScrollText("This room contains a ");
        }
コード例 #5
0
ファイル: Bomb.cs プロジェクト: KevinJThomas/TextGame
 public void PrintRules()
 {
     Console.WriteLine();
     foreach (string option in rules)
     {
         Services.ScrollText((Array.IndexOf(rules, option) + 1) + " - " + option);
     }
     Console.WriteLine();
 }
コード例 #6
0
ファイル: Riddles.cs プロジェクト: KevinJThomas/TextGame
        public void DoorMan()
        {
            Console.WriteLine();
            foreach (string option in doorMan)
            {
                Services.ScrollText((Array.IndexOf(doorMan, option) + 1) + " - " + option);
            }

            int    input;
            string decision = Console.ReadLine();

            Console.WriteLine();

            if (Int32.TryParse(decision, out input))
            {
                switch (input)
                {
                case 1:
                    Services.ScrollText("\"" + doorMan[input - 1] + "\"\n", 1000);
                    Services.ScrollText("That is something that you will have to find out for yourself, young one.", 1000);
                    DoorMan();
                    break;

                case 2:
                    Services.ScrollText("\"" + doorMan[input - 1] + "\"\n", 1000);
                    Services.ScrollText("What is the password?", 1000);
                    if (ProvidePass("tomorrow"))
                    {
                        _player.LevelCompleted = true;
                        Services.ScrollText("Very good! You may leave now. Good luck on your future journies.", 1500);
                    }
                    else
                    {
                        Deny();
                        TheCircularRoom();
                    }
                    break;

                case 3:
                    Services.ScrollText("\"" + doorMan[input - 1] + "\"\n", 1000);
                    Services.ScrollText("Farewell..", 500);
                    TheCircularRoom();
                    break;

                default:
                    Console.WriteLine("Invalid input. Please try again.");
                    DoorMan();
                    break;
                }
            }
            else
            {
                ExamineCommand(decision);
                DoorMan();
            }
        }
コード例 #7
0
        public void RedSquareEnterance()
        {
            Location = "the Red Square's enterance";
            EnterArea(redSquareEnterance, redSquareEnteranceDesc, redSquareEnteranceTarget);

            int    input;
            string decision = Console.ReadLine();

            if (Int32.TryParse(decision, out input))
            {
                switch (input)
                {
                case 1:
                    ScanCrowd();
                    Timer();
                    RedSquareEnterance();
                    break;

                case 2:
                    Services.ScrollText("You walk over to the front of the stage.", 500);
                    Timer();
                    Stage();
                    break;

                case 3:
                    Services.ScrollText("You walk into the hotel bordering the square", 500);
                    Services.ScrollText("There is security with a metal detector at the door, you are forced to leave your gun and knife with them.", 1000);
                    _player.Bag.Remove(gun);
                    _player.Bag.Remove(knife);
                    Timer();
                    Hotel();
                    break;

                default:
                    Console.WriteLine("Invalid input. Please try again.");
                    RedSquareEnterance();
                    break;
                }
            }
            else
            {
                ExamineCommand(decision);
                if (Item != null && Target != null)
                {
                    Services.ScrollText("It's not very effective.", 500);
                    Item   = null;
                    Target = null;
                    Timer();
                    RedSquareEnterance();
                }
                else
                {
                    RedSquareEnterance();
                }
            }
        }
コード例 #8
0
ファイル: Unit.cs プロジェクト: KevinJThomas/TextGame
 public void AddAxe()
 {
     if (Type == 1 && Attack == 4)
     {
         Attack = 6;
     }
     else
     {
         Services.ScrollText("ERROR: Attempting to add axe to non infantry is prohibited.");
     }
 }
コード例 #9
0
ファイル: Riddles.cs プロジェクト: KevinJThomas/TextGame
        public void Password(int num)
        {
            string answer;

            switch (num)
            {
            case 1:
                answer = Console.ReadLine();
                if (answer.ToLower().Contains("king of hearts"))
                {
                    trusted = true;
                    Services.ScrollText("Very good! I'm impressed.", 750);
                    Services.ScrollText("*The old man yells something in Latin*", 500);
                    Services.ScrollText("All of the men knod their heads in unison before returning to what they were doing.", 1000);
                    TheCircularRoom();
                }
                else if (answer.ToLower() == "exit")
                {
                    TheCircularRoom();
                }
                else
                {
                    Services.ScrollText("No no.. that's not right. Try again.");
                    Services.ScrollText("(Or type 'exit' to stop guessing)");
                    Console.WriteLine();
                    Password(num);
                }
                break;

            case 2:
                Guessing(num, "11");
                break;

            case 3:
                Guessing(num, "dictionary");
                break;

            case 4:
                Guessing(num, "braking");
                break;

            case 5:
                Guessing(num, "hole");
                break;

            case 6:
                Guessing(num, "eye");
                break;

            case 7:
                Guessing(num, "tomorrow");
                break;
            }
        }
コード例 #10
0
ファイル: Unit.cs プロジェクト: KevinJThomas/TextGame
 public void AddSword()
 {
     if (Type == 1)
     {
         Attack = 4;
     }
     else
     {
         Services.ScrollText("ERROR: Attempting to add sword to non infantry is prohibited.");
     }
 }
コード例 #11
0
 //Advances the user to the next level
 public void Advance()
 {
     player.LevelCompleted = false;
     CurrentLevel++;
     player.Bag.Empty();
     Console.WriteLine();
     Services.ScrollText("Congratulations! You successfully completed the level.", 750);
     Services.ScrollText("Advancing to level " + CurrentLevel + ". . .", 3500);
     Console.Clear();
     StartLevel();
 }
コード例 #12
0
ファイル: Unit.cs プロジェクト: KevinJThomas/TextGame
 public void AddCrossbow()
 {
     if (Type == 2)
     {
         Attack = 7;
     }
     else
     {
         Services.ScrollText("ERROR: Attempting to add crossbow to non archer is prohibited.");
     }
 }
コード例 #13
0
ファイル: Unit.cs プロジェクト: KevinJThomas/TextGame
 public void AddJavelin()
 {
     if (Type == 3)
     {
         Attack = 6;
     }
     else
     {
         Services.ScrollText("ERROR: Attempting to add javelin to non cavalier is prohibited.");
     }
 }
コード例 #14
0
ファイル: Bomb.cs プロジェクト: KevinJThomas/TextGame
 public void Start()
 {
     Services.ScrollText("There is a bomb about to off in the middle of Manhattan", 1000);
     Services.ScrollText("You have beeing training in the bomb squad but have never dealt with a real threat on your own.", 1000);
     Services.ScrollText("Your mentor is out of town; this is your chance to shine.", 1000);
     Services.ScrollText("Now as long as you remember all your training, nothing will go wrong..", 1500);
     Services.ScrollText("You enter the bank where the bomb is located and are escorted over to it.", 1000);
     Services.ScrollText("Everything you've learned in training is spiraling around your brain..", 1000);
     Services.ScrollText("All you can remember is: ");
     PrintRules();
     DisableBomb();
 }
コード例 #15
0
ファイル: Scenario.cs プロジェクト: KevinJThomas/TextGame
        public void EnterObject(string[] options, string desc, string[] targets)
        {
            Description = desc;
            Targets     = targets;
            Services.ScrollText("What would you like to do?\n");

            foreach (string option in options)
            {
                Services.ScrollText((Array.IndexOf(options, option) + 1) + ") " + option);
            }
            Console.WriteLine();
        }
コード例 #16
0
        public void Receptionist()
        {
            Console.WriteLine();
            foreach (string option in receptionist)
            {
                Services.ScrollText((Array.IndexOf(receptionist, option) + 1) + " - " + option);
            }

            int    input;
            string decision = Console.ReadLine();

            Console.WriteLine();

            if (Int32.TryParse(decision, out input))
            {
                switch (input)
                {
                case 1:
                    Services.ScrollText("\"" + receptionist[input - 1] + "\"\n", 1000);
                    Services.ScrollText("I believe the speech will be starting in about " + _timer / 10 + " minutes.", 1000);
                    Receptionist();
                    break;

                case 2:
                    Services.ScrollText("\"" + receptionist[input - 1] + "\"\n", 1000);
                    Services.ScrollText("Yes it is! We were able to give him our best suite down in the basement level!", 1000);
                    Receptionist();
                    break;

                case 3:
                    Services.ScrollText("\"" + receptionist[input - 1] + "\"\n", 1000);
                    Services.ScrollText("No I'm sorry. We're all booked up for the night.", 1000);
                    Receptionist();
                    break;

                case 4:
                    Services.ScrollText("\"" + receptionist[input - 1] + "\"\n", 1000);
                    Services.ScrollText("Bye!");
                    Hotel();
                    break;

                default:
                    Console.WriteLine("Invalid input. Please try again.");
                    Receptionist();
                    break;
                }
            }
            else
            {
                ExamineCommand(decision);
                Receptionist();
            }
        }
コード例 #17
0
ファイル: Riddles.cs プロジェクト: KevinJThomas/TextGame
        public void Start()
        {
            Services.ScrollText("You are in the middle of a large, perfectly circular room.", 1000);
            Services.ScrollText("You are standing on an aged marble floor, and there is no ceiling above you; it is only sky.", 500);
            Services.ScrollText("Looking around, you see 2 large wooden doors as your only way out.", 500);
            Services.ScrollText("There is an old man with a long white beard sitting on a decorated chair in front of the doors.", 500);
            Services.ScrollText("There are 6 benches around the circle, and there is an old man sitting on each one of these as well.", 500);
            Services.ScrollText("These men look similar to the first man you saw, except their beards aren't quite as long.", 500);
            Services.ScrollText("Hmm.. What is going on?!", 500);

            TheCircularRoom();
        }
コード例 #18
0
        public void ScanCrowd()
        {
            switch (_state)
            {
            case 1:
                Services.ScrollText("You scan around you, but you see nothing of interest.", 500);
                break;

            case 2:
                Services.ScrollText("Everyone is paying attention to the stage. The diversion worked!", 500);
                break;
            }
        }
コード例 #19
0
        public void Start()
        {
            Services.ScrollText("You are a Russian KGB operative.", 1200);
            Services.ScrollText("There has been a small uprising against the government in Moscow that has a chance of gaining some traction.", 1200);
            Services.ScrollText("The uprising is being lead by a very vocal individual: Bodrov Ilyich", 1200);
            Services.ScrollText("He must be silenced before too much damage is done. This your mission.", 1200);
            Services.ScrollText("He is scheduled to be speaking in the Red Square in 5 minutes.", 1200);
            Services.ScrollText("You are arriving to the square now; there isn't much time to eliminate the target.", 1200);
            Services.ScrollText("In your bag you are carrying a handgun, knife, and 3 feet of twine.", 1200);
            Services.ScrollText("Find and kill Bodrov Ilyich. Your life depends on it.", 3500);

            RedSquareEnterance();
        }
コード例 #20
0
        public void Guard()
        {
            Console.WriteLine();
            foreach (string option in guard)
            {
                Services.ScrollText((Array.IndexOf(guard, option) + 1) + " - " + option);
            }

            int    input;
            string decision = Console.ReadLine();

            Console.WriteLine();

            if (Int32.TryParse(decision, out input))
            {
                switch (input)
                {
                case 1:
                    Services.ScrollText("\"" + guard[input - 1] + "\"\n", 1000);
                    Services.ScrollText("Code red! Code red!", 1000);
                    Services.ScrollText(". . .", 250);
                    Services.ScrollText("Within seconds you're surrounded and outnumbered. It's hard to complete your mission from a prison cell.", 1000);
                    Services.ScrollText("Game Over", 1000);
                    Services.PlayAgain();
                    break;

                case 2:
                    Services.ScrollText("\"" + guard[input - 1] + "\"\n", 1000);
                    Services.ScrollText("Oh. Well, umm... fine. Make it fast.", 1000);
                    _talkToGuard = true;
                    StageBack();
                    break;

                case 3:
                    Services.ScrollText("\"" + guard[input - 1] + "\"\n", 1000);
                    Services.ScrollText("Yeah, scram.", 1000);
                    Stage();
                    break;

                default:
                    Console.WriteLine("Invalid input. Please try again.");
                    Guard();
                    break;
                }
            }
            else
            {
                ExamineCommand(decision);
                Guard();
            }
        }
コード例 #21
0
        public void Start()
        {
            string introText1 = "You awaken lying on the floor of an unfamiliar room. Smoke billows all around\nyou and alarms can be heard blaring nearby.";
            string introText2 = "You stand up...";
            string introText3 = "You quickly take in your surroundings. The only entrance to the room is a single metal door. Within the room there is a desk, a chair, a lamp, and a rug on the floor.";


            Services.ScrollText(introText1, 2000);
            Console.WriteLine("\n");
            Services.ScrollText(introText2, 2000);
            Console.WriteLine("\n");
            Services.ScrollText(introText3, 2000);
            RoomOne();
        }
コード例 #22
0
ファイル: Bomb.cs プロジェクト: KevinJThomas/TextGame
 public bool CheckAnswer(string answer, string wire)
 {
     if (answer == wire)
     {
         Services.ScrollText("Nothing blew up! That must've been right!");
         return(true);
     }
     else
     {
         Services.ScrollText("BOOOOOOM");
         Services.ScrollText("That wasn't the right wire.. you blew up the town!");
         return(false);
     }
 }
コード例 #23
0
ファイル: Bomb.cs プロジェクト: KevinJThomas/TextGame
        public bool WireThree()
        {
            Services.ScrollText("Enter the wire you would like to cut, starting with the length (ex: 'tiny purple')");
            string answer = Console.ReadLine();

            if (CheckAnswer(answer, "long red"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #24
0
ファイル: Bag.cs プロジェクト: KevinJThomas/TextGame
        public void PrintBag()
        {
            if (items.Count > 0)
            {
                Services.ScrollText("Your bag contains:");

                foreach (Item item in items)
                {
                    Services.ScrollText(items.IndexOf(item) + 1 + ") " + item.Name);
                }
            }
            else
            {
                Services.ScrollText("Your bag is empty");
            }
        }
コード例 #25
0
ファイル: Unit.cs プロジェクト: KevinJThomas/TextGame
 public void AddLeatherArmor()
 {
     if (Type == 2)
     {
         if (_hasArmor)
         {
             Health   += 3;
             _hasArmor = true;
         }
         else
         {
             Services.ScrollText("That unit already has armor!");
         }
     }
     else
     {
         Services.ScrollText("ERROR: Attempting to add armor to non archer is prohibited.");
     }
 }
コード例 #26
0
ファイル: Unit.cs プロジェクト: KevinJThomas/TextGame
 public void AddShield()
 {
     if (Type == 1 || Type == 3)
     {
         if (!_hasShield)
         {
             Health    += 4;
             _hasShield = true;
         }
         else
         {
             Services.ScrollText("That unit already has a shield!");
         }
     }
     else
     {
         Services.ScrollText("ERROR: Attempting to add shield to non infantry/cavalier is prohibited.");
     }
 }
コード例 #27
0
ファイル: Riddles.cs プロジェクト: KevinJThomas/TextGame
        public void Guessing(int num, string pass)
        {
            string answer = Console.ReadLine();

            if (answer.ToLower().Contains(pass))
            {
                Services.ScrollText("You have passed my test. The answer was '" + pass + "'.", 750);
                TheCircularRoom();
            }
            else if (answer.ToLower() == "exit")
            {
                TheCircularRoom();
            }
            else
            {
                Services.ScrollText("Wrong. Keep guessing.");
                Services.ScrollText("(Or type 'exit' to stop guessing)");
                Console.WriteLine();
                Password(num);
            }
        }
コード例 #28
0
 public void Winner()
 {
     Services.ScrollText("You win!");
     Services.PlayAgain();
 }
コード例 #29
0
        public void DeskChoices()
        {
            string text3 = "There is a number of the paper. 1738993";
            string text4 = "The drawer is empty.";
            string text9 = "\nYou step away from the desk";

            if (papertaken == true)
            {
                desk1 = new string[] { "Open drawer", "Nothing" };
            }

            Console.WriteLine("\n");
            EnterObject(desk1, "A desk with a single drawer.", desktargets);

            string deskChoice = Console.ReadLine();
            int    deskDecision;

            if (Int32.TryParse(deskChoice, out deskDecision))
            {
                switch (deskDecision)
                {
                case 1:
                    if (papertaken == false)
                    {
                        Services.ScrollText(text3, 2000);
                        Services.ScrollText("Take the paper? Yes or no.");
                        string takePaper = Console.ReadLine().ToUpper();
                        if (takePaper == "YES" || takePaper == "Y")
                        {
                            _player.Add(deskPaper);
                            Services.ScrollText("Paper has been added to your bag.");
                            papertaken = true;
                        }
                    }
                    else
                    {
                        Services.ScrollText(text4, 2000);
                        DeskChoices();
                    }


                    DeskChoices();
                    break;

                case 2:
                    if (papertaken == false)
                    {
                        Services.ScrollText(text4, 2000);
                        DeskChoices();
                    }
                    else
                    {
                        Services.ScrollText(text9, 2000);
                        RoomOne();
                    }
                    break;

                case 3:
                    if (papertaken == false)
                    {
                        Services.ScrollText(text9, 2000);
                        RoomOne();
                    }
                    else
                    {
                        Console.WriteLine("Invalid input. Please try again.");
                    }
                    break;

                default:
                    DeskChoices();
                    break;
                }
            }
        }
コード例 #30
0
        public void RoomOne()
        {
            Location = "Room One";
            EnterArea(room1, "A small room with some furniture in it.", roomonetargets);

            string text1  = "You grab the door handle, but it is too hot. You burn yourself.";
            string text2  = "\nUpon closer examination you see that the desk has a drawer.";
            string text5  = "It's a simple chair made of wood. One of the legs is damaged.";
            string text6  = "Try to break off the leg?\n Yes or No.";
            string text7  = "You stomp on the leg of the chair and break it off.";
            string text8  = "Chair Leg has been added to your bag.";
            string text10 = "There is a paper on the top of the desk.";
            int    decisionOne;
            string roomOne = Console.ReadLine();

            if (Int32.TryParse(roomOne, out decisionOne))
            {
                switch (decisionOne)
                {
                case 1:
                    Console.WriteLine("\n");
                    Services.ScrollText(text1, 2000);
                    RoomOne();
                    break;

                case 2:
                    Services.ScrollText(text2, 2000);
                    if (papertaken == false)
                    {
                        Services.ScrollText(text10, 2000);
                    }

                    DeskChoices();
                    break;

                case 3:
                    if (chairLegpickup == false)
                    {
                        Services.ScrollText(text5, 2000);
                        Services.ScrollText(text6);
                        string chairLeg = Console.ReadLine().ToUpper();
                        if (chairLeg == "YES" || chairLeg == "Y")
                        {
                            Services.ScrollText(text7, 2000);
                            Services.ScrollText(text8, 2000);
                            _player.Add(theChairLeg);
                            chairLegpickup = true;
                        }
                    }
                    else
                    {
                        Services.ScrollText("It's a simple wooden chair. One of the legs has been broken off.");
                    }

                    RoomOne();
                    break;

                case 4:
                    Console.WriteLine("The lamp is screwed to the wall. There isn't much you can do with it.");
                    RoomOne();
                    break;

                case 5:
                    if (rugPickedUp == false)
                    {
                        Services.ScrollText("It's a rug. Would you like to pick it up? Yes or No");
                        string floorRug = Console.ReadLine().ToUpper();
                        if (floorRug == "YES" || floorRug == "Y")
                        {
                            Services.ScrollText("The rug has been added to your bag", 2000);
                            _player.Add(rug);
                            rugPickedUp = true;
                            room1       = new string[] { "Open door", "Examine desk", "Examine chair", "Examine lamp" };
                        }
                    }
                    else
                    {
                        Console.WriteLine("Invalid input. Please try again.");
                    }
                    RoomOne();
                    break;

                default:
                    Console.WriteLine("Invalid input. Please try again.");
                    RoomOne();
                    break;
                }
            }


            else
            {
                ExamineCommand(roomOne);
                if (Item != null && Target != null)
                {
                    if (Item.Name == "rug")
                    {
                        if (Target == "door")
                        {
                            Services.ScrollText("You use the rug to shield your hand from the heat as you open the door.");
                            Services.ScrollText("You step through the door into the next room.");
                            RoomTwo();
                        }
                        else if (Target == "lamp")
                        {
                            Services.ScrollText("You shouldn't do that. You're trying to escape, not start more fires.");
                            RoomOne();
                        }
                        else
                        {
                            Services.ScrollText("It's not very effective.", 500);
                            RoomOne();
                        }
                    }
                    else
                    {
                        Services.ScrollText("It's not very effective.", 500);
                        RoomOne();
                    }
                    Item   = null;
                    Target = null;
                }
                else
                {
                    RoomOne();
                }
            }
        }