Beispiel #1
0
        public void Explore()
        {
            //var myMonster = new Monster();
            var explore = new Explore(Hero, this);

            explore.Start();
        }
Beispiel #2
0
 public void Run(Monster Monster)
 {
     if (Hero.Speed <= Monster.Speed)
     {
         Console.WriteLine($"You Can't Out Run This {Monster.Name}.");
         MonsterTurn(Monster);
     }
     else
     {
         Console.WriteLine("You Got Away!");
         var explore = new Explore(Hero, Game);
         explore.Start();
     }
 }
Beispiel #3
0
        public void Win(Monster Monster)
        {
            Console.WriteLine(Monster.Name + " has been defeated! You win the battle!");
            this.Hero.Gold += this.Monster.Gold;
            Random Random = new Random();

            switch (Random.Next(0, 5))
            {
            case 1:
                Random PotionDrop = new Random();
                var    potion     = (Potion)LootPotionList[PotionDrop.Next(LootPotionList.Count)];
                Hero.PotionsBag.Add(potion);
                Console.WriteLine($"You found a {potion.Name}");
                break;

            case 2:
                Random WeaponDrop = new Random();
                var    weapon     = (Weapon)LootWeaponList[WeaponDrop.Next(LootWeaponList.Count)];
                Hero.WeaponsBag.Add(weapon);
                Console.WriteLine($"You found a {weapon.Name}");
                break;

            case 3:
                Random ArmorDrop = new Random();
                var    armor     = (Armor)LootArmorList[ArmorDrop.Next(LootArmorList.Count)];
                Hero.ArmorsBag.Add(armor);
                Console.WriteLine($"You found a {armor.Name}");
                break;

            case 4:
                Console.WriteLine("You loot nothing of value.");
                break;
            }
            Console.WriteLine($"You win {this.Monster.Gold} gold");
            Console.WriteLine($"Your gold is now {this.Hero.Gold}");
            Hero.Gold += Monster.Gold;

            var explore = new Explore(Hero, Game);

            explore.Start();
        }
Beispiel #4
0
        public void EquipWeapon(Weapon weapon)
        {
            if (EquippedWeapon == null)
            {
                this.EquippedWeapon = weapon;
                WeaponsBag.Remove(weapon);
                Strength += weapon.Strength;
                Console.WriteLine($"You Are Now Weilding a {weapon.Name} For + {weapon.OriginalValue} Strength");
                Console.WriteLine();
                ShowInventory();
            }
            else
            {
                Console.WriteLine("You already have a weapon equipped.");
                Console.WriteLine();
                Console.WriteLine("What would you like to do?");
                Console.WriteLine("1. Back to Inventory.");
                Console.WriteLine("2. Continue Adventure.");
                Console.WriteLine("3. Back To Town.");

                var input = Console.ReadLine();
                if (input == "1")
                {
                    this.ShowInventory();
                }
                else if (input == "2")
                {
                    var explore = new Explore(this, Game);
                    explore.Start();
                }
                else if (input == "3")
                {
                    Console.WriteLine("Press any key to return to main menu.");
                    Console.ReadKey();
                    this.Game.Main();
                }
            }
        }
Beispiel #5
0
        public void EquipArmor(Armor armor)
        {
            if (EquippedArmor == null)
            {
                this.EquippedArmor = armor;
                ArmorsBag.Remove(armor);
                Defense += armor.Defense;
                Speed   -= armor.Defense;
                Console.WriteLine($"You Are Now Wearing {armor.Name} For + {armor.OriginalValue} Defense");
                Console.WriteLine();
                ShowInventory();
            }
            else
            {
                Console.WriteLine("You already have a weapon equipped.");
                Console.WriteLine();
                Console.WriteLine("What would you like to do?");
                Console.WriteLine("1. Back to Inventory.");
                Console.WriteLine("2. Continue Adventure.");
                Console.WriteLine("3. Back To Town.");

                var input = Console.ReadLine();
                if (input == "1")
                {
                    this.ShowInventory();
                }
                else if (input == "2")
                {
                    var explore = new Explore(this, Game);
                    explore.Start();
                }
                else if (input == "3")
                {
                    this.Game.Main();
                }
            }
        }
Beispiel #6
0
        public void ShowInventory()
        {
            Console.WriteLine("*****  INVENTORY ******");

            Console.WriteLine("Weapons: ");
            foreach (var Weapon in this.WeaponsBag)
            {
                Console.WriteLine(Weapon.Name + " of " + Weapon.Strength + " Strength");
            }
            Console.WriteLine("Armors: ");
            foreach (var Armor in this.ArmorsBag)
            {
                Console.WriteLine(Armor.Name + " of " + Armor.Defense + " Defense");
            }
            Console.WriteLine("Potions: ");
            foreach (var Potion in this.PotionsBag)
            {
                Console.WriteLine(Potion.Name + " of " + Potion.HP + " HP");
            }

            Console.WriteLine("What Would You Like To Do?");
            Console.WriteLine("1.) Equip A Weapon");
            Console.WriteLine("2.) Equip An Armor");
            Console.WriteLine("3.) Drink Potion");
            Console.WriteLine("4.) Unequip A Weapon");
            Console.WriteLine("5.) Unequip A Armor");
            Console.WriteLine("6.) Continue Adventure");
            var MenuSelection = Console.ReadLine();

            if (MenuSelection == "1")
            {
                Console.WriteLine("Which Item Would You Like To Equip?");
                ListHeroWeapons();
                var WeaponSelect = "";
                WeaponSelect = Console.ReadLine();
                if (HeroWeaponCatalog.ContainsKey(WeaponSelect))
                {
                    var NewWeapon = (Weapon)HeroWeaponCatalog[WeaponSelect];
                    EquipWeapon(NewWeapon);
                }
                else if (!HeroWeaponCatalog.ContainsKey(WeaponSelect))
                {
                    Console.WriteLine("Please Enter a Valid Code.");
                    ShowInventory();
                }
            }
            else if (MenuSelection == "2")
            {
                Console.WriteLine("Which Item Would You Like To Equip?");
                ListHeroArmor();
                var ArmorSelect = "";
                ArmorSelect = Console.ReadLine();
                if (HeroArmorCatalog.ContainsKey(ArmorSelect))
                {
                    var NewArmor = (Armor)HeroArmorCatalog[ArmorSelect];
                    EquipArmor(NewArmor);
                }
                else if (!HeroArmorCatalog.ContainsKey(ArmorSelect))
                {
                    Console.WriteLine("Please Enter a Valid Code.");
                    ShowInventory();
                }
            }
            else if (MenuSelection == "3")
            {
                Console.WriteLine("Which Potion Would You Like to Drink?");
                ListHeroPotions();
                var PotionSelect = "";
                PotionSelect = Console.ReadLine();
                if (HeroPotionsCatalog.ContainsKey(PotionSelect))
                {
                    var NewPotion = (Potion)HeroPotionsCatalog[PotionSelect];
                    DrinkPotion(NewPotion);
                }
                else if (!HeroPotionsCatalog.ContainsKey(PotionSelect))
                {
                    Console.WriteLine("Please Enter a Valid Code.");
                    ShowInventory();
                }
            }
            else if (MenuSelection == "4")
            {
                if (EquippedWeapon != null)
                {
                    UnEquipWeapon(EquippedWeapon);
                }
                else if (EquippedWeapon == null)
                {
                    Console.WriteLine("You Do Not Have A Weapon Equipped");
                    this.ShowInventory();
                }
            }
            else if (MenuSelection == "5")
            {
                if (EquippedArmor != null)
                {
                    UnEquipArmor(EquippedArmor);
                }
                else if (EquippedArmor == null)
                {
                    Console.WriteLine("You Do Not Have Armor Equipped");
                    this.ShowInventory();
                }
            }
            else if (MenuSelection == "6")
            {
                Console.WriteLine();
                Console.WriteLine("What would you like to do?");
                Console.WriteLine("1. Back to Inventory.");
                Console.WriteLine("2. Continue Adventure.");
                Console.WriteLine("3. Back To Town.");

                var input = Console.ReadLine();
                if (input == "1")
                {
                    this.ShowInventory();
                }
                else if (input == "2")
                {
                    var explore = new Explore(this, Game);
                    explore.Start();
                }
                else if (input == "3")
                {
                    this.Game.Main();
                }
            }
            else
            {
                Game.Main();
            }
        }