rjw-sexperience-ideology/Source/IdeologyAddon/PreceptWorkers/ThoughtWorker_Precept_BestialBreeding.cs
2025-01-27 21:36:30 +05:00

31 lines
840 B
C#

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;
}
}
}