rjw_menstruation/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs

29 lines
780 B
C#
Raw Normal View History

using HarmonyLib;
2021-08-13 15:29:43 +00:00
using Milk;
using RJW_Menstruation;
using System.Reflection;
using Verse;
2021-08-13 15:29:43 +00:00
namespace MilkModule
{
internal static class First
{
static First()
{
Harmony har = new Harmony("RJW_Menstruation_MilkModule");
2021-08-13 15:29:43 +00:00
har.PatchAll(Assembly.GetExecutingAssembly());
}
}
[HarmonyPatch(typeof(HumanCompHasGatherableBodyResource), nameof(HumanCompHasGatherableBodyResource.Gathered))]
2021-08-13 15:29:43 +00:00
public static class Milk_Patch
{
public static void Postfix(HumanCompHasGatherableBodyResource __instance)
2021-08-13 15:29:43 +00:00
{
if (__instance.parent is Pawn pawn)
2022-08-31 16:13:04 +00:00
pawn.GetBreastComp()?.AdjustNippleProgress(Rand.Range(0.0f, 0.005f) * Configurations.MaxNippleIncrementFactor);
2021-08-13 15:29:43 +00:00
}
}
}