private ValueBuilder GetAdditionalValueFromSupportingSkills( IReadOnlyDictionary <Skill, ValueBuilder> supportingSkills, SkillBaseItemDefinition baseItem) { var valueBuilder = new ValueBuilder(_valueBuilders.Create(0)); foreach (var(supportingSkill, supportValueBuilder) in supportingSkills) { valueBuilder += _valueBuilders.If(_metaStatBuilders.SkillIsEnabled(supportingSkill).IsTrue) .Then(supportValueBuilder.Select(d => SelectActiveAdditionalLevels(supportingSkill, (int)d), v => $"SelectActiveAdditionalLevels({supportingSkill.Id}, {supportingSkill.Level}, {v})")) .Else(0); } return(valueBuilder); int SelectActiveAdditionalLevels(Skill supportingSkill, int supportAdditionalLevels) { var value = 0; foreach (var untranslatedStat in GetLevelStats(supportingSkill, supportAdditionalLevels)) { var match = SkillStatIds.SupportedSkillGemLevelRegex.Match(untranslatedStat.StatId); var tag = match.Groups[1].Value; if (tag == "active" || baseItem.GemTags.Contains(tag)) { value += untranslatedStat.Value; } } return(value); } }
private SkillDefinition( string id, int numericId, bool isSupport, string statTranslationFile, IReadOnlyList <string> partNames, SkillBaseItemDefinition baseItem, ActiveSkillDefinition activeSkill, SupportSkillDefinition supportSkill, IReadOnlyDictionary <int, SkillLevelDefinition> levels) => (Id, NumericId, IsSupport, PartNames, BaseItem, ActiveSkill, SupportSkill, Levels, StatTranslationFile) =