private void DefineStackSize(TypeValue type, RarityValue rarity) { var minStack = type.MinStackBase; var maxStack = type.MaxStackBase; TypeToRarityStackSizes[type.Type][rarity.Rarity] = new ItemStack(minStack, maxStack); }
private void DefineItemLevel(TypeValue type, RarityValue rarity) { var minLevel = rarity.MinLevelBase; var maxLevel = rarity.MaxLevelBase; TypeToRarityItemLevels[type.Type][rarity.Rarity] = new ItemLevel(minLevel, maxLevel); }
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 ); }
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)); } }