public static string TravelerInfo(Traveler gameTraveler) { string messageBoxText = $"\tTraveler Name: {gameTraveler.Name}\n" + $"\tTraveler Age: {gameTraveler.Age}\n" + $"\tTraveler Race: {gameTraveler.Race}\n" + $"\tTraveler Home Planet: {gameTraveler.HomePlanet}\n" + $"\tTraveler Home Planet: {gameTraveler.travelerCompanionName}\n" + $"\tTraveler Greeting: {gameTraveler.Greeting()}\n" + " \n"; return(messageBoxText); }
/// <summary> /// initialize the player info /// </summary> private void InitializeMission() { Traveler traveler = _gameConsoleView.GetInitialTravelerInfo(); _gameTraveler.Name = traveler.Name; _gameTraveler.Age = traveler.Age; _gameTraveler.Race = traveler.Race; _gameTraveler.SpaceTimeLocationID = 1; _gameTraveler.ExperiencePoints = 0; _gameTraveler.Health = 100; _gameTraveler.Lives = 3; }
public static string TravelerInfo(Traveler gameTraveler) { string messageBoxText = $"\tTraveler Name: {gameTraveler.Name}\n" + $"\tTraveler Age: {gameTraveler.Age}\n" + $"\tTraveler Alive: {gameTraveler.Alive}\n" + $"\tTraveler Race: {gameTraveler.Race}\n" + $"\tTraveler Home Planet: {gameTraveler.HomePlanet}\n" + $"\tTraveler Greeting: {gameTraveler.Greeting()}\n" + $"\tCharacter Class: {gameTraveler.DefineClass()}\n" + " \n"; return(messageBoxText); }
public static string TravelerInfo(Traveler gameTraveler) { string messageBoxText = $"\tTraveler Name: {gameTraveler.Name}\n" + $"\tTraveler Age: {gameTraveler.Age}\n" + $"\tTraveler Race: {gameTraveler.Race}\n" + $"\tTraveler Home Planet: {gameTraveler.HomePlanet}\n" + $"\tTraveler Weapon of Choice: {gameTraveler.WeaponOfChoice}\n" + $"\tTraveler Greeting: {gameTraveler.Greeting()}\n" + $"\tTraveler is experienced:{gameTraveler.IsExperienced}\n" + " \n"; return(messageBoxText); }
/// <summary> /// initialize the major game objects /// </summary> private void InitializeGame() { _gameTraveler = new Traveler(); _gameUniverse = new Universe(); _gameConsoleView = new ConsoleView(_gameTraveler, _gameUniverse); _playingGame = true; // // add initial items to the traveler's inventory // _gameTraveler.Inventory.Add(_gameUniverse.GetGameObjectById(8) as TravelerObject); _gameTraveler.Inventory.Add(_gameUniverse.GetGameObjectById(9) as TravelerObject); Console.CursorVisible = false; }
/// <summary> /// initialize the player info /// </summary> private void InitializeMission() { //Traveler traveler = _gameConsoleView.GetInitialTravelerInfo(); Traveler traveler = new Traveler() { Name = "Big The Cat", Age = 73, Race = Character.RaceType.Human }; _gameTraveler.Name = traveler.Name; _gameTraveler.Age = traveler.Age; _gameTraveler.Race = traveler.Race; _gameTraveler.SpaceTimeLocationID = 1; }
public static string InitializeMissionEchoTravelerInfo(Traveler gameTraveler) { string messageBoxText = $"Very good then {gameTraveler.Name}.\n" + " \n" + "It appears we have all the necessary data to begin your mission. You will find it" + " listed below.\n" + " \n" + $"\tTraveler Name: {gameTraveler.Name}\n" + $"\tTraveler Age: {gameTraveler.Age}\n" + $"\tTraveler Race: {gameTraveler.Race}\n" + " \n" + "Press any key to begin your mission."; return(messageBoxText); }
/// <summary> /// get the player's initial information at the beginning of the game /// </summary> /// <returns>traveler object with all properties updated</returns> public Traveler GetInitialTravelerInfo() { Traveler traveler = new Traveler(); // // intro // DisplayGamePlayScreen("Mission Initialization", Text.InitializeMissionIntro(), ActionMenu.MissionIntro, ""); GetContinueKey(); // // get traveler's name // DisplayGamePlayScreen("Mission Initialization - Name", Text.InitializeMissionGetTravelerName(), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt("Enter your name: "); traveler.Name = GetString(); // // get traveler's age // DisplayGamePlayScreen("Mission Initialization - Age", Text.InitializeMissionGetTravelerAge(traveler.Name), ActionMenu.MissionIntro, ""); int gameTravelerAge; GetInteger($"Enter your age {traveler.Name}: ", 0, 1000000, out gameTravelerAge); traveler.Age = gameTravelerAge; // // get traveler's race // DisplayGamePlayScreen("Mission Initialization - Race", Text.InitializeMissionGetTravelerRace(traveler), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt($"Enter your race {traveler.Name}: "); traveler.Race = GetRace(); // // echo the traveler's info // DisplayGamePlayScreen("Mission Initialization - Complete", Text.InitializeMissionEchoTravelerInfo(traveler), ActionMenu.MissionIntro, ""); GetContinueKey(); // // change view status to playing game // _viewStatus = ViewStatus.PlayingGame; return(traveler); }
public static string InitializeMissionEchoTravelerInfo(Traveler gameTraveler) { string messageBoxText = $"Very good then {gameTraveler.Name}.\n" + " \n" + "It appears we have all the necessary data to begin your mission. You will find it" + " listed below.\n" + " \n" + $"\tTraveler Name: {gameTraveler.Name}\n" + $"\tTraveler Age: {gameTraveler.Age}\n" + $"\tTraveler Race: {gameTraveler.Race}\n" + $"\tTraveler Home Planet: {gameTraveler.HomePlanet}\n" + $"\tTraveler Weapon of Chocie: {gameTraveler.WeaponOfChoice}\n" + $"\tTraveler is experienced:{gameTraveler.IsExperienced}\n" + " \n" + "Press any key to begin your mission."; return(messageBoxText); }
/// <summary> /// determine if a location is accessible to the player /// </summary> /// <param name="spaceTimeLocationId"></param> /// <returns>accessible</returns> public bool IsAccessibleLocation(int spaceTimeLocationId, Traveler gameTraveler) { SpaceTimeLocation spaceTimeLocation = GetSpaceTimeLocationById(spaceTimeLocationId); SpaceTimeLocation currentLocation = GetSpaceTimeLocationById(gameTraveler.SpaceTimeLocationID); if (spaceTimeLocation.AccessabelRegions.Contains(currentLocation.Region)) { if (gameTraveler.ExperiencePoints >= spaceTimeLocation.EntryPoints) { return(true); } else { return(false); } } else { return(false); } }
public static string InitializeMissionGetWeaponOfChoice(Traveler gameTraveler) { string messageBoxText = "You may face dangers on your travels." + "Please select the weapon of your choice: " + "\n"; string weaponList = null; foreach (Traveler.Weapon weapon in Enum.GetValues(typeof(Traveler.Weapon))) { if (weapon != Traveler.Weapon.None) { weaponList += $"\t{weapon}\n"; } } messageBoxText += weaponList; return(messageBoxText); }
public static string InitializeMissionGetTravelerRace(Traveler gameTraveler) { string messageBoxText = $"{gameTraveler.Name}, Enter your race below.\n" + " \n" + "Please use the universal race classifications below." + " \n"; string raceList = null; foreach (Character.RaceType race in Enum.GetValues(typeof(Character.RaceType))) { if (race != Character.RaceType.None) { raceList += $"\t{race}\n"; } } messageBoxText += raceList; return(messageBoxText); }
/// <summary> /// initialize the player info /// </summary> private void InitializeMission() { Traveler traveler = _gameConsoleView.GetInitialTravelerInfo(); _gameTraveler.Name = traveler.Name; _gameTraveler.Age = traveler.Age; _gameTraveler.Race = Character.RaceType.Human; _gameTraveler.HomePlanet = traveler.HomePlanet; _gameTraveler.SpaceTimeLocationID = 1; _gameTraveler.travelerCompanionName = traveler.travelerCompanionName; if (_gameTraveler.HomePlanet == "Earth" || _gameTraveler.HomePlanet == "earth") { _gameTraveler.EarthBorn = true; } // // echo the traveler's info // _gameConsoleView.DisplayGamePlayScreen("Mission Initialization - Complete", Text.InitializeMissionEchoTravelerInfo(_gameTraveler), ActionMenu.MissionIntro, ""); // call displaygameplayscreen and pass player location as header text. Also draw/update map _gameConsoleView.GetContinueKey(); }
public static string InitializeMissionGetTravelerCompanionName(Traveler gameTraveler) { string messageBoxText = $"{gameTraveler.Name}, it will be important for us to know your companion's name on this mission.\n" + " \n" + "Enter your companion's name below.\n" + " \n" + " \n"; string companionNameList = null; foreach (Traveler.CompanionName companionName in Enum.GetValues(typeof(Traveler.CompanionName))) { if (companionName != Traveler.CompanionName.None) { companionNameList += $"\t{companionName}\n"; } } messageBoxText += companionNameList; return(messageBoxText); }
/// <summary> /// initialize the major game objects /// </summary> private void InitializeGame() { _gameTraveler = new Traveler(); _gameUniverse = new Universe(); _gameConsoleView = new ConsoleView(_gameTraveler, _gameUniverse); TravelerObject travelerObject; _playingGame = true; // // add the event handler for adding/subtracting to/from inventory // foreach (GameObject gameObject in _gameUniverse.GameObjects) { if (gameObject is TravelerObject) { travelerObject = gameObject as TravelerObject; travelerObject.ObjectAddedToInventory += HandleObjectAddedToInventory; } } Console.CursorVisible = false; }
public static string Travel(Traveler gameTraveler, List <SpaceTimeLocation> spaceTimeLocations) { string messageTextBox = $"{gameTraveler.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(5) + "Name".PadRight(30) + "Region".PadRight(15) + "Entry Points".PadRight(10) + "\n" + "---".PadRight(5) + "-------------------".PadRight(30) + "--------------".PadRight(15) + "-----".PadRight(10) + "\n"; // // display all locations except the current location // string spaceTimeLocationList = null; foreach (SpaceTimeLocation spaceTimeLocation in spaceTimeLocations) { if (spaceTimeLocation.SpaceTimeLocationID != gameTraveler.SpaceTimeLocationID) { spaceTimeLocationList += $"{spaceTimeLocation.SpaceTimeLocationID}".PadRight(5) + $"{spaceTimeLocation.CommonName}".PadRight(30) + $"{spaceTimeLocation.Region}".PadRight(15) + $"{spaceTimeLocation.EntryPoints}".PadRight(10) + Environment.NewLine; } } messageTextBox += spaceTimeLocationList; return(messageTextBox); }
/// <summary> /// get the player's initial information at the beginning of the game /// </summary> /// <returns>traveler object with all properties updated</returns> public Traveler GetInitialTravelerInfo() { Traveler traveler = new Traveler(); // // intro // DisplayGamePlayScreen("Mission Initialization", Text.InitializeMissionIntro(), ActionMenu.MissionIntro, ""); GetContinueKey(); // // get traveler's name // DisplayGamePlayScreen("Mission Initialization - Name", Text.InitializeMissionGetTravelerName(), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt("Enter your name: "); traveler.Name = GetString(); // // get traveler's age // DisplayGamePlayScreen("Mission Initialization - Age", Text.InitializeMissionGetTravelerAge(traveler.Name), ActionMenu.MissionIntro, ""); int gameTravelerAge; GetInteger($"Enter your age {traveler.Name}: ", 0, 1000000, out gameTravelerAge); traveler.Age = gameTravelerAge; // // get traveler's race // DisplayGamePlayScreen("Mission Initialization - Race", Text.InitializeMissionGetTravelerRace(traveler), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt($"Enter your race {traveler.Name}: "); traveler.Race = GetRace(); // // get traveler's home planet // DisplayGamePlayScreen("Mission Initialization - Home Planet", Text.InitializeMissionGetTravelerHomePlanet(traveler.Name), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt("Enter your home planet: "); traveler.HomePlanet = GetString(); DisplayGamePlayScreen("Mission Initialization - Weapon", Text.InitializeMissionGetWeaponOfChoice(traveler), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt("Enter your weapon of choice: "); traveler.WeaponOfChoice = GetWeapon(); // // get the traveler's experience level // DisplayGamePlayScreen("Mission Initialization - Experience Level", Text.InitializeMissionGetTravelerExperienceLevel(traveler.Name), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt("Enter yes or no: "); string userResponse = GetYesOrNo(); if (userResponse == "NO") { traveler.IsExperienced = true; } else { traveler.IsExperienced = false; } // // echo the traveler's info // DisplayGamePlayScreen("Mission Initialization - Complete", Text.InitializeMissionEchoTravelerInfo(traveler), ActionMenu.MissionIntro, ""); GetContinueKey(); // // change view status to playing game // _viewStatus = ViewStatus.PlayingGame; return(traveler); }