private List<Shield> GenerateShields() { List<Shield> shieldList = new List<Shield>(); Shield shield1 = new Shield(); Shield shield2 = new Shield(); Shield shield3 = new Shield(); shield1 = itemGenerator.GenerateShield(0); shield2 = itemGenerator.GenerateShield(1); shield3 = itemGenerator.GenerateShield(2); shieldList.Add(shield1); shieldList.Add(shield2); shieldList.Add(shield3); return shieldList; }
public Shield GenerateShield(int _shieldValue) { Shield genShield = new Shield(); if (_shieldValue == 0) { genShield.ShieldArmor = rnd.Next(0, 101); genShield.ShieldBlockChance = rnd.Next(0, 6); genShield.BuyPrice = rnd.Next(30, 71); genShield.ShieldName = SetSheildName(genShield); } if (_shieldValue == 1) { genShield.ShieldArmor = rnd.Next(20, 201); genShield.ShieldBlockChance = rnd.Next(0, 16); genShield.BuyPrice = rnd.Next(71, 140); genShield.ShieldName = SetSheildName(genShield); } if (_shieldValue == 2) { genShield.ShieldArmor = rnd.Next(100, 301); genShield.ShieldBlockChance = rnd.Next(0, 21); genShield.BuyPrice = rnd.Next(141, 280); genShield.ShieldName = SetSheildName(genShield); } if (_shieldValue == 3) { genShield.ShieldArmor = rnd.Next(200, 401); genShield.ShieldBlockChance = rnd.Next(10, 31); genShield.BuyPrice = rnd.Next(281, 560); genShield.ShieldName = SetSheildName(genShield); } return genShield; }
public void UnEquipShield(Shield _shield) { armor = armor - _shield.ShieldArmor; blockChance = blockChance - _shield.ShieldBlockChance; shieldEquiped = false; }
//- //Shield Methods //- public void EquipShield(Shield _shield) { if (_shield != null) { armor = armor + _shield.ShieldArmor; blockChance = blockChance + _shield.ShieldBlockChance; shieldEquiped = true; } }
//- //SET ITEM NAMES //- //Set Shield Name public string SetSheildName(Shield _genItem) { string itemName = ""; //Set Rarity Name if (_genItem.ShieldArmor < 101) { itemName += itemRarityNames[0]; _genItem.Rarity = 1; } if (_genItem.ShieldArmor > 100 && _genItem.ShieldArmor < 201) { itemName += itemRarityNames[1]; _genItem.Rarity = 2; } if (_genItem.ShieldArmor > 200 && _genItem.ShieldArmor < 301) { itemName += itemRarityNames[2]; _genItem.Rarity = 3; } if (_genItem.ShieldArmor > 300 && _genItem.ShieldArmor < 401) { itemName += itemRarityNames[3]; _genItem.Rarity = 4; } //Set Rank Name if (_genItem.ShieldBlockChance < 6) { itemName += " " + ItemRankNames[0]; _genItem.Rank = 1; _genItem.ImgPath = "Images/Shield1.png"; } if (_genItem.ShieldBlockChance > 5 && _genItem.ShieldBlockChance < 16) { itemName += " " + ItemRankNames[1]; _genItem.Rank = 2; _genItem.ImgPath = "Images/Shield2.png"; } if (_genItem.ShieldBlockChance > 15 && _genItem.ShieldBlockChance < 21) { itemName += " " + ItemRankNames[2]; _genItem.Rank = 3; _genItem.ImgPath = "Images/Shield3.png"; } if (_genItem.ShieldBlockChance > 20 && _genItem.ShieldBlockChance < 31) { itemName += " " + ItemRankNames[3]; _genItem.Rank = 4; _genItem.ImgPath = "Images/Shield4.png"; } //Set Type Name itemName += " " + ItemTypeNames[1]; return itemName; }