added tracker for when pawn last ingested human milk

This commit is contained in:
c0ffee 2021-11-17 09:59:06 -08:00
parent 994a525cb7
commit e1a817c55f
5 changed files with 58 additions and 2 deletions

View file

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;
namespace CRIALactation
{
public class ThoughtWorker_Precept_NoRecentHumanMilk : ThoughtWorker_Precept, IPreceptCompDescriptionArgs
{
public IEnumerable<NamedArgument> GetDescriptionArgs()
{
yield return MinDaysSinceLastHumanMeatForThought.Named("HUMANMILKREQUIREDINTERVAL");
}
protected override ThoughtState ShouldHaveThought(Pawn p)
{
int num = Mathf.Max(0, p.TryGetComp<CompInduceLactation>().lastHumanLactationIngestedTick);
return Find.TickManager.TicksGame - num > 480000;
}
public const int MinDaysSinceLastHumanMeatForThought = 8;
}
}