private void GetValidTargets(IEnumerable <Pawn> targets) { targetList.Clear(); foreach (var target in targets) { if (!TargetRange.Contains(target.Position.DistanceTo(User.Position)) || Ability.SuccessChanceOnTarget(target) < MinSuccessChance || !TargetMatchesTargetType(target) || AdditionalFilters.Any(filter => !filter.TargetMeetsFilter(target))) { continue; } targetList.Add(target); } }
private int GetValidTargetsCount(IEnumerable <Pawn> targets) { return(targets.Count(target => TargetRange.Contains(target.Position.DistanceTo(User.Position)) && TargetMatchesTargetType(target) && AdditionalFilters.All(filter => filter.TargetMeetsFilter(target)))); }