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); }
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); }
private string GetImprovedSkillTitle(string text, RarityName rarity) => $"{text}{RaritySuffix.GetSuffix(rarity)}";
private string GetImprovedSkillDescriptionText(string text, RarityName rarity) { return(text.Replace("#Revert#", $"{RaritySuffix.GetSuffix(rarity)}#Revert#")); }