public void CheckEquipReq() { // create a training dummy TrainingDummy Dummy = new TrainingDummy(100, 0, 0); // knight should be able to use double slash try { Guinevere.Skillbar.Skills[0].Use(Dummy); Assert.IsTrue(true, "Knight should use the skill successfully."); } catch (SkillReqsNotMetException) { Assert.IsFalse(true, "Knight should meet skill requirements."); } // replace the knight's sword with a book and 2H it (lol) Guinevere.Inventory.AddItem(ItemDAO.CreateNewEquipmentItem("History Tome")); Guinevere.Equipment.Equip("MainHand", "History Tome"); Guinevere.Equipment.Toggle2H(); // try to use double slash, should fail because the book doesn't have a "sword" tag try { Guinevere.Skillbar.Skills[0].Use(Dummy); Assert.IsFalse(true, "Book should not meet the skill's Sword requirement."); } catch (SkillReqsNotMetException) { Assert.IsTrue(true, "Book should not meet the skill's Sword requirement."); } }
public void CharacterOverburdened() { Character Guinevere = new Character("Guinevere", new Knight("F")); Guinevere.Inventory.AddItem(ItemDAO.CreateNewEquipmentItem("Plate Armor"), 5); Assert.IsTrue(Guinevere.Inventory.IsOverburdened, "Character should be overburdened when Weight > Weight Capacity."); }
public void AddingItems() { // generate new empty inventory Inventory inventory = new Inventory(); Assert.IsTrue(inventory.ItemCounts.Values.Count == 0, "Brand-new inventory should have 0 items."); for (int i = 0; i < 5; i++) { inventory.AddItem(ItemDAO.CreateNewEquipmentItem("Longsword")); } Assert.IsTrue(inventory.Contains("Longsword"), "Inventory should have Longsword(s) in it."); Assert.IsTrue(inventory.ItemCounts["Longsword"] == 5, "Inventory should know it has 5 longswords available to dispense."); }
public Noble(string gender = "F") { Title = "Noble"; Gender = GetGender(gender); if (Gender == "Male") { Title = "Nobleman"; } else if (Gender == "Female") { Title = "Noblewoman"; } ProfessionSummary = "Wealthy and fashionable, a member of the noble class well-educated in " + "the art of oration. Has some training as a duelist, but has never been in a real fight."; BaseHealth = 20; BaseStamina = 10; BaseStaminaRegen = 10.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 3 }, { "DEX", 5 }, { "SKL", 7 }, { "APT", 5 }, { "FOR", 3 }, { "CHA", 8 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 0 }, { "Bestiary", 0 }, { "Engineering", 0 }, { "History", 2 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 3000), }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, // Rapier { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, // Bare Hand { "Body", ItemDAO.CreateNewEquipmentItem("Fancy Clothing") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Ladybug Brooch") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Heirloom Ring") } }; }
/// <summary> /// Toggles whether the primary weapon is being two-handed. If changing to two-handing, returns previously equipped offhand item. /// </summary> /// <returns></returns> public void Toggle2H() { if (Is2H) { Unequip("OffHand"); } else { if (Can2H) { Unequip("OffHand"); Slot["OffHand"] = ItemDAO.CreateNewEquipmentItem("Two-handing"); } // if can't 2H the main weapon, do nothing } }
public Huntress(string gender = "F") { Title = "Huntress"; Gender = GetGender(gender); if (gender == "Male") { Title = "Hunter"; } ProfessionSummary = $"A dangerous {(gender == "female" ? "huntress" : "hunter")} from the wildling " + $"tribes. Knows how to hunt nearly any creature, but has no social graces."; BaseHealth = 20; BaseStamina = 20; BaseStaminaRegen = 10.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 4 }, { "DEX", 8 }, { "SKL", 7 }, { "APT", 5 }, { "FOR", 4 }, { "CHA", 1 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 0 }, { "Bestiary", 3 }, { "Engineering", 0 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { // Mushroom Brew // Herbal Poultice // Witch's Ointment // Pungent Nuts }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public Knight(string gender = "M") { Title = "Knight"; Gender = GetGender(gender); ProfessionSummary = "Knights are masters of the longsword clad in sturdy plate armor; but " + "they often neglect their academic studies in favor of drinking and skirt-chasing."; BaseHealth = 20; BaseStamina = 20; BaseStaminaRegen = 15.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 7 }, { "DEX", 7 }, { "SKL", 7 }, { "APT", 2 }, { "FOR", 6 }, { "CHA", 4 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 2 }, { "Bestiary", 0 }, { "Engineering", 0 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 800), ItemDAO.CreateNewItem("Memento", 1) }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Longsword") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Two-handing") }, { "Body", ItemDAO.CreateNewEquipmentItem("Plate Armor") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Lover's Locket") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; StartingSkills = new List <Skill>(6) { new DoubleSlash(), null, null, null, null, null }; }
public Barmaid(string gender = "F") { Title = "Barmaid"; Gender = GetGender(gender); if (gender == "Male") { Title = "Barkeep"; } ProfessionSummary = $"The charming {(gender == "female" ? "young barmaid" : "barkeep")} from the local tavern. Strong and fast, with " + "a seemingly endless supply of drink, but no combat training."; BaseHealth = 40; BaseStamina = 20; BaseStaminaRegen = 15.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 7 }, { "DEX", 6 }, { "SKL", 1 }, { "APT", 4 }, { "FOR", 3 }, { "CHA", 8 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 0 }, { "Bestiary", 0 }, { "Engineering", 0 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 250), // Bottomless Beer Mug }; StartingEquipmentDict = new Dictionary <string, EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
/// <summary> /// Unequips an item and stores it in the inventory. /// </summary> /// <param name="slot"></param> public void Unequip(string slot) { // Hold the prior equipped item EquipmentItem priorEquipment = Slot[slot]; // 2H primary unequips the offhand as well if (Is2H && slot == "MainHand") { Toggle2H(); } // The actual slot unequip if (slot == "MainHand" || slot == "OffHand") { Slot[slot] = ItemDAO.CreateNewEquipmentItem("Bare Hand"); } else if (slot == "Body") { Slot[slot] = ItemDAO.CreateNewEquipmentItem("Naked"); } else if (slot.StartsWith("Charm")) { Slot[slot] = ItemDAO.CreateNewEquipmentItem("Unadorned"); } else { throw new ArgumentException("Tried to unequip an invalid slot."); } // Inventory handling post-unequip if ( // If the slot was empty priorEquipment.ItemName == "Bare Hand" || priorEquipment.ItemName == "Two-handing" || priorEquipment.ItemName == "Naked" || priorEquipment.ItemName == "Unadorned") { // Do nothing; } else { // Add item to the attached inventory. AttachedInventory.AddItem(priorEquipment); } }
public Footman(string gender = "M") { Title = "Footman"; Gender = GetGender(gender); ProfessionSummary = "A retired soldier. Greatly experienced with his spear and shield, but " + "his time in the military has left him uncouth, and old wounds slow him down."; BaseHealth = 20; BaseStamina = 20; BaseStaminaRegen = 10.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 4 }, { "DEX", 2 }, { "SKL", 7 }, { "APT", 4 }, { "FOR", 7 }, { "CHA", 3 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 3 }, { "Bestiary", 0 }, { "Engineering", 0 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 700), // Healing Elixir }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public Scholar(string gender = "M") { Title = "Scholar"; Gender = GetGender(gender); ProfessionSummary = "The scholar is a quick learner and widely knowledgeable, but spends more" + "time reading books than on physical pursuits."; BaseHealth = 20; BaseStamina = 15; BaseStaminaRegen = 10.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 2 }, { "DEX", 2 }, { "SKL", 3 }, { "APT", 9 }, { "FOR", 2 }, { "CHA", 3 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 1 }, { "Explosives", 0 }, { "Veterancy", 0 }, { "Bestiary", 1 }, { "Engineering", 1 }, { "History", 2 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 400), // Diploma }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("History Tome") }, { "Body", ItemDAO.CreateNewEquipmentItem("Clothing") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Quill and Inkwell") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public Alchemist(string gender = "M") { Title = "Alchemist"; Gender = GetGender(gender); ProfessionSummary = "Recently expelled from the university for burning down the " + "research hall, this pyromaniac may be more dangerous to their teammates than their enemies."; BaseHealth = 40; BaseStamina = 20; BaseStaminaRegen = 15.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 2 }, { "DEX", 2 }, { "SKL", 6 }, { "APT", 7 }, { "FOR", 3 }, { "CHA", 1 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 3 }, { "Veterancy", 0 }, { "Bestiary", 0 }, { "Engineering", 2 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 250), // singed portrait }; StartingEquipmentDict = new Dictionary <string, EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public Constable(string gender = "M") { Title = "Constable"; Gender = GetGender(gender); ProfessionSummary = "The town's venerable lawman. Knows his way around locks and is " + "well-versed in breaking up brawls. This stiffness of age is beginning to set in."; BaseHealth = 20; BaseStamina = 20; BaseStaminaRegen = 10.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 6 }, { "DEX", 3 }, { "SKL", 6 }, { "APT", 4 }, { "FOR", 5 }, { "CHA", 5 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 1 }, { "Bestiary", 0 }, { "Engineering", 1 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 1000), }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public Blacksmith(string gender = "M") { Title = "Blacksmith"; Gender = GetGender(gender); ProfessionSummary = "The town blacksmith is incredibly strong and knows all the weaknesses " + "of every kind of armor, but slow and gruff."; BaseHealth = 40; BaseStamina = 20; BaseStaminaRegen = 10.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 9 }, { "DEX", 2 }, { "SKL", 7 }, { "APT", 3 }, { "FOR", 6 }, { "CHA", 3 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 1 }, { "Veterancy", 0 }, { "Bestiary", 0 }, { "Engineering", 3 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 1200), }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public Squire(string gender = "M") { Title = "Squire"; Gender = GetGender(gender); ProfessionSummary = "A young farmboy from one of the surrounding villages, who's passing through " + "on his way to the castle to become a squire. Energetic, but clumsy."; BaseHealth = 20; BaseStamina = 30; BaseStaminaRegen = 15.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 5 }, { "DEX", 5 }, { "SKL", 2 }, { "APT", 4 }, { "FOR", 5 }, { "CHA", 5 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 0 }, { "Bestiary", 2 }, { "Engineering", 0 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 100), }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public PlagueDoctor(string gender = "F") { Title = "Plague Doctor"; Gender = GetGender(gender); ProfessionSummary = "This traveling surgeon wears an unsettling beak-shaped mask and " + "goggles. Her cures are of dubious merit, but the efficacy of her poisons is inarguable."; BaseHealth = 20; BaseStamina = 20; BaseStaminaRegen = 10.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 4 }, { "DEX", 3 }, { "SKL", 6 }, { "APT", 5 }, { "FOR", 6 }, { "CHA", 2 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 3 }, { "Explosives", 0 }, { "Veterancy", 0 }, { "Bestiary", 2 }, { "Engineering", 0 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { ItemDAO.CreateNewItem("Coins", 900), }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public Convict(string gender = "F") { Title = "Convict"; Gender = GetGender(gender); ProfessionSummary = "A thief arrested for attempting to steal horses, on their way " + "to the gallows. Weak, but exceptionally fast and clever."; BaseHealth = 20; BaseStamina = 20; BaseStaminaRegen = 20.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 2 }, { "DEX", 9 }, { "SKL", 5 }, { "APT", 7 }, { "FOR", 3 }, { "CHA", 4 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 1 }, { "Bestiary", 2 }, { "Engineering", 2 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { }; StartingEquipmentDict = new Dictionary <string, Items.Equipment.EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } }; }
public SecretProfession(string gender = "F") { Title = "Pony"; Gender = GetGender(gender); ProfessionSummary = "You've had about enough of these bandits and their horsing around."; BaseHealth = 100; BaseStamina = 40; BaseStaminaRegen = 20.0; StartingAttributesDict = new Dictionary <string, int>() { { "STR", 8 }, { "DEX", 8 }, { "SKL", 1 }, { "APT", 5 }, { "FOR", 5 }, { "CHA", 9 } }; StartingTalentsDict = new Dictionary <string, int>() { { "Medicine", 0 }, { "Explosives", 0 }, { "Veterancy", 1 }, { "Bestiary", 3 }, { "Engineering", 0 }, { "History", 0 } }; StartingInventoryList = new List <Item>() { }; StartingEquipmentDict = new Dictionary <string, EquipmentItem>() { { "MainHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, // Hoof { "OffHand", ItemDAO.CreateNewEquipmentItem("Bare Hand") }, // Hoof { "Body", ItemDAO.CreateNewEquipmentItem("Naked") }, // Shiny Fur Coat { "Charm 1", ItemDAO.CreateNewEquipmentItem("Unadorned") }, // Flower Ornament { "Charm 2", ItemDAO.CreateNewEquipmentItem("Unadorned") } // Tail Bow }; }