using RimWorld; using rjw; using System.Linq; using Verse; namespace RJWSexperience.Ideology.PreceptWorkers { public class ThoughtWorker_Precept_BestialBreeding : ThoughtWorker_Precept { protected override ThoughtState ShouldHaveThought(Pawn p) { if (p?.DevelopmentalStage == DevelopmentalStage.Adult) { Map map = p.Map; if (map != null) { foreach (var pawnOnMap in map.mapPawns.AllPawns.Where(x => xxx.is_animal(x) && PawnExtensions.IsVisiblyPregnant(x))) { if (pawnOnMap != p && IdeoUtility.IsFatherOfPregnancy(pawnOnMap, p)) // Check if this pawn is the father of p { return ThoughtState.ActiveDefault; // Active thought if the pawn is the father } } } } // Return default (inactive) if no valid conditions were met return ThoughtState.Inactive; } } }