Beispiel #1
0
        public void EquipItem(EqType eqItemType, Item item, Champion eqOwner)
        {
            switch (eqItemType)
            {
            case EqType.Body:
            {
                this.Body = (Armor)item;
                this.Body.Equip();
                this.AddModifiersToChampion(item, eqItemType, eqOwner);
                break;
            }

            case EqType.Boots:
            {
                this.Boots = (Armor)item;
                this.Boots.Equip();
                this.AddModifiersToChampion(item, eqItemType, eqOwner);
                break;
            }

            case EqType.Gloves:
            {
                this.Gloves = (Armor)item;
                this.Gloves.Equip();
                this.AddModifiersToChampion(item, eqItemType, eqOwner);
                break;
            }

            case EqType.Helmet:
            {
                this.Helmet = (Armor)item;
                this.Helmet.Equip();
                this.AddModifiersToChampion(item, eqItemType, eqOwner);
                break;
            }

            case EqType.Shield:
            {
                this.Shield = (Armor)item;
                this.Shield.Equip();
                this.AddModifiersToChampion(item, eqItemType, eqOwner);
                break;
            }

            case EqType.Trinket:
            {
                this.Trinket = (Armor)item;
                this.Trinket.Equip();
                this.AddModifiersToChampion(item, eqItemType, eqOwner);
                break;
            }

            case EqType.Weapon:
            {
                this.Weapon = (Weapon)item;
                this.Weapon.Equip();
                this.AddModifiersToChampion(item, eqItemType, eqOwner);
                break;
            }
            }
        }
Beispiel #2
0
        public void UnequipItem(EqType eqItemType, Champion eqOwner)
        {
            switch (eqItemType)
            {
            case EqType.Body:
            {
                this.Body.Unequip();
                this.RemoveModifiersFromChampion(eqItemType, eqOwner);
                this.Body = null;
                break;
            }

            case EqType.Boots:
            {
                this.Boots.Unequip();
                this.RemoveModifiersFromChampion(eqItemType, eqOwner);
                this.Boots = null;
                break;
            }

            case EqType.Gloves:
            {
                this.Gloves.Unequip();
                this.RemoveModifiersFromChampion(eqItemType, eqOwner);
                this.Gloves = null;
                break;
            }

            case EqType.Helmet:
            {
                this.Helmet.Unequip();
                this.RemoveModifiersFromChampion(eqItemType, eqOwner);
                this.Helmet = null;
                break;
            }

            case EqType.Shield:
            {
                this.Shield.Unequip();
                this.RemoveModifiersFromChampion(eqItemType, eqOwner);
                this.Shield = null;
                break;
            }

            case EqType.Trinket:
            {
                this.Trinket.Unequip();
                this.RemoveModifiersFromChampion(eqItemType, eqOwner);
                this.Trinket = null;
                break;
            }

            case EqType.Weapon:
            {
                this.Weapon.Unequip();
                this.RemoveModifiersFromChampion(eqItemType, eqOwner);
                this.Weapon = null;
                break;
            }
            }
        }
Beispiel #3
0
 public Equipment(Armor helmet, Armor body, Armor boots, Armor gloves, Armor shield, Armor trinket, Weapon weapon)
 {
     this.Helmet  = helmet;
     this.Body    = body;
     this.Boots   = boots;
     this.Weapon  = weapon;
     this.Gloves  = gloves;
     this.Shield  = shield;
     this.Trinket = trinket;
 }
Beispiel #4
0
        public Armor GenerateArmor(int itemLevel, ItemClass itemClass, ItemType itemType, EqType eqType)
        {
            Armor result = null;

            if (itemClass == ItemClass.Ranged && eqType == EqType.Shield)
            {
                return(result);
            }

            ItemIcon     itemIcon  = this.GenerateItemIcon(itemClass, itemType, eqType);
            string       itemName  = this.GenerateItemName(itemClass, eqType);
            int          goldValue = this.GenerateItemGoldValue(itemLevel);
            double       itemWeight;
            ItemFeatures itemFeatures = new ItemFeatures();

            itemFeatures.EnableFeatures(ItemFeaturesType.IsDeleteAble, ItemFeaturesType.IsEquipAble,
                                        ItemFeaturesType.IsInfoAble, ItemFeaturesType.IsRepairAble, ItemFeaturesType.IsSellAble,
                                        ItemFeaturesType.IsUpgradeAble);

            if (itemType == ItemType.Armor)
            {
                itemWeight = Math.Round(CryptoRandom.NextDouble(0, 5), 2, MidpointRounding.AwayFromZero);

                Armor armor = null;

                switch (itemClass)
                {
                case ItemClass.Magic:
                {
                    armor = new Armor(itemClass, itemType, ItemSubType.None, itemIcon, eqType, itemFeatures,
                                      itemName, string.Empty, goldValue, itemWeight, false, false, 100, itemLevel, 0,
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Normal),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaIncrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease));
                    break;
                }

                case ItemClass.Melle:
                {
                    armor = new Armor(itemClass, itemType, ItemSubType.None, itemIcon, eqType, itemFeatures,
                                      itemName, string.Empty, goldValue, itemWeight, false, false, 100, itemLevel, 0,
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaIncrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaIncrease));
                    break;
                }

                case ItemClass.Ranged:
                {
                    armor = new Armor(itemClass, itemType, ItemSubType.None, itemIcon, eqType, itemFeatures,
                                      itemName, string.Empty, goldValue, itemWeight, false, false, 100, itemLevel, 0,
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Normal),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Normal),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaIncrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                      StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease));
                    break;
                }
                }

                result = armor;
            }
            else if (itemType == ItemType.Trinket)
            {
                itemWeight = Math.Round(CryptoRandom.NextDouble(0, 2), 2, MidpointRounding.AwayFromZero);

                Armor trinket = null;

                switch (itemClass)
                {
                case ItemClass.Magic:
                {
                    trinket = new Armor(itemClass, itemType, ItemSubType.None, itemIcon, eqType, itemFeatures,
                                        itemName, string.Empty, goldValue, itemWeight, false, false, 100, itemLevel, 0,
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Normal),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaIncrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease));
                    break;
                }

                case ItemClass.Melle:
                {
                    trinket = new Armor(itemClass, itemType, ItemSubType.None, itemIcon, eqType, itemFeatures,
                                        itemName, string.Empty, goldValue, itemWeight, false, false, 100, itemLevel, 0,
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Normal),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaIncrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease));
                    break;
                }

                case ItemClass.Ranged:
                {
                    trinket = new Armor(itemClass, itemType, ItemSubType.None, itemIcon, eqType, itemFeatures,
                                        itemName, string.Empty, goldValue, itemWeight, false, false, 100, itemLevel, 0,
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Normal),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Decrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaIncrease),
                                        StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease));
                    break;
                }
                }

                result = trinket;
            }

            return(result);
        }