public Player() { myLevel = 1; myEXP = 0; myRequiredEXP = 50; myStrength = Utilities.Utility.GetRNG().Next(5, 11); myAgility = Utilities.Utility.GetRNG().Next(5, 11); myMaxStamina = Utilities.Utility.GetRNG().Next(100, 121); myIntelligence = Utilities.Utility.GetRNG().Next(5, 11); myWisdom = Utilities.Utility.GetRNG().Next(5, 11); myLuck = Utilities.Utility.GetRNG().Next(5, 11); myMaxHealth = 100; myMaxMana = 100; myMana = myMaxMana; myDamage = 15; mySpellDamage = 20; myGold = 50; myHPPotionAmount = 1; myManaPotionAmount = 1; myInventoryCapacity = 50; myInventory = new List <Loot.Item>(); myAppliedScrolls = new List <Loot.Scroll>(); myEquippedTrinket = new Loot.Trinket(Localisation.Language.GetBasicness()); myEquippedTrinket.ApplyBuff(this); myEquippedHelmet = new Loot.Armour(Loot.ItemType.HELMET, Localisation.Language.GetBasicness(), 2); myEquippedChestplate = new Loot.Armour(Loot.ItemType.CHESTPLATE, Localisation.Language.GetBasicness(), 4); myEquippedTrousers = new Loot.Armour(Loot.ItemType.TROUSERS, Localisation.Language.GetBasicness(), 3); myEquippedBoots = new Loot.Armour(Loot.ItemType.BOOTS, Localisation.Language.GetBasicness(), 1); myEquippedWeapon = new Loot.Weapon(Localisation.Language.GetBasicness(), 15); myEquippedShield = new Loot.Armour(Loot.ItemType.SHIELD, Localisation.Language.GetBasicness(), 5); myArmourRating = myEquippedBoots.GetRating() + myEquippedTrousers.GetRating() + myEquippedChestplate.GetRating() + myEquippedHelmet.GetRating() + myEquippedShield.GetRating() + myArmourBuff; myInventory.Add(Factories.LootFactory.CreateScroll()); myStamina = myMaxStamina; myHealth = myMaxHealth * myStamina / 100; myIsDefending = false; }
/// <summary> /// Equips the player with given item /// </summary> /// <param name="anItem">Item to equip</param> public void Equip(Item anItem) { Item tempItem; switch (anItem.GetItemType()) { case ItemType.HELMET: tempItem = myEquippedHelmet; myEquippedHelmet = anItem; if (myInventory.Contains(anItem)) { myInventory.Remove(anItem); } myInventory.Add(tempItem); break; case ItemType.CHESTPLATE: tempItem = myEquippedChestplate; myEquippedChestplate = anItem; if (myInventory.Contains(anItem)) { myInventory.Remove(anItem); } myInventory.Add(tempItem); break; case ItemType.TROUSERS: tempItem = myEquippedTrousers; myEquippedTrousers = anItem; if (myInventory.Contains(anItem)) { myInventory.Remove(anItem); } myInventory.Add(tempItem); break; case ItemType.BOOTS: tempItem = myEquippedBoots; myEquippedBoots = anItem; if (myInventory.Contains(anItem)) { myInventory.Remove(anItem); } myInventory.Add(tempItem); break; case ItemType.WEAPON: tempItem = myEquippedWeapon; myEquippedWeapon = anItem; if (myInventory.Contains(anItem)) { myInventory.Remove(anItem); } myInventory.Add(tempItem); break; case ItemType.SHIELD: tempItem = myEquippedShield; myEquippedShield = anItem; if (myInventory.Contains(anItem)) { myInventory.Remove(anItem); } myInventory.Add(tempItem); break; case ItemType.TRINKET: tempItem = myEquippedTrinket; myEquippedTrinket = (Trinket)anItem; ResetBuffs(); myEquippedTrinket.ApplyBuff(this); if (myInventory.Contains(anItem)) { myInventory.Remove(anItem); } myInventory.Add(tempItem); break; } myDamage = myEquippedWeapon.GetRating(); myArmourRating = myEquippedBoots.GetRating() + myEquippedTrousers.GetRating() + myEquippedChestplate.GetRating() + myEquippedHelmet.GetRating() + myEquippedShield.GetRating() + myArmourBuff; }