2021-11-17 17:59:06 +00:00
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Verse;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
|
|
|
|
|
namespace CRIALactation
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPatch(typeof(Thing), "Ingested")]
|
|
|
|
|
public static class HarmonyPatch_Thing
|
|
|
|
|
{
|
|
|
|
|
public static void Prefix(Thing __instance, Pawn ingester)
|
|
|
|
|
{
|
|
|
|
|
|
2022-06-04 03:13:18 +00:00
|
|
|
|
if(__instance?.def == ThingDefOf_Milk.HumanMilk || __instance?.def == ThingDefOf_Milk.HumanoidMilk)
|
2021-11-17 17:59:06 +00:00
|
|
|
|
{
|
2022-06-04 03:13:18 +00:00
|
|
|
|
if (ingester.TryGetComp<CompInduceLactation>() == null) return;
|
2021-11-17 17:59:06 +00:00
|
|
|
|
ingester.TryGetComp<CompInduceLactation>().lastHumanLactationIngestedTick = Find.TickManager.TicksGame;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|