예제 #1
0
        public Item GenerateJunk(ItemSubType itemSubType)
        {
            Item result = null;

            int      goldValue;
            ItemIcon itemIcon = this.GenerateItemIcon(ItemClass.Normal, ItemType.Junk, EqType.None, itemSubType);

            itemIcon.Rarity = (int)ItemRarity.None;

            ItemFeatures itemFeatures = new ItemFeatures();

            itemFeatures.EnableFeatures(ItemFeaturesType.IsDeleteAble, ItemFeaturesType.IsSellAble, ItemFeaturesType.IsInfoAble);

            switch (itemSubType)
            {
            case ItemSubType.Junk_BodyParts:
            {
                goldValue = CryptoRandom.Next(20, 50);
                result    = new Item(ItemClass.Normal, ItemType.Junk, itemSubType, itemIcon, itemFeatures,
                                     "Body part", string.Empty, goldValue, 0.5, 0);
                break;
            }

            case ItemSubType.Junk_Gems:
            {
                goldValue = CryptoRandom.Next(100, 500);
                result    = new Item(ItemClass.Normal, ItemType.Junk, itemSubType, itemIcon, itemFeatures,
                                     "Gem", string.Empty, goldValue, 0.5, 0);
                break;
            }

            case ItemSubType.Junk_Generic:
            {
                goldValue = CryptoRandom.Next(20, 60);
                result    = new Item(ItemClass.Normal, ItemType.Junk, itemSubType, itemIcon, itemFeatures,
                                     "Strange thing", string.Empty, goldValue, 0.5, 0);
                break;
            }

            case ItemSubType.Junk_Gold:
            {
                goldValue = CryptoRandom.Next(100, 300);
                result    = new Item(ItemClass.Normal, ItemType.Junk, itemSubType, itemIcon, itemFeatures,
                                     "Golden item", string.Empty, goldValue, 0.5, 0);
                break;
            }

            case ItemSubType.Junk_Minerals:
            {
                goldValue = CryptoRandom.Next(50, 200);
                result    = new Item(ItemClass.Normal, ItemType.Junk, itemSubType, itemIcon, itemFeatures,
                                     "Mineral", string.Empty, goldValue, 0.5, 0);
                break;
            }
            }

            return(result);
        }
예제 #2
0
        public Weapon GenerateWeapon(int itemLevel, ItemClass itemClass)
        {
            Weapon result = null;

            ItemIcon     itemIcon     = this.GenerateItemIcon(itemClass, ItemType.Weapon);
            string       itemName     = this.GenerateItemName(itemClass, EqType.Weapon);
            int          goldValue    = this.GenerateItemGoldValue(itemLevel);
            double       itemWeight   = Math.Round(CryptoRandom.NextDouble(0, 5), 2, MidpointRounding.AwayFromZero);
            ItemFeatures itemFeatures = new ItemFeatures();

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

            switch (itemClass)
            {
            case ItemClass.Magic:
            {
                result = new Weapon(itemClass, ItemType.Weapon, ItemSubType.None, itemIcon, EqType.Weapon,
                                    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.Normal),
                                    StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease),
                                    StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.Increase),
                                    StatisticsGenerator.GenerateItemStatistics(itemLevel, ItemIndexManagement.GetRarityFromIndex(itemIcon.Rarity), StatisticsGeneratorBoostType.MegaDecrease));
                break;
            }

            case ItemClass.Melle:
            {
                result = new Weapon(itemClass, ItemType.Weapon, ItemSubType.None, itemIcon, EqType.Weapon,
                                    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.Normal),
                                    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.Increase));

                break;
            }

            case ItemClass.Ranged:
            {
                result = new Weapon(itemClass, ItemType.Weapon, ItemSubType.None, itemIcon, EqType.Weapon,
                                    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.Normal),
                                    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));
                break;
            }
            }

            return(result);
        }
예제 #3
0
        public ConsumeableItem GenerateConsumeableItem(ItemType itemType, ItemSubType itemSubType)
        {
            ConsumeableItem result = null;

            int      goldValue;
            int      boost;
            ItemIcon itemIcon = this.GenerateItemIcon(ItemClass.Normal, itemType, EqType.None, itemSubType);

            itemIcon.Rarity = (int)ItemRarity.None;
            ItemFeatures itemFeatures = new ItemFeatures();

            itemFeatures.EnableFeatures(ItemFeaturesType.IsDeleteAble, ItemFeaturesType.IsInfoAble, ItemFeaturesType.IsSellAble, ItemFeaturesType.IsEatAble);

            switch (itemType)
            {
            case ItemType.Potion:
            {
                switch (itemSubType)
                {
                case ItemSubType.Potion_Armor:
                {
                    goldValue = CryptoRandom.Next(200, 500);
                    boost     = CryptoRandom.Next(8, 15);
                    result    = new ConsumeableItem(boost, ItemClass.Normal, itemType, itemSubType, itemIcon,
                                                    itemFeatures, "Armor Potion", string.Empty, goldValue, 0.5);
                    break;
                }

                case ItemSubType.Potion_Dexterity:
                {
                    goldValue = CryptoRandom.Next(200, 500);
                    boost     = CryptoRandom.Next(8, 15);
                    result    = new ConsumeableItem(boost, ItemClass.Normal, itemType, itemSubType, itemIcon,
                                                    itemFeatures, "Dexterity Potion", string.Empty, goldValue, 0.5);
                    break;
                }

                case ItemSubType.Potion_Health:
                {
                    goldValue = 50;
                    boost     = 60;
                    result    = new ConsumeableItem(boost, ItemClass.Normal, itemType, itemSubType, itemIcon,
                                                    itemFeatures, "Health Potion", string.Empty, goldValue, 0.5);
                    break;
                }

                case ItemSubType.Potion_Intelligence:
                {
                    goldValue = CryptoRandom.Next(200, 500);
                    boost     = CryptoRandom.Next(8, 15);
                    result    = new ConsumeableItem(boost, ItemClass.Normal, itemType, itemSubType, itemIcon,
                                                    itemFeatures, "Intelligence Potion", string.Empty, goldValue, 0.5);
                    break;
                }

                case ItemSubType.Potion_Mana:
                {
                    goldValue = 50;
                    boost     = 60;
                    result    = new ConsumeableItem(boost, ItemClass.Normal, itemType, itemSubType, itemIcon,
                                                    itemFeatures, "Mana Potion", string.Empty, goldValue, 0.5);
                    break;
                }

                case ItemSubType.Potion_Strength:
                {
                    goldValue = CryptoRandom.Next(200, 500);
                    boost     = CryptoRandom.Next(8, 15);
                    result    = new ConsumeableItem(boost, ItemClass.Normal, itemType, itemSubType, itemIcon,
                                                    itemFeatures, "Armor Potion", string.Empty, goldValue, 0.5);
                    break;
                }

                default:
                {
                    break;
                }
                }
                break;
            }

            case ItemType.Food:
            {
                boost     = CryptoRandom.Next(20, 50);
                goldValue = CryptoRandom.Next(20, 60);
                result    = new ConsumeableItem(boost, ItemClass.Normal, itemType, itemSubType, itemIcon,
                                                itemFeatures, "Food" +
                                                "", string.Empty, goldValue, CryptoRandom.NextDouble(0.3, 1));
                break;
            }
            }

            return(result);
        }
예제 #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);
        }