public static string Travel(Adventurer gameDungeon, List <DungeonLocation> dungeonLocations)
        {
            string messageBoxText =
                $"{gameDungeon.Name}, Aion Base will need to know the name of the new location.\n" +
                " \n" +
                "Enter the ID number of your desired location from the table below.\n" +
                " \n" +

                //
                // display table header
                //
                "ID".PadRight(10) + "Name".PadRight(30) + "Accessible".PadRight(10) + "\n" +
                "---".PadRight(10) + "----------------------".PadRight(30) + "-------".PadRight(10) + "\n";

            //
            // display all locations except the current location
            //
            string dungeonLocationList = null;

            foreach (DungeonLocation dungeonLocation in dungeonLocations)
            {
                if (dungeonLocation.DungeonLocationID != gameDungeon.DungeonLocationID)
                {
                    dungeonLocationList +=
                        $"{dungeonLocation.DungeonLocationID}".PadRight(10) +
                        $"{dungeonLocation.CommonName}".PadRight(30) +
                        $"{dungeonLocation.Accessable}".PadRight(10) +
                        Environment.NewLine;
                }
            }

            messageBoxText += dungeonLocationList;

            return(messageBoxText);
        }
Example #2
0
        public Adventurer DisplayEditAdventurerInfo(Adventurer adventurer)
        {
            string updateAdventurer = "";

            // Update Name
            DisplayGamePlayScreen("Edit Adventurer Information - Name", Text.AdventurerEditInfo(_gameAdventurer), ActionMenu.AdminMenu, "");
            DisplayInputBoxPrompt("Enter name: ");
            updateAdventurer = Regex.Replace(GetString(), @"(^\w)|(\s\w)", m => m.Value.ToUpper());
            if (updateAdventurer != "")
            {
                adventurer.Name = updateAdventurer;
            }

            // Update Age
            DisplayGamePlayScreen("Edit Adventurer Information - Age", Text.AdventurerEditInfo(_gameAdventurer), ActionMenu.AdminMenu, "");
            DisplayInputBoxPrompt("Enter Age: ");
            int adventurerAge;

            GetInteger($"Enter your age {adventurer.Name}: ", 0, 1000000, out adventurerAge);
            adventurer.Age = adventurerAge;

            // Update Class
            DisplayGamePlayScreen("Edit Adventurer Information - Class", Text.InitializeQuestGetAdventurerClass(adventurer), ActionMenu.AdminMenu, "");
            DisplayInputBoxPrompt($"Enter your class {adventurer.Name}: ");

            adventurer.Class = GetClass();

            // Display new info
            DisplayGamePlayScreen("Adventurer Information", Text.AdventurerInfo(adventurer), ActionMenu.AdminMenu, "");

            return(adventurer);
        }
Example #3
0
        /// <summary>
        /// default constructor to create the console view objects
        /// </summary>
        public ConsoleView(Adventurer gameTraveler, Dungeon gameUniverse)
        {
            _gameAdventurer = gameTraveler;
            _gameDungeon    = gameUniverse;

            _viewStatus = ViewStatus.TravelerInitialization;

            InitializeDisplay();
        }
        public static List <string> StatusBox(Adventurer adventurer)
        {
            List <string> statusBoxText = new List <string>();

            statusBoxText.Add($"Experience Points: {adventurer.ExperiencePoints}\n");
            statusBoxText.Add($"Health: {adventurer.Health}\n");
            statusBoxText.Add($"Lives: {adventurer.Lives}\n");

            return(statusBoxText);
        }
        public static string InitializeMissionGetAdventurerHealthPotions(Adventurer gameAdventurer)
        {
            string messageBoxText =
                $"{gameAdventurer.Name}, you will be given 3 Health Potions to start you adventure.\n" +
                " \n" +
                "Use the carefully, as they are sparse in a dungeon." +
                " \n";

            return(messageBoxText);
        }
        public static string InitializeMissionGetAdventurerIQ(Adventurer gameAdventurer)
        {
            string messgaeBoxText =
                $"{gameAdventurer.Name}, you will now be given a random IQ.\n" +
                " \n" +
                "Please press enter to get your IQ.\n" +
                " \n";

            return(messgaeBoxText);
        }
        public static string AdventurerInfo(Adventurer gameAdventurer)
        {
            string messageBoxText =
                $"\tAdventurer Name: {gameAdventurer.Name}\n" +
                $"\tAdventurer Age: {gameAdventurer.Age}\n" +
                $"\tAdventurer Class: {gameAdventurer.Class}\n" +
                $"\tAdventurer IQ: {gameAdventurer.IQ}\n" +
                $"\tAdventurer Health Potions: {gameAdventurer.HealthPotions}\n" +
                " \n";

            return(messageBoxText);
        }
        public static string AdventurerEditInfo(Adventurer gameAdventurer)
        {
            string messageBoxText =
                "If you would like to edit your adventurer, you can do it here.\n" +
                " \n" +
                "Your current Adventurers Name and Age appear below:\n" +
                $"\tAdventurer Name: {gameAdventurer.Name}\n" +
                $"\tAdventurer Age: {gameAdventurer.Age}\n" +
                $"\tAdventurer Class: {gameAdventurer.Class}\n" +
                " \n" +
                "Please enter a new name, age, and class." +
                " \n";

            return(messageBoxText);
        }
        /// <summary>
        /// initialize the player info
        /// </summary>
        private void InitializeMission()
        {
            Adventurer adventurer = _gameConsoleView.GetInitialAdventurerInfo();

            _gameAdventurer.Name              = adventurer.Name;
            _gameAdventurer.Age               = adventurer.Age;
            _gameAdventurer.Class             = adventurer.Class;
            _gameAdventurer.IQ                = adventurer.IQ;
            _gameAdventurer.HealthPotions     = adventurer.HealthPotions;
            _gameAdventurer.DungeonLocationID = 1;

            _gameAdventurer.ExperiencePoints = 0;
            _gameAdventurer.Health           = 100;
            _gameAdventurer.Lives            = 3;
        }
        /// <summary>
        /// initialize the major game objects
        /// </summary>
        private void InitializeGame()
        {
            _gameAdventurer  = new Adventurer();
            _gameDungeon     = new Dungeon();
            _gameConsoleView = new ConsoleView(_gameAdventurer, _gameDungeon);
            _playingGame     = true;
            _gameSound       = new Sound();
            //_gameDungeonObjects = new GameObject();

            //
            // add initial items to the adventurer's inventory
            //
            _gameAdventurer.Inventory.Add(_gameDungeon.GetGameObjectById(5) as AdventurerObject);
            _gameAdventurer.Inventory.Add(_gameDungeon.GetGameObjectById(6) as AdventurerObject);

            Console.CursorVisible = false;
        }
        public static string InitializeQuestEchoAdventurerInfo(Adventurer gameAdventurer)
        {
            string messageBoxText =
                $"Very good then {gameAdventurer.Name}.\n" +
                " \n" +
                "It appears we have all the necessary data to begin your quest. You will find it" +
                " listed below.\n" +
                " \n" +
                $"\tAdventurer Name: {gameAdventurer.Name}\n" +
                $"\tAdventurer Age: {gameAdventurer.Age}\n" +
                $"\tAdventurer Class: {gameAdventurer.Class}\n" +
                $"\tAdventurer IQ: {gameAdventurer.IQ}\n" +
                $"\tAdventurer Health Potions: {gameAdventurer.HealthPotions}\n" +
                " \n" +
                "Press any key to begin your quest.";

            return(messageBoxText);
        }
        public static string InitializeQuestGetAdventurerClass(Adventurer gameTraveler)
        {
            string messageBoxText =
                $"{gameTraveler.Name}, it will be important for us to know your class on this quest.\n" +
                " \n" +
                "Enter your class below.\n" +
                " \n" +
                "Please use the class specifications below." +
                " \n";

            string classList = null;

            foreach (Character.ClassType @class in Enum.GetValues(typeof(Character.ClassType)))
            {
                if (@class != Character.ClassType.None)
                {
                    classList += $"\t{@class}\n";
                }
            }

            messageBoxText += classList;

            return(messageBoxText);
        }
Example #13
0
        /// <summary>
        /// get the player's initial information at the beginning of the game
        /// </summary>
        /// <returns>adventurer object with all properties updated</returns>
        public Adventurer GetInitialAdventurerInfo()
        {
            Adventurer adventurer = new Adventurer();

            //
            // intro
            //
            DisplayGamePlayScreen("Quest Initialization", Text.InitializeQuestIntro(), ActionMenu.QuestIntro, "");
            GetContinueKey();

            //
            // get adventurer's name
            //
            DisplayGamePlayScreen("Quest Initialization - Name", Text.InitializeQuestGetAdventurerName(), ActionMenu.QuestIntro, "");
            DisplayInputBoxPrompt("Enter your name: ");
            adventurer.Name = Regex.Replace(GetString(), @"(^\w)|(\s\w)", m => m.Value.ToUpper());

            //
            // get adventurer's age
            //
            DisplayGamePlayScreen("Quest Initialization - Age", Text.InitializeQuestGetAdventurerAge(adventurer.Name), ActionMenu.QuestIntro, "");
            int gameTravelerAge;

            GetInteger($"Enter your age {adventurer.Name}: ", 0, 1000000, out gameTravelerAge);
            adventurer.Age = gameTravelerAge;

            //
            // get adventurer's race
            //
            DisplayGamePlayScreen("Quest Initialization - Class", Text.InitializeQuestGetAdventurerClass(adventurer), ActionMenu.QuestIntro, "");
            DisplayInputBoxPrompt($"Enter your class {adventurer.Name}: ");
            adventurer.Class = GetClass();

            //
            // get adventurer's IQ
            //
            DisplayGamePlayScreen("Quest Beginnings - IQ", Text.InitializeMissionGetAdventurerIQ(adventurer), ActionMenu.QuestIntro, "");
            DisplayInputBoxPrompt($"Press ENTER to continue.");
            GetContinueKey();
            adventurer.IQ = GetIQ();

            //
            // get adventurer's health potions
            //
            DisplayGamePlayScreen("Quest Beginnings - Health Potions", Text.InitializeMissionGetAdventurerHealthPotions(adventurer), ActionMenu.QuestIntro, "");
            DisplayInputBoxPrompt($"Press ENTER to continue.");
            GetContinueKey();
            adventurer.HealthPotions = 3;

            //
            // echo the adventurer's info
            //
            DisplayGamePlayScreen("Quest Initialization - Complete", Text.InitializeQuestEchoAdventurerInfo(adventurer), ActionMenu.QuestIntro, "");
            GetContinueKey();

            //
            // change view status to playing game
            //
            _viewStatus = ViewStatus.PlayingGame;

            return(adventurer);
        }