private ValueBuilder GetAdditionalQualityFromSupportingSkills(IReadOnlyList <Skill> supportingSkills) { var valueBuilder = new ValueBuilder(_valueBuilders.Create(0)); foreach (var supportingSkill in supportingSkills) { var supportValueBuilder = _gemStatBuilders.AdditionalLevels(supportingSkill).Value; valueBuilder += _valueBuilders.If(_metaStatBuilders.SkillIsEnabled(supportingSkill).IsTrue) .Then(supportValueBuilder.Select(d => SelectActiveAdditionalQuality(supportingSkill, (int)d), v => $"SelectActiveAdditionalQuality({supportingSkill.Id}, {supportingSkill.Level}, {v})")) .Else(0);; } return(valueBuilder); int SelectActiveAdditionalQuality(Skill supportingSkill, int supportAdditionalLevels) { var value = 0; foreach (var untranslatedStat in GetLevelStats(supportingSkill, supportAdditionalLevels)) { if (SkillStatIds.SupportedSkillGemQualityRegex.IsMatch(untranslatedStat.StatId)) { value += untranslatedStat.Value; } } return(value); } }
protected override IStatBuilder GetAdditionalStatBuilder(Skill skill) => _gemStatBuilders.AdditionalLevels(skill).Maximum;