コード例 #1
0
        private void DefineStackSize(TypeValue type, RarityValue rarity)
        {
            var minStack = type.MinStackBase;
            var maxStack = type.MaxStackBase;

            TypeToRarityStackSizes[type.Type][rarity.Rarity] = new ItemStack(minStack, maxStack);
        }
コード例 #2
0
        private void DefineItemLevel(TypeValue type, RarityValue rarity)
        {
            var minLevel = rarity.MinLevelBase;
            var maxLevel = rarity.MaxLevelBase;

            TypeToRarityItemLevels[type.Type][rarity.Rarity] = new ItemLevel(minLevel, maxLevel);
        }
コード例 #3
0
 private void DefineItemData(TypeValue type, RarityValue rarity)
 {
     TypeToRarityItemDatas[type.Type][rarity.Rarity] = new ItemData(
         typeReputationPercentage: type.RarityReputationPercentage,
         rarityReputation: rarity.ReputationBase,
         flags: new HashSet <ItemFlags>(type.Flags),
         upgradeExp: rarity.UpgradeExperienceBase,
         upgradeExpPercentage: type.UpgradeExperiencePercentage,
         priceBase: rarity.PriceBase,
         finalSellPricePercentage: type.FinalSellPricePercentage,
         finalBuyPricePercentage: type.FinalBuyPricePercentage
         );
 }
コード例 #4
0
        public GameItemGenerator(GameItemData data)
        {
            this.data   = data;
            RarityOrder = Enum.GetValues(typeof(ItemRarity)).Cast <ItemRarity>().OrderByDescending(r => r).ToList();
            foreach (ItemRarity rarity in RarityOrder)
            {
                RarityLastDropCount[rarity] = 0;
                RarityValue rarityData = data.Rarities.First(r => r.Rarity == rarity);
                RarityValues[rarity]  = rarityData;
                MaxRarityRandomValue += rarityData.ChanceBase;
                RarityMaxRanges.Add(new KeyValuePair <ItemRarity, float>(rarity, MaxRarityRandomValue));
            }

            foreach (var typeData in data.Types.OrderByDescending(r => r.ChanceBase))
            {
                MaxTypeRandomValue += typeData.ChanceBase;
                TypeMaxRanges.Add(new KeyValuePair <ItemType, float>(typeData.Type, MaxTypeRandomValue));
            }
        }