2020-11-05 22:09:05 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Verse;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
using Verse.AI;
|
|
|
|
|
using rjw;
|
|
|
|
|
|
|
|
|
|
namespace RJW_ToysAndMasturbation {
|
|
|
|
|
public class CompSexToy : ThingComp {
|
|
|
|
|
|
2022-01-23 23:29:13 +00:00
|
|
|
|
public static IntVec3 FapLocation(Pawn p) => CasualSex_Helper.FindSexLocation(p);
|
2020-11-05 22:09:05 +00:00
|
|
|
|
|
2020-11-06 06:03:16 +00:00
|
|
|
|
public CompProperties_SexToy Props => (CompProperties_SexToy)props;
|
|
|
|
|
|
2020-11-05 22:09:05 +00:00
|
|
|
|
public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn pawn) {
|
|
|
|
|
|
|
|
|
|
if (!pawn.CanReach(parent, PathEndMode.Touch, Danger.Deadly)) {
|
|
|
|
|
yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "NoPath".Translate() + ")", null);
|
|
|
|
|
}
|
|
|
|
|
else if (!pawn.CanReserve(parent)) {
|
|
|
|
|
yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "Reserved".Translate() + ")", null);
|
|
|
|
|
}
|
|
|
|
|
else if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation)) {
|
|
|
|
|
yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "Incapable".Translate() + ")", null);
|
|
|
|
|
}
|
|
|
|
|
else if (!xxx.can_be_fucked(pawn) && !xxx.can_fuck(pawn)) {
|
|
|
|
|
yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "Incapable".Translate() + ")", null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
yield return new FloatMenuOption(FloatMenuOptionLabel(pawn), delegate {
|
|
|
|
|
|
2022-01-23 23:29:13 +00:00
|
|
|
|
if (RJWPreferenceSettings.FapInBed && pawn.jobs.curDriver is JobDriver_LayDown down) {
|
|
|
|
|
Building_Bed bed = down.Bed;
|
2020-11-05 22:09:05 +00:00
|
|
|
|
if (bed != null) {
|
|
|
|
|
Job j = JobMaker.MakeJob(MasturbateToyDefOf.MasturbateWithToy, parent, bed, bed.Position);
|
|
|
|
|
j.count = 1;
|
|
|
|
|
pawn.jobs.TryTakeOrderedJob(j);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
Job j = JobMaker.MakeJob(MasturbateToyDefOf.MasturbateWithToy, parent, null, FapLocation(pawn));
|
|
|
|
|
j.count = 1;
|
|
|
|
|
pawn.jobs.TryTakeOrderedJob(j);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string FloatMenuOptionLabel(Pawn pawn) {
|
2020-11-05 22:52:02 +00:00
|
|
|
|
return "Masturbate with toy";
|
2020-11-05 22:09:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|