Exemplo n.º 1
0
        public void ListWeapons()
        {
            Console.WriteLine("*****Weapons*****");
            var count = 1;

            foreach (var w in this.WeaponsBag)
            {
                Console.WriteLine($"w{count}:{w.Name}, {w.ResellValue} gold");

                UserItemCatalog.Add($"w{count}", w);
                count++;
            }
        }
Exemplo n.º 2
0
        public void ListPotions()
        {
            Console.WriteLine("");
            Console.WriteLine("*****Potions*****");
            var count = 1;

            foreach (var p in this.PotionsBag)
            {
                Console.WriteLine($"p{count}: {p.Name}, {p.ResellValue} gold");

                UserItemCatalog.Add($"p{count}", p);
                count++;
            }
        }
Exemplo n.º 3
0
        public void ListArmor()
        {
            Console.WriteLine("");
            Console.WriteLine("*****Armor*****");
            var count = 1;

            foreach (var a in this.ArmorsBag)
            {
                Console.WriteLine($"a{count}: {a.Name}, {a.ResellValue} gold");

                UserItemCatalog.Add($"a{count}", a);
                count++;
            }
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        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();
            }
        }