Beispiel #1
0
        private HeroItem CreateItemOfGivenRarity(RarityName rarityName, HeroItem originalItem)
        {
            var item   = originalItem.Copy();
            var rarity = RaritySuffix.FormatIdentifier(rarityName);

            item.Name = $"{item.Name}{rarity}";
            ImproveSkillInTheDescription(item.Description, rarityName);

            for (var i = 0; i < originalItem.SkillIDs.Count; i++)
            {
                item.SkillIDs[i] = $"{item.SkillIDs[i]}{rarity}";
            }

            item.DropCriteria = item.Descriptors
                                .First(x => x.Rarity.Name == rarityName)
                                .Rarity.DropCriteria.Copy();

            item.DropCriteria.ProbabilityWeight = originalItem.DropCriteria.ProbabilityWeight;

            item.Descriptors.Where(x => x.Rarity.Name != rarityName)
            .Select(x => x.Rarity.DropCriteria)
            .ForEach(criteria =>
            {
                criteria.MaxLevel = 0;
                criteria.MinLevel = 0;
            });

            return(item);
        }
Beispiel #2
0
        private IList <Skill> CreateSkillVersions(Skill skill)
        {
            var newSkills = _rarity
                            .Select((rarity, index) => new Skill
            {
                Name        = $"{skill.Name}{RaritySuffix.FormatIdentifier(rarity)}",
                Title       = GetImprovedSkillTitle(skill.Title.Copy(), rarity),
                Description = skill.Description,
                Icon        = skill.Icon,
                HiddenFromConfigurationFile = skill.HiddenFromConfigurationFile,
                Levels = CreateSkillLevelVersions(index, skill)
            })
                            .ToList();

            return(newSkills);
        }
Beispiel #3
0
 private string GetImprovedSkillTitle(string text, RarityName rarity)
 => $"{text}{RaritySuffix.GetSuffix(rarity)}";
Beispiel #4
0
 private string GetImprovedSkillDescriptionText(string text, RarityName rarity)
 {
     return(text.Replace("#Revert#", $"{RaritySuffix.GetSuffix(rarity)}#Revert#"));
 }