coffees-rjw-ideology-addons/CRIALactation/Source/HarmonyPatches/HarmonyPatch_Thing.cs
c0ffee 5b4b203d13 replaced compinducelactation with hediffcomp; cleaner
todo:
add abilitydef to hucow handler to begin inducing lactation; give lactation induction hediff to recipient pawn
add thoughtdef w/ thoughtworker_hediff to give pawns thoughts on inducing lactation
2022-10-14 18:10:00 -07:00

26 lines
713 B
C#

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)
{
if(__instance?.def == ThingDefOf_Milk.HumanMilk || __instance?.def == ThingDefOf_Milk.HumanoidMilk)
{
if (ingester.TryGetComp<CompLactation>() == null) return;
ingester.TryGetComp<CompLactation>().lastHumanLactationIngestedTick = Find.TickManager.TicksGame;
}
}
}
}