2021-07-26 04:06:00 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Verse;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
using rjw;
|
|
|
|
|
using Milk;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace CRIALactation
|
|
|
|
|
{
|
|
|
|
|
public class ThoughtWorker_Precept_Lactating_Essential : ThoughtWorker_Precept
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
protected override ThoughtState ShouldHaveThought(Pawn p)
|
|
|
|
|
{
|
2021-07-26 15:19:49 +00:00
|
|
|
|
|
|
|
|
|
if (!p.IsColonistPlayerControlled) return false;
|
|
|
|
|
|
2021-07-26 04:06:00 +00:00
|
|
|
|
if (ThoughtUtility.ThoughtNullified(p, this.def))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-07-26 15:19:49 +00:00
|
|
|
|
if(!LactationUtility.HasMilkableBreasts(p))
|
2021-07-26 04:06:00 +00:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(LactationUtility.IsLactating(p))
|
|
|
|
|
{
|
|
|
|
|
return ThoughtState.ActiveAtStage(0);
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-26 15:19:49 +00:00
|
|
|
|
if(ExpectationsUtility.CurrentExpectationFor(p).order <= ExpectationDefOf.VeryLow.order)
|
|
|
|
|
{
|
|
|
|
|
return ThoughtState.ActiveAtStage(1);
|
|
|
|
|
}
|
|
|
|
|
else if(ExpectationsUtility.CurrentExpectationFor(p).order <= ExpectationDefOf.Moderate.order)
|
|
|
|
|
{
|
|
|
|
|
return ThoughtState.ActiveAtStage(2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return ThoughtState.ActiveAtStage(3);
|
|
|
|
|
}
|
2021-07-26 04:06:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|