예제 #1
0
 public void Inventory()
 {
     Hero.ShowInventory();
     Console.WriteLine("Press any key to continue exploring");
     Console.ReadKey();
     Start();
 }
예제 #2
0
 public void Inventory()
 {
     Hero.ShowInventory();
     Console.WriteLine("");
     Console.WriteLine("Press any key to return to main menu.");
     Console.ReadKey();
     this.Main();
 }
예제 #3
0
        public void SellItem()
        {
            HeroBox.Clear();
            Console.WriteLine("");
            Console.WriteLine("Please make sure you have some item to sell");

            HeroBag();

            var input = "";

            Console.Write("Enter the code of the item you would like to sell.");

            input = Console.ReadLine();
            if (HeroBox.ContainsKey(input))
            {
                if (input.Substring(0, 1) == "A")
                {
                    var armor = (Armor)HeroBox[input];

                    Hero.Gold += armor.ResellValue;
                    Hero.ArmorsBag.Remove(armor);
                    this.Armors.Add(armor);
                    Console.WriteLine("");
                    Console.WriteLine($"You get {armor.ResellValue} gold from {armor.Name}");
                    Hero.ShowInventory();
                    Menu();
                }
                else if (input.Substring(0, 1) == "W")
                {
                    var weapon = (Weapon)HeroBox[input];

                    Hero.Gold += weapon.ResellValue;
                    Hero.WeaponsBag.Remove(weapon);
                    this.Weapons.Add(weapon);
                    Console.WriteLine("");
                    Console.WriteLine($"You get {weapon.ResellValue} gold from {weapon.Name}");
                    Hero.ShowInventory();
                    Menu();
                }
                else if (input.Substring(0, 1) == "P")
                {
                    var potion = (Potion)HeroBox[input];

                    Hero.Gold += potion.ResellValue;
                    Hero.PotionsBag.Remove(potion);
                    this.Potions.Add(potion);
                    Console.WriteLine("");
                    Console.WriteLine($"You get {potion.ResellValue} gold from {potion.Name}");
                    Hero.ShowInventory();
                    Menu();
                }
            }
            else if (!NameItemList.ContainsKey(input))
            {
                Console.WriteLine("You don't have that items or item number is wrong");
                Menu();
            }
        }
예제 #4
0
        //Display Hero Inventory
        private void Inventory()
        {
            Hero.ShowInventory();

            Console.WriteLine("1-Equip Weapon");
            Console.WriteLine("2-UnEquip Weapon");
            Console.WriteLine("3-Equip Armor");
            Console.WriteLine("4-UnEquip Armor");
            Console.WriteLine("5-Equip Shield");
            Console.WriteLine("6-UnEquip Shield");

            Console.WriteLine("----------------------------------------------------------------------------------------------");
            Console.Write("Select the menu : ");

            var KeyInput = Console.ReadLine();

            //Equip Weapon
            if (KeyInput == "1")
            {
                var unEquippedWeapons = Hero.GetWeapons().Where(p => p != Hero.EquippedWeapon).ToList();

                for (var i = 0; i < unEquippedWeapons.Count(); i++)
                {
                    Console.WriteLine($"{i + 1} - {unEquippedWeapons[i].Name}");
                }

                Console.Write("Selet the weapon ID : ");
                var index = Hero.GetUserInputNumber() - 1;
                Hero.EquipWeapon(index);
            }

            //Unequip Weapon
            else if (KeyInput == "2")
            {
                Hero.UnEquipWeapon();
            }

            //Equip Armor
            else if (KeyInput == "3")
            {
                var unEquippedArmors = Hero.GetArmors().Where(p => p != Hero.EquippedArmor).ToList();
                for (var i = 0; i < unEquippedArmors.Count(); i++)
                {
                    Console.WriteLine($"{i + 1} - {unEquippedArmors[i].Name}");
                }
                Console.Write("Selet the armor ID : ");
                var index = Hero.GetUserInputNumber() - 1;
                Hero.EquipArmor(index);
            }

            //Unequip Armor
            else if (KeyInput == "4")
            {
                Hero.UnEquipArmor();
            }

            //Equip Shield
            else if (KeyInput == "5")
            {
                var unEquippedShield = Hero.GetShield().Where(p => p != Hero.EquippedShield).ToList();

                for (var i = 0; i < unEquippedShield.Count(); i++)
                {
                    Console.WriteLine($"{i + 1} - {unEquippedShield[i].Name}");
                }

                Console.Write("Selet the shield ID : ");
                var index = Hero.GetUserInputNumber() - 1;
                Hero.EquipShield(index);
            }

            //Unequip Shield
            else if (KeyInput == "6")
            {
                Hero.UnEquipShield();
            }

            Console.WriteLine("Press any key to return to main menu.");
            Console.ReadKey();
        }
예제 #5
0
 public void Inventory()
 {
     Hero.ShowInventory();
 }
예제 #6
0
 public void Inventory()
 {
     Hero.ShowInventory();
     this.MainMenu();
 }
예제 #7
0
 private void Inventory()
 {
     Hero.ShowInventory();
 }