private RequiredFeatSelection ParseRequiredFeatData(string requiredFeatData) { var splitData = requiredFeatData.Split('/'); var requiredFeat = new RequiredFeatSelection(); requiredFeat.Feat = splitData[0]; if (splitData.Length > 1) { requiredFeat.Foci = splitData[1].Split(','); } return(requiredFeat); }
public void Setup() { requiredFeatSelection = new RequiredFeatSelection(); otherFeats = new List <Feat>(); }
//INFO: Automatic Proficiencies include things such as Unarmed Strike, Grapple, and Ray private IEnumerable <string> GetProficiencies(string focusType, IEnumerable <Feat> otherFeats, RequiredFeatSelection weaponProficiencyRequirement, IEnumerable <Attack> attacks) { var proficiencyFeatNames = collectionsSelector.SelectFrom(TableNameConstants.Collection.FeatGroups, GroupConstants.WeaponProficiency); var proficiencyFeats = otherFeats.Where(f => proficiencyFeatNames.Contains(f.Name)); var proficiencyFoci = new List <string>(); foreach (var proficiencyFeat in proficiencyFeats) { foreach (var focus in proficiencyFeat.Foci) { if (focus != GroupConstants.All) { proficiencyFoci.Add(focus); } else { var explodedFoci = GetExplodedFoci(proficiencyFeat.Name, GroupConstants.All, otherFeats); proficiencyFoci.AddRange(explodedFoci); } } } var foci = collectionsSelector.SelectFrom(TableNameConstants.Collection.FeatFoci, focusType); var weaponFoci = collectionsSelector.SelectFrom(TableNameConstants.Collection.FeatFoci, FeatConstants.Foci.Weapon); var automaticFoci = foci.Except(weaponFoci); proficiencyFoci.AddRange(automaticFoci); var naturalAttacks = attacks.Where(a => a.IsNatural).Select(a => a.Name); proficiencyFoci.AddRange(naturalAttacks); if (weaponProficiencyRequirement.Foci.Any()) { return(proficiencyFoci.Intersect(weaponProficiencyRequirement.Foci)); } return(proficiencyFoci); }