public void InitializeGame() { AddToMonsters(); Console.WriteLine("Please name your hero. (in 1 word)"); var playerName = Console.ReadLine(); while (playerName == "" || playerName.Contains(" ")) { if (playerName.Contains(" ")) { Console.WriteLine("NO SPACES please."); } else { Console.WriteLine("No name?! That's sad..."); } playerName = Console.ReadLine(); } int fixedHp = int.Parse(ConfigurationManager.AppSettings.Get("FixedOriginalHealth")); CreateHero(playerName, 0, 0, fixedHp, this); Console.WriteLine("---------------------"); Console.WriteLine("Monsters are randomly chosen for you per match."); Console.WriteLine("Docile monsters don't attack you first; Aggressive monsters do!!"); Console.WriteLine("You may choose to fight a boss monster when you have more than 500 coins in your possession. All bosses are aggressive."); Console.WriteLine("You may quit the game by closing this console window, however, all your accomplishments will be lost once you quit."); Console.WriteLine("In order to equip, you require coins of the item's price."); Console.WriteLine("You must choose a weapon and an armor right before each battle."); Console.WriteLine("As far as your coin amount allows, it's better if you equip the strongest weapon and armor."); Console.WriteLine("Follow the instructions or press any key to continue."); Console.WriteLine("GOOD LUCK!!"); Console.WriteLine("---------------------"); Console.WriteLine(""); Console.ReadKey(); Console.WriteLine($"Welcome { Hero.Name }!!"); Console.WriteLine("---------------------"); Hero.ShowStats(); Hero.ShowInventory(); Console.WriteLine(""); Console.ReadKey(); }
public void MainMenu() { HashSet <string> flowNum = new HashSet <string> { "1", "2", "3", "4", "5" }; Console.WriteLine(" ========== "); Console.WriteLine("What would you like to do?"); Console.WriteLine("1 = show current status / 2 = show inventory again / 3 = equip weapon / 4 = equip armor / 5 = everything's done"); string choice = ChooseNext(flowNum); while (!flowNum.Contains(choice)) { Console.WriteLine("Choose the right number and press ENTER."); Console.WriteLine(""); choice = ChooseNext(flowNum); } while (choice != "5" && flowNum.Contains(choice)) { switch (choice) { case "1": Hero.ShowStats(); break; case "2": Hero.ShowInventory(); break; case "3": Hero.EquipWeapon(); break; case "4": Hero.EquipArmor(); break; } Console.WriteLine(""); Console.WriteLine(" ========== "); Console.WriteLine("What would you like to do?"); Console.WriteLine("1 = show current status / 2 = show inventory again / 3 = equip weapon / 4 = equip armor / 5 = everything's done"); choice = ChooseNext(flowNum); } if (choice == "5") { if (Hero.EquippedWeapon == null || Hero.EquippedArmor == null) { if (Hero.EquippedWeapon == null && Hero.EquippedArmor == null) { Console.WriteLine("You're bare naked with no weapons!!"); Hero.EquipWeapon(); Hero.EquipArmor(); } if (Hero.EquippedWeapon == null) { Hero.EquipWeapon(); } if (Hero.EquippedArmor == null) { Hero.EquipArmor(); } } } Console.WriteLine(""); Console.WriteLine($"{ Hero.Name } - let's fight!!"); Console.WriteLine("---------------------"); Console.WriteLine(""); }