/// <summary> /// get the player's initial information at the beginning of the game /// </summary> /// <returns>survivor object with all properties updated</returns> public Survivor GetInitialSurviorInformation() { Survivor survivor = new Survivor(); // // intro // DisplayGamePlayScreen("Journal Entry", Text.InitializeMissionIntro(), ActionMenu.MissionIntro, ""); GetContinueKey(); // // get survivor's name // DisplayGamePlayScreen("Journal Entry - Name", Text.InitializeGetSurvivorName(), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt("Write your name down: "); survivor.Name = Controller.UppercaseFirst(GetString("Write your name down: ")); // // get survivor's age // DisplayGamePlayScreen("Journal Entry - Age", Text.InitializeGetSurvivorAge(survivor), ActionMenu.MissionIntro, ""); int gameTravelerAge; GetInteger($"Write your age {survivor.Name}: ", 0, 1000000, out gameTravelerAge); survivor.Age = gameTravelerAge; // // get survivor's race // DisplayGamePlayScreen("Journal Entry - Starting Attribute", Text.InitializeJournalGetSurvivorAttribute(survivor), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt($"Choose your starting attribute {survivor.Name}: "); survivor.StartingAttribute = GetStarterAttribute($"Choose your starting attribute {survivor.Name}: "); // // get survivor's birth state // DisplayGamePlayScreen("Journal Entry - Birth State", Text.InitializeJournalGetSurvivorBirthState(survivor), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt($"Write down your birth state: "); survivor.BirthState = Controller.UppercaseFirst(GetString("Write down your birth state: ")); // // get survivor's potential to kill // DisplayGamePlayScreen("Journal Entry - Potential to Kill", Text.InitializeJournalGetSurvivorCanKill(survivor), ActionMenu.MissionIntro, ""); DisplayInputBoxPrompt($"Can you kill to survive? "); survivor.CanKill = GetYesOrNo("Can you kill to survive? "); // // echo the survivor's info // DisplayGamePlayScreen("Journal Entry - Complete", Text.InitializeEchoSurviorInformation(survivor), ActionMenu.MissionIntro, ""); GetContinueKey(); return(survivor); }
/// <summary> /// default constructor to create the console view objects /// </summary> public ConsoleView(Survivor gameSurvivor, WorldContents worldContents) { _gameSurvivor = gameSurvivor; _worldContents = worldContents; _viewStatus = ViewStatus.PlayingGame; InitializeDisplay(); }
/// <summary> /// default constructor to create the console view objects /// </summary> public ConsoleView(Survivor gameSurvivor, Universe gameUniverse) { _gameSurvivor = gameSurvivor; _gameUniverse = gameUniverse; _viewStatus = ViewStatus.SurvivorInitialization; InitializeDisplay(); }
public static string InitializeQuestGetSurvivorAge(Survivor gameSurvivor) { string messageBoxText = $"Very good then, we will call you {gameSurvivor.Name}.\n" + " \n" + "Enter your age below.\n"; return(messageBoxText); }
//public static string Travel(int currentSpaceTimeLocationId, List<SpaceTimeLocation> spaceTimeLocations) //{ // string messageBoxText = // $"{gameSurvivor.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"; // string spaceTimeLocationList = null; // foreach (SpaceTimeLocation spaceTimeLocation in spaceTimeLocations) // { // if (race != Character.EthnicityType.None) // { // raceList += $"\t{race}\n"; // } // } // messageBoxText += raceList; // return messageBoxText; //} #endregion public static List <string> StatusBox(Survivor survivor, Universe universe) { List <string> statusBoxText = new List <string>(); statusBoxText.Add($"Experience Points: {survivor.ExperiencePoints}\n"); statusBoxText.Add($"Health: {survivor.Health}\n"); statusBoxText.Add($"Lives: {survivor.Lives}\n"); return(statusBoxText); }
public static string SurvivorInfo(Survivor gameSurvivor) { string messageBoxText = $"\tSurvivor Name: {gameSurvivor.Name}\n" + $"\tSurvivor Age: {gameSurvivor.Age}\n" + $"\tSurvivor EthnicityType: {gameSurvivor.Ethnicity}\n" + " \n"; return(messageBoxText); }
public static string InitializeGetSurvivorAge(Survivor gameSurvivor) { string messageBoxText = $"Good job {gameSurvivor.Name}, I'm surprised you remember. Now we'll get your age.\n" + " \n" + "Enter your age below.\n" + " \n"; return(messageBoxText); }
public static List <string> StatusBox(Survivor survivor, WorldContents _worldContents) { List <string> statusBoxText = new List <string>(); statusBoxText.Add($"Experience Points: {survivor.Exp}\n"); statusBoxText.Add($"Health: {survivor.Health}\n"); return(statusBoxText); #endregion }
/// <summary> /// initialize the player info /// </summary> private void InitializeMission() { Survivor traveler = _gameConsoleView.GetInitialSurvivorInfo(); _gameSurvivor.Name = traveler.Name; _gameSurvivor.Age = traveler.Age; _gameSurvivor.Ethnicity = traveler.Ethnicity; _gameSurvivor.IslandLocationID = 1; _gameSurvivor.ExperiencePoints = 0; _gameSurvivor.Health = 100; _gameSurvivor.Lives = 3; }
public static string Travel(Survivor gameSurvivor, List <IslandLocation> islandLocations) { string messageBoxText = $"{gameSurvivor.Name}, we 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 islandLocationList = null; //foreach (IslandLocation islandLocation in islandLocations) //{ // if (islandLocation.IslandLocationID != gameSurvivor.IslandLocationID) // { // islandLocationList += // $"{islandLocation.IslandLocationID}".PadRight(10) + // $"{islandLocation.CommonName}".PadRight(30) + // $"{islandLocation.Accessible}".PadRight(10) + // Environment.NewLine; // } //} // // display all locations except the current location // string islandLocationList = null; foreach (IslandLocation islandLocation in islandLocations) { if (islandLocation.IslandLocationID != gameSurvivor.IslandLocationID && islandLocation.Accessible == true) { islandLocationList += $"{islandLocation.IslandLocationID}".PadRight(10) + $"{islandLocation.CommonName}".PadRight(30) + //$"{islandLocation.Accessible}".PadRight(10) + Environment.NewLine; } } messageBoxText += islandLocationList; return(messageBoxText); }
public static string EditSurvivorInfoEchoSurvivorInfo(Survivor gameSurvivor) { string messageBoxText = $"Very good then {gameSurvivor.Name}.\n" + " \n" + "You will find the changes you have made to your information listed below.\n" + " \n" + $"\tSurvivor Name: {gameSurvivor.Name}\n" + $"\tSurvivor Age: {gameSurvivor.Age}\n" + $"\tSurvivor EthnicityType: {gameSurvivor.Ethnicity}\n" + " \n" + "Please select a menu option."; return(messageBoxText); }
/// <summary> /// initialize the major game objects /// </summary> private void InitializeGame() { _gameSurvivor = new Survivor(); _gameUniverse = new Universe(); _gameConsoleView = new ConsoleView(_gameSurvivor, _gameUniverse); _playingGame = true; // // add initial items to the traveler's inventory // _gameSurvivor.Inventory.Add(_gameUniverse.GetGameObjectById(1) as SurvivorObject); _gameSurvivor.Inventory.Add(_gameUniverse.GetGameObjectById(2) as SurvivorObject); Console.CursorVisible = false; }
public static string SurvivorInfo(Survivor gameSurvivor) { string messageBoxText = $"\t Survivor Name: {gameSurvivor.Name}\n" + $"\t Survivor Age: {gameSurvivor.Age}\n" + $"\t Survivor Starter Attribute: {gameSurvivor.StartingAttribute}\n" + $"\t Survivor birth state: {gameSurvivor.BirthState}\n" + $"\t Survivor has potential to KILL: {gameSurvivor.CanKill}" + $"\n\n\t {gameSurvivor.Greeting()}" + " \n\n\n"; //gameSurvivor.Greeting(); return(messageBoxText); }
/// <summary> /// initialize the player info /// </summary> private void InitializeMission() { Survivor survivor = _gameConsoleView.GetInitialSurviorInformation(); _gameSurvivor.Name = survivor.Name; _gameSurvivor.Age = survivor.Age; _gameSurvivor.StartingAttribute = survivor.StartingAttribute; _gameSurvivor.BirthState = survivor.BirthState; _gameSurvivor.CanKill = survivor.CanKill; _gameSurvivor.LocationId = 1; _gameSurvivor.Exp = 0; _gameSurvivor.Health = 100; }
public static string InitializeQuestEchoSurvivorInfo(Survivor gameSurvivor) { string messageBoxText = $"Very good then {gameSurvivor.Name}.\n" + " \n" + "It appears we have all the necessary data to begin your quest. You will find it" + " listed below.\n" + " \n" + $"\tSurvivor Name: {gameSurvivor.Name}\n" + $"\tSurvivor Age: {gameSurvivor.Age}\n" + $"\tSurvivor EthnicityType: {gameSurvivor.Ethnicity}\n" + " \n" + "Press any key to begin."; return(messageBoxText); }
public static string InitializeEchoSurviorInformation(Survivor gameSurvivor) { string messageBoxText = $"Very good then {gameSurvivor.Name}.\n" + " \n" + "It appears we have all the necessary data to begin your mission. You will find it" + " listed below.\n" + " \n" + $"\tSurvivor Name: {gameSurvivor.Name}\n" + $"\tSurvivor Age: {gameSurvivor.Age}\n" + $"\tSurvivor starting attribute: {gameSurvivor.StartingAttribute}\n" + $"\tSurvivor birth state: {gameSurvivor.BirthState}\n" + $"\tSurvivor has potential to KILL: {gameSurvivor.CanKill}"; 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 Survivor GetInitialSurvivorInfo() { Survivor survivor = new Survivor(); // // intro // DisplayGamePlayScreen("Quest Initialization", Text.InitializeQuestIntro(), ActionMenu.QuestIntro, ""); GetContinueKey(); // // get survivor's name // DisplayGamePlayScreen("Quest Initialization - Name", Text.InitializeQuestGetSurvivorName(), ActionMenu.QuestIntro, ""); DisplayInputBoxPrompt("Enter your name: "); survivor.Name = GetString(); // // get suvivor's age // DisplayGamePlayScreen("Quest Initialization - Age", Text.InitializeQuestGetSurvivorAge(survivor), ActionMenu.QuestIntro, ""); int gameSurvivorAge; GetInteger($"Enter your age, {survivor.Name}: ", 0, 1000000, out gameSurvivorAge); survivor.Age = gameSurvivorAge; // // get suvivor's race // DisplayGamePlayScreen("Quest Initialization - EthnicityType", Text.InitializeQuestGetSurvivorRace(survivor), ActionMenu.QuestIntro, ""); DisplayInputBoxPrompt($"Enter your ethnicity, {survivor.Name}: "); survivor.Ethnicity = GetRace(); // // echo the suvivor's info // DisplayGamePlayScreen("Quest Initialization - Complete", Text.InitializeQuestEchoSurvivorInfo(survivor), ActionMenu.QuestIntro, ""); GetContinueKey(); // // change view status to playing game // _viewStatus = ViewStatus.PlayingGame; return(survivor); }
public static string EditSurvivorInfo(Survivor gameSurvivor) { string messageBoxText = $"\tSurvivor Name: {gameSurvivor.Name}\n" + $"\tSurvivor Age: {gameSurvivor.Age}\n" + $"\tSurvivor EthnicityType: {gameSurvivor.Ethnicity}\n" + " \n" + "\tOptions:\n" + "\n" + "\tName\n" + "\tAge\n" + "\tEthnicity\n" + "\n" + "\tPlease enter what you would like to edit below."; return(messageBoxText); }
public static string InitializeJournalGetSurvivorAttribute(Survivor gameSurvivor) { string messageBoxText = $"{gameSurvivor.Name}, it's important to know what you're good at in a time like this.\n" + " \n" + "Jot down your starting attribute.\n"; string attributeList = null; foreach (Survivor.StarterAttribute attribute in Enum.GetValues(typeof(Survivor.StarterAttribute))) { if (attribute != Survivor.StarterAttribute.None) { attributeList += $"\t{attribute}\n"; } } messageBoxText += attributeList; return(messageBoxText); }
public static string EditSurvivorInfoGetSurvivorRace(Survivor gameSurvivor) { string messageBoxText = $"{gameSurvivor.Name}, please enter your new ethnicity below.\n" + " \n" + "Please use one of the following." + " \n"; string raceList = null; foreach (Survivor.EthnicityType race in Enum.GetValues(typeof(Survivor.EthnicityType))) { if (race != Survivor.EthnicityType.None) { raceList += $"\t{race}\n"; } } messageBoxText += raceList; return(messageBoxText); }
/// <summary> /// initialize the major game objects /// </summary> private void InitializeGame() { _gameSurvivor = new Survivor(); _worldContents = new WorldContents(); _gameConsoleView = new ConsoleView(_gameSurvivor, _worldContents); _gameConsoleView.DisplayStatusBox(); SurvivorObject survivorObject; Friendly friendly; _playingGame = true; //add event handler for adding/subtracting to/from inventory foreach (GameObject gameObject in _worldContents.GameObjects) { if (gameObject is SurvivorObject) { survivorObject = gameObject as SurvivorObject; survivorObject.ObjectAddedToInventory += HandleObjectAddedToInventory; } } //event handler for speaking with and unlocking room foreach (Npc npc in _worldContents.Npcs) { if (npc is Friendly) { friendly = npc as Friendly; friendly.FriendlyTalkedTo += HandleNpcTalkedTo; } } //add initial items to the survivor's inventory _gameSurvivor.Inventory.Add(_worldContents.GetGameOjbectById(5) as SurvivorObject); _gameSurvivor.Inventory.Add(_worldContents.GetGameOjbectById(6) as SurvivorObject); Console.CursorVisible = false; }
public static string InitializeQuestGetSurvivorRace(Survivor gameSurvivor) { string messageBoxText = $"{gameSurvivor.Name}, it will be important for us to know your ethnicity.\n" + " \n" + "Enter your ethnicity below.\n" + " \n" + "Please use one of the following." + " \n"; string raceList = null; foreach (Survivor.EthnicityType race in Enum.GetValues(typeof(Survivor.EthnicityType))) { if (race != Survivor.EthnicityType.None) { raceList += $"\t{race}\n"; } } messageBoxText += raceList; return(messageBoxText); }
/// <summary> /// edit survivor info /// </summary> /// <returns>traveler object with all properties updated</returns> public Survivor EditSurvivorInfo(Survivor survivor) { // // intro // DisplayGamePlayScreen("Edit Survivor Info", Text.EditSurvivorInfo(survivor), ActionMenu.EditPlayerInfo, ""); DisplayInputBoxPrompt("Enter what info you would like to change: "); // get survivor choice and validate bool isValid = false; while (!isValid) { string userChoice = Console.ReadLine().ToLower(); switch (userChoice) { case "name": // // get survivor's new name // DisplayGamePlayScreen("Edit Survivor Info - Name", Text.EditSurvivorInfoGetSurvivorName(), ActionMenu.EditPlayerInfo, ""); DisplayInputBoxPrompt("Enter your name: "); survivor.Name = GetString(); isValid = true; break; case "age": // // get survivor's new age // DisplayGamePlayScreen("Edit Survivor Info - Age", Text.EditSurvivorInfoGetSurvivorAge(survivor), ActionMenu.EditPlayerInfo, ""); int gameSurvivorAge; GetInteger($"Enter your age, {survivor.Name}: ", 0, 1000000, out gameSurvivorAge); survivor.Age = gameSurvivorAge; isValid = true; break; case "ethnicity": // // get survivor's new race // DisplayGamePlayScreen("Edit Survivor Info - EthnicityType", Text.EditSurvivorInfoGetSurvivorRace(survivor), ActionMenu.EditPlayerInfo, ""); DisplayInputBoxPrompt($"Enter your ethnicity, {survivor.Name}: "); survivor.Ethnicity = GetRace(); isValid = true; break; default: DisplayInputErrorMessage("You did not enter a valid option."); break; } } // // echo the traveler's info // DisplayGamePlayScreen("Edit Survivor Info - Complete", Text.EditSurvivorInfoEchoSurvivorInfo(survivor), ActionMenu.AdminMenu, ""); return(survivor); }