rjw-toys-and-masturbation/Source/JobGivers/JobGiver_MasturbateWithToy.cs
2020-11-05 14:09:05 -08:00

40 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using rjw;
using Verse;
using Verse.AI;
namespace RJW_ToysAndMasturbation {
class JobGiver_MasturbateWithToy : ThinkNode_JobGiver {
public static IntVec3 FapLocation(Pawn p) => (new JobGiver_Masturbate()).FindFapLocation(p);
protected override Job TryGiveJob(Pawn pawn) {
if (pawn.Drafted) {
return null;
}
if (!xxx.can_be_fucked(pawn) && !xxx.can_fuck(pawn)) {
return null;
}
if ((SexUtility.ReadyForLovin(pawn) && (!xxx.is_whore(pawn) || pawn.IsPrisoner || xxx.is_slave(pawn))) || xxx.is_frustrated(pawn)) {
if (RJWPreferenceSettings.FapInBed && pawn.jobs.curDriver is JobDriver_LayDown) {
Building_Bed bed = ((JobDriver_LayDown)pawn.jobs.curDriver).Bed;
if (bed != null) {
return JobMaker.MakeJob(xxx.Masturbate, null, bed, bed.Position);
}
}
else if (RJWPreferenceSettings.FapEverywhere && (xxx.is_frustrated(pawn) || xxx.has_quirk(pawn, "Exhibitionist"))) {
return JobMaker.MakeJob(xxx.Masturbate, null, null, FapLocation(pawn));
}
}
return null;
}
}
}