using HarmonyLib; using RimWorld; using RJWSexperience; using System.Collections.Generic; using System.Linq; using UnityEngine; using Verse; namespace RJW_Menstruation.Sexperience { [HarmonyPatch(typeof(FloatMenuMakerMap), "AddHumanlikeOrders")] public class HumanlikeOrder_Patch { public static void Postfix(Vector3 clickPos, Pawn pawn, List opts) { IEnumerable targets = GenUI.TargetsAt(clickPos, TargetingParameters.ForBuilding()); if (pawn.GetMenstruationComps().Any(comp => comp.TotalCumPercent > 0.001f)) foreach (LocalTargetInfo t in targets) { if (t.Thing is Building building) { if (building is Building_CumBucket) { opts.AddDistinct(MakeMenu(pawn, building)); break; } } } } public static FloatMenuOption MakeMenu(Pawn pawn, LocalTargetInfo target) { FloatMenuOption option = FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(Translations.Gizmo_GatherCum, delegate () { pawn.jobs.TryTakeOrderedJob(new Verse.AI.Job(VariousDefOf.VaginaWashingwithBucket, null, target, target.Cell)); }, MenuOptionPriority.Low), pawn, target); return option; } } }