rjw-sexperience-ideology/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs

30 lines
1 KiB
C#
Raw Normal View History

2022-08-10 18:52:32 +00:00
using RimWorld;
using Verse;
using rjw;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
{
/// <summary>
/// thought worker for a thought that is active when a certain hediff is present, and who's stage depends on the ether state of the pawn
/// Shamelessly taken from: https://github.com/Tachyonite/Pawnmorpher/blob/master/Source/Pawnmorphs/Esoteria/Thoughts/ThoughtWorker_EtherHediff.cs
/// </summary>
public class ThoughtWorker_Precept_NonPregnant : ThoughtWorker_Precept
{
/// <summary>Gets the current thought state of the given pawn.</summary>
/// <param name="p">The pawn for whom the thoughts are generated.</param>
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p)
{
var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
if (pregnancy == null)
{
return ThoughtState.Inactive;
}
return ThoughtState.ActiveAtStage(0);
}
}
}