2022-07-12 22:49:55 +00:00
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
using RJWSexperience;
|
2021-08-13 15:29:43 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using UnityEngine;
|
2022-07-12 22:49:55 +00:00
|
|
|
|
using Verse;
|
2021-08-13 15:29:43 +00:00
|
|
|
|
|
|
|
|
|
namespace RJW_Menstruation.Sexperience
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPatch(typeof(FloatMenuMakerMap), "AddHumanlikeOrders")]
|
|
|
|
|
public class HumanlikeOrder_Patch
|
|
|
|
|
{
|
|
|
|
|
public static void Postfix(Vector3 clickPos, Pawn pawn, List<FloatMenuOption> opts)
|
|
|
|
|
{
|
2022-07-16 14:11:58 +00:00
|
|
|
|
IEnumerable<LocalTargetInfo> targets = GenUI.TargetsAt(clickPos, TargetingParameters.ForBuilding());
|
2021-08-13 15:29:43 +00:00
|
|
|
|
|
2022-07-11 18:52:27 +00:00
|
|
|
|
if (pawn.GetMenstruationComps().Any(comp => comp.TotalCumPercent > 0.001f))
|
2022-07-12 22:49:55 +00:00
|
|
|
|
foreach (LocalTargetInfo t in targets)
|
2021-08-13 15:29:43 +00:00
|
|
|
|
{
|
2022-07-12 22:49:55 +00:00
|
|
|
|
if (t.Thing is Building building)
|
2021-08-13 15:29:43 +00:00
|
|
|
|
{
|
2022-07-12 22:49:55 +00:00
|
|
|
|
if (building is Building_CumBucket)
|
|
|
|
|
{
|
|
|
|
|
opts.AddDistinct(MakeMenu(pawn, building));
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-08-13 15:29:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static FloatMenuOption MakeMenu(Pawn pawn, LocalTargetInfo target)
|
|
|
|
|
{
|
2022-06-02 19:36:54 +00:00
|
|
|
|
FloatMenuOption option = FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(Translations.Gizmo_GatherCum, delegate ()
|
2021-08-13 15:29:43 +00:00
|
|
|
|
{
|
|
|
|
|
pawn.jobs.TryTakeOrderedJob(new Verse.AI.Job(VariousDefOf.VaginaWashingwithBucket, null, target, target.Cell));
|
|
|
|
|
}, MenuOptionPriority.Low), pawn, target);
|
|
|
|
|
|
|
|
|
|
return option;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|