コード例 #1
0
        public static void BookFinalChoice()
        {
            Console.ForegroundColor = ConsoleColor.White;
            string input         = Console.ReadLine();
            string playerCommand = input.ToUpper();

            Console.ForegroundColor = ConsoleColor.Blue;
            if (playerCommand == "YES" || playerCommand == "Y")
            {
                TypeLine("\nThere is a flash of light.\n");
                System.Threading.Thread.Sleep(500);
                TypeLine("When you open your eyes, everything around you is dark.\n");
                System.Threading.Thread.Sleep(500);
                TypeLine("Before you, you see the ");
                MenuText.ChangeTextColor("STRANGE MAN", ConsoleColor.Cyan);
                TypeLine(" standing in the tower you were trapped in. \n");
                System.Threading.Thread.Sleep(500);
                TypeLine("He continues to laugh, silently, as he picks up a ");
                MenuText.ChangeTextColor("STONE", ConsoleColor.Red);
                TypeLine(" and throws it at you. \n");
                System.Threading.Thread.Sleep(500);
                TypeLine("Your view shatters, and everything goes black.\n");
                MenuText.GameOver();
                Player.IsPlaying = false;
            }
            else if (playerCommand == "NO" || playerCommand == "N")
            {
                TypeLine("\nYou put the ");
                MenuText.ChangeTextColor("MAGIC BOOK", ConsoleColor.Red);
                TypeLine(" back into your pocket and step away from the ");
                MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red);
                TypeLine(". \n");
            }
            else
            {
                Console.WriteLine($"\"{playerCommand}\" is not a proper command. Please type YES or NO.");
                BookFinalChoice();
            }
        }