using RimWorld; using System.Collections.Generic; using Verse; namespace rjwquirks.Modules.Shared.PawnSelectors { public class HasStatValue : PawnSelector { public StatDef stat; public float minValue = float.MinValue; public float maxValue = float.MaxValue; public override bool PawnSatisfies(Pawn pawn) { float statValue = pawn.GetStatValue(stat); return minValue <= statValue && statValue <= maxValue; } public override IEnumerable ConfigErrors() { foreach (string error in base.ConfigErrors()) { yield return error; } if (stat == null) { yield return " is empty"; } if (minValue == float.MinValue && maxValue == float.MaxValue) { yield return " and/or should be filled"; } } } }