Exemplo n.º 1
0
        public static void CreateZombieAdvCharacter(Player player, GameRoom room)
        {
            //Sentinel to control loop
            bool   characterLoop = false;
            string input;

            Console.WriteLine(StandardMessages.CreateCharacterDirections());
            Console.ReadLine();
            Console.Clear();
            do
            {
                //Character creation menu

                Console.WriteLine(StandardMessages.DisplayCreateCharacterMenu());
                input = Console.ReadLine();
                switch (input)
                {
                case "1":
                    //Creat name and password
                    CreateNameAndPassword(player, characterLoop);
                    break;

                case "2":
                    //Select player class
                    SelectPlayerClass(player, input, characterLoop);
                    break;

                case "3":
                    //Select player race
                    SelectPlayerRace(player, input, characterLoop);
                    break;

                case "4":
                    //Display created player information
                    Console.WriteLine($"Name: {player.Name}\nPassword: {player.Password}\nCLass: {player.ClassType}\nRace: {player.Race}");
                    Console.ReadLine();

                    break;

                case "5":
                    //Test to ensure player completes character creation
                    if (player.Name == "" || player.Password == "" || player.ClassType == "" || player.Race == "")
                    {
                        Console.WriteLine("You must complete all tasks to proceed!");
                        Console.ReadLine();
                    }
                    else
                    {
                        characterLoop = true;
                        PlayerMovement.CharacterMovement(player, room);
                    }
                    break;

                default:
                    Console.WriteLine(StandardMessages.InvalidSelection());
                    break;
                }
                Console.Clear();
            } while (characterLoop == false);
        }
Exemplo n.º 2
0
        public static void CreateZombieHunterPlayer(Character player)
        {
            string input = "";
            //Sentinel to control loop
            bool charLoop = false;
            //Create keyboard object
            ConsoleKeyInfo keyboard = new ConsoleKeyInfo();

            //Clear current screen
            Console.Clear();
            //Show player creation instructions
            Console.WriteLine(StandardMessages.CreateCharacterDirections());
            Console.ReadLine();
            Console.Clear();
            do
            {
                //Character creation menu
                Console.Write(StandardMessages.DisplayCreateCharacterMenu());
                keyboard = Console.ReadKey();
                switch (keyboard.Key)
                {
                case ConsoleKey.D1:
                case ConsoleKey.NumPad1:
                    //Creat name and password
                    CreateNameAndPassword(player);
                    break;

                case ConsoleKey.D2:
                case ConsoleKey.NumPad2:
                    //Select player class
                    SelectPlayerClass(player, charLoop, keyboard);
                    break;

                case ConsoleKey.D3:
                case ConsoleKey.NumPad3:
                    //Select player race
                    SelectPlayerRace(player, charLoop, keyboard);
                    break;

                case ConsoleKey.D4:
                case ConsoleKey.NumPad4:
                    //Display created player information
                    DisplayPlayerInformation(player);

                    break;

                case ConsoleKey.D5:
                case ConsoleKey.NumPad5:
                    //Test to ensure player completes character creation
                    if (player.Name == "" || player.PlayerPassword == "" || player.PlayerClass == "" || player.PlayerRace == "")
                    {
                        Console.WriteLine("\nYou must complete all tasks to proceed!");
                        Console.ReadLine();
                    }
                    else
                    {
                        charLoop = true;
                        Console.Clear();
                    }
                    break;

                case ConsoleKey.Escape:
                    charLoop = true;
                    break;

                default:
                    Console.WriteLine(StandardMessages.DisplayInvalidOption());
                    Console.ReadLine();
                    break;
                }
                Console.Clear();
            } while (charLoop == false);
        }