public static List <Item> PopulateItems(List <Item> gameItems) { Weapon rustySword = new Weapon("Rusty Sword Weapon", "a rusty sword", 5, 0, false, 1); HealingPotion h1 = new HealingPotion("Healing Potion", "heals what ails you", 5); StrengthPotion s1 = new StrengthPotion("Strength Potion", "gives you enhanced strength for a brief period", 5, 60); HealingPotion h2 = new HealingPotion("Advanced Healing Potion", "A fortifying elixir that restores much of your life", 20); StrengthPotion s2 = new StrengthPotion("Advanced Strength Potion", "A hearty elixir that sereiously bolsters your strength", 10, 120); Armor a1 = new Armor("Chain Mail Armor", "A sturdy mail shirt with good protection", 5); Armor a2 = new Armor("Plate Mail Armor", "A gleaming suit of armor", 10); Weapon w1 = new Weapon("Sword of Light Weapon", "The finest crafted sword in the land", 35, 5, true, 5); Weapon w2 = new Weapon("Caveman Club Weapon", "A primal, savage oak club that seems oddly well-balanced", 40, 2, true, 5); Weapon w3 = new Weapon("Hammer of Justice Weapon", "A superbly crafted hammer", 50, 0, true, 5); List <Item> stuff = new List <Item> { rustySword, a1, a2, w1, w2, w3, h1, h1, h1, h1, h1, h1, s1, s1, s1, s1, s1, s1, s2, s2, s2, h2, h2, h2 }; for (int i = 0; i < stuff.Count; i++) { gameItems.Add(stuff[i]); } return(gameItems); }
}//end player level //Player Creation public void PlayerCreation(Player player) { Console.WriteLine("Enter your name, brave soul: "); player.Name = Console.ReadLine(); Inventory playerInventory = new Inventory();//instantiating an inventory player.Inventory = playerInventory; Console.WriteLine("Choose a race:\n" + "H)uman - a race with the potential to be good at everything they try\n" + "E)lf - an ancient race, lighting quick but frail\n" + "O)rc - a smaller race, slightly weaker, but excellent at stealth\n" + "D)warf - a smaller race, but hearty and industrious\n" + "G)iant - an incredibly powerful and hearty race, but oh so slow.."); ConsoleKey raceChoice = Console.ReadKey(true).Key; switch (raceChoice) {//player is given different starting weapon depending on race //player is given different advantages and disadvantages case ConsoleKey.H: player.CharacterRace = Race.Human; //vvvvvvvvvv vvvvvvvturned up for testing Weapon longSword = new Weapon("Long Sword Weapon", "A long gleaming blade", 100, 5, true, 50); player.Inventory.AddItem(longSword); player.EquippedWeapon = longSword; break; case ConsoleKey.E: player.CharacterRace = Race.Elf; player.HitChance += 5; player.MaxLife -= 10; Weapon shortSword = new Weapon("Short Sword Weapon", "A short, precise blade", 8, 3, false, 4); player.Inventory.AddItem(shortSword); player.EquippedWeapon = shortSword; break; case ConsoleKey.O: player.CharacterRace = Race.Orc; player.MaxLife += 10; player.HitChance -= 2; Weapon mace = new Weapon("Mace Weapon", "A wicked-looking spiked club", 12, 0, true, 1); player.Inventory.AddItem(mace); player.EquippedWeapon = mace; break; case ConsoleKey.D: player.CharacterRace = Race.Dwarf; player.HitChance -= 5; Weapon broadAxe = new Weapon("Broad Axe Weapon", "A finely-honed, silver axe", 10, 0, true, 3); player.Inventory.AddItem(broadAxe); player.EquippedWeapon = broadAxe; player.EquippedWeapon.MaxDamage += 3; break; case ConsoleKey.G: player.CharacterRace = Race.Giant; Weapon warHammer = new Weapon("War Hammer Weapon", "A massive iron hammer", 15, -2, true, 4); player.Inventory.AddItem(warHammer); player.EquippedWeapon = warHammer; player.EquippedWeapon.MaxDamage += 15; player.HitChance -= 10; player.MaxLife += 20; player.Block -= 10; break; default: Console.WriteLine("If you can't choose well, you will be a human."); break; }//end race switch Armor clothArmor = new Armor("Cloth Armor", "Lightweigth, but little protection", 1); HealingPotion h1 = new HealingPotion("Healing Potion", "heals what ails you", 5); //starting player off with cloth armor and some healing potions player.EquippedArmor = clothArmor; player.EquippedPotion = h1; //separate inventory for quest items List <QuestItems> questItems = new List <QuestItems>(); player.QuestItemsList = questItems; player.Inventory.AddItem(clothArmor); player.Inventory.AddItem(h1); Console.Clear(); Console.WriteLine("----------------YOUR CHARACTER-----------\n"); Console.WriteLine($"{player}\n"); Console.WriteLine("________________________________________________________________"); }//end PlayerCreation()