mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using RimWorld;
|
|
using Verse;
|
|
using Verse.AI;
|
|
using rjw;
|
|
using RJW_Menstruation;
|
|
using HarmonyLib;
|
|
using RJWSexperience;
|
|
|
|
namespace RJW_Menstruation.Sexperience
|
|
{
|
|
[HarmonyPatch(typeof(WorkGiver_CleanSelf))]
|
|
public static class RJW_Patch_WorkGiver_CleanSelf
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch("HasJobOnThing")]
|
|
public static bool HasJobOnThing(Pawn pawn, Thing t, bool forced, ref bool __result)
|
|
{
|
|
HediffComp_Menstruation comp = pawn.GetMenstruationComp();
|
|
if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f && pawn.Map.listerBuildings.ColonistsHaveBuilding(VariousDefOf.CumBucket))
|
|
{
|
|
__result = true;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch("JobOnThing")]
|
|
public static void JobOnThing(Pawn pawn, Thing t, bool forced, ref Job __result)
|
|
{
|
|
HediffComp_Menstruation comp = pawn.GetMenstruationComp();
|
|
if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f)
|
|
{
|
|
|
|
Building_CumBucket bucket = pawn.FindClosestBucket();
|
|
if (bucket != null)
|
|
{
|
|
__result = JobMaker.MakeJob(VariousDefOf.VaginaWashingwithBucket, null, bucket, bucket.Position);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|