public static bool IsMinor(this SettingHindrance hindrance) { return(hindrance.Type == "Minor" || hindrance.Type == "Minor/Major"); }
void ApplyHindrance(Character result, SettingHindrance hindrance, int level) { result.Hindrances.Add(new Hindrance() { Name = hindrance.Name, Description = hindrance.Description, Level = level }); if (hindrance.Trait != null) foreach (var item in hindrance.Trait) result.Increment(item.Name, item.Bonus); if (hindrance.Features != null) foreach (var item in hindrance.Features) result.Features.Add(item.Name); if (hindrance.Skill != null) foreach (var item in hindrance.Skill) { var skill = result.Skills.FirstOrDefault(s => s.Name == item.Name); if (skill == null) result.Skills.Add(new Skill(item.Name, item.Attribute) { Trait = item.Level }); else if (skill.Trait < item.Level) skill.Trait = item.Level; } }