public void ItemsToSell() { UserItemCatalog.Clear(); ListArmor(); ListWeapons(); ListPotions(); }
public void EquipPotion() { UserItemCatalog.Clear(); Console.WriteLine(""); Console.WriteLine("*****Potions*****"); var count = 1; foreach (var potion in this.PotionsBag) { Console.WriteLine($"{count}: {potion.Name} with {potion.HP} hit points"); UserItemCatalog.Add($"{count}", potion); count++; } if (UserItemCatalog.Count == 0) { Console.WriteLine("You have no potions to drink"); Console.ReadKey(); Shop.Menu(); } var selection = ""; while (string.IsNullOrEmpty(selection)) { Console.WriteLine(""); Console.Write("Make a selection: "); selection = Console.ReadLine(); } var intselection = Convert.ToInt32(selection); if (intselection < 1 || intselection > UserItemCatalog.Count) { Console.WriteLine("Please make a valid selection"); EquipPotion(); Console.ReadKey(); } else { var potion = (Potion)UserItemCatalog[selection]; PotionsBag.Remove(potion); EquippedPotion = potion; CurrentHP += potion.HP; Game.Main(); } }
public void EquipArmor() { UserItemCatalog.Clear(); Console.WriteLine(""); Console.WriteLine("*****Armor*****"); var count = 1; foreach (var armor in this.ArmorsBag) { Console.WriteLine($"{count}: {armor.Name} with {armor.Defense} defense"); UserItemCatalog.Add($"{count}", armor); count++; } if (UserItemCatalog.Count == 0) { Console.WriteLine("You have no armor to equip"); Console.ReadKey(); Shop.Menu(); } var selection = ""; while (string.IsNullOrEmpty(selection)) { Console.WriteLine(""); Console.Write("Make a selection: "); selection = Console.ReadLine(); } var intselection = Convert.ToInt32(selection); if (intselection < 1 || intselection > UserItemCatalog.Count) { Console.WriteLine("Please make a valid selection"); EquipArmor(); Console.ReadKey(); } else { var armor = (Armor)UserItemCatalog[selection]; ArmorsBag.Remove(armor); EquippedArmor = armor; Defense += armor.Defense; Game.Main(); } }
public void EquipWeapon() { UserItemCatalog.Clear(); Console.WriteLine(""); Console.WriteLine("*****Weapons*****"); var count = 1; foreach (var weapon in this.WeaponsBag) { Console.WriteLine($"{count}: {weapon.Name} with {weapon.Strength} strength"); UserItemCatalog.Add($"{count}", weapon); count++; } if (UserItemCatalog.Count == 0) { Console.WriteLine("You have no weapons to use"); Console.ReadKey(); Shop.Menu(); } var selection = ""; while (string.IsNullOrEmpty(selection)) { Console.WriteLine(""); Console.Write("Make a selection: "); selection = Console.ReadLine(); } var intselection = Convert.ToInt32(selection); if (intselection < 1 || intselection > UserItemCatalog.Count) { Console.WriteLine("Please make a valid selection"); EquipWeapon(); Console.ReadKey(); } else { var weapon = (Weapon)UserItemCatalog[selection]; WeaponsBag.Remove(weapon); EquippedWeapon = weapon; Strength += weapon.Strength; Game.Main(); } }