mirror of
https://gitgud.io/c0ffeeeeeeee/rjw-toys-and-masturbation.git
synced 2024-08-15 00:43:44 +00:00
bonus mood, thinknode AI
This commit is contained in:
parent
1b49e235cf
commit
da8939c4b8
9 changed files with 95 additions and 9 deletions
|
@ -13,6 +13,8 @@ namespace RJW_ToysAndMasturbation {
|
|||
|
||||
public static JobDef MasturbateWithToy;
|
||||
|
||||
public static ThoughtDef UsedSexToy;
|
||||
|
||||
static MasturbateToyDefOf() {
|
||||
DefOfHelper.EnsureInitializedInCtor(typeof(JobDefOf));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace RJW_ToysAndMasturbation {
|
|||
yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.A);
|
||||
yield return Toils_Haul.StartCarryThing(TargetIndex.A);
|
||||
|
||||
if (!SexToyUtility.isRJWAnimationsLoaded || true /*True for now, anims come later; disable once created animations*/) {
|
||||
if (!SexToyUtility.isRJWAnimationsLoaded || true /*True for now*/) {
|
||||
//place down if anims isn't loaded
|
||||
yield return Toils_Haul.CarryHauledThingToCell(TargetIndex.C);
|
||||
yield return Toils_Haul.PlaceHauledThingInCell(TargetIndex.C, Toils_Goto.GotoCell(TargetIndex.C, PathEndMode.OnCell), storageMode: false);
|
||||
|
@ -66,6 +66,8 @@ namespace RJW_ToysAndMasturbation {
|
|||
cleanup.AddQueuedTarget(TargetIndex.A, filth);
|
||||
pawn.jobs.jobQueue.EnqueueFirst(cleanup);
|
||||
}
|
||||
//bonus mood
|
||||
pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(MasturbateToyDefOf.UsedSexToy);
|
||||
|
||||
};
|
||||
yield return AfterToil;
|
||||
|
|
|
@ -21,20 +21,59 @@ namespace RJW_ToysAndMasturbation {
|
|||
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);
|
||||
|
||||
if(findSexToyOnMap(pawn, out Thing sexToy)) {
|
||||
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) {
|
||||
|
||||
Job j = JobMaker.MakeJob(MasturbateToyDefOf.MasturbateWithToy, sexToy, bed, bed.Position);
|
||||
j.count = 1;
|
||||
return j;
|
||||
|
||||
}
|
||||
}
|
||||
else if (RJWPreferenceSettings.FapEverywhere && (xxx.is_frustrated(pawn) || xxx.has_quirk(pawn, "Exhibitionist"))) {
|
||||
Job j = JobMaker.MakeJob(MasturbateToyDefOf.MasturbateWithToy, sexToy, null, FapLocation(pawn));
|
||||
j.count = 1;
|
||||
return j;
|
||||
}
|
||||
|
||||
}
|
||||
else if (RJWPreferenceSettings.FapEverywhere && (xxx.is_frustrated(pawn) || xxx.has_quirk(pawn, "Exhibitionist"))) {
|
||||
return JobMaker.MakeJob(xxx.Masturbate, null, null, FapLocation(pawn));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public static bool findSexToyOnMap(Pawn p, out Thing sexToy) {
|
||||
|
||||
Predicate<Thing> validator = delegate (Thing t) {
|
||||
if(t.TryGetComp<CompSexToy>() == null) {
|
||||
return false;
|
||||
}
|
||||
//homo check
|
||||
if (t.TryGetComp<CompSexToy>().Props.primaryGender == p.gender ||
|
||||
(t.TryGetComp<CompSexToy>().Props.primaryGender == Gender.Male && xxx.can_fuck(p) && (RJWPreferenceSettings.FeMalesex == RJWPreferenceSettings.AllowedSex.All || RJWPreferenceSettings.FeMalesex == RJWPreferenceSettings.AllowedSex.Homo)) ||
|
||||
(t.TryGetComp<CompSexToy>().Props.primaryGender == Gender.Female && xxx.can_be_fucked(p) && (RJWPreferenceSettings.Malesex == RJWPreferenceSettings.AllowedSex.All || RJWPreferenceSettings.Malesex == RJWPreferenceSettings.AllowedSex.Homo)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
sexToy = GenClosest.ClosestThingReachable(p.Position, p.Map, ThingRequest.ForGroup(ThingRequestGroup.HaulableAlways), PathEndMode.OnCell, TraverseParms.For(p), validator: validator, maxDistance: 100);
|
||||
|
||||
if (sexToy != null)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ using Verse;
|
|||
namespace RJW_ToysAndMasturbation {
|
||||
public class CompProperties_SexToy : CompProperties {
|
||||
|
||||
public Gender primaryGender = Gender.Female;
|
||||
public CompProperties_SexToy() {
|
||||
compClass = typeof(CompSexToy);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace RJW_ToysAndMasturbation {
|
|||
|
||||
public static IntVec3 FapLocation(Pawn p) => (new JobGiver_Masturbate()).FindFapLocation(p);
|
||||
|
||||
public CompProperties_SexToy Props => (CompProperties_SexToy)props;
|
||||
|
||||
public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn pawn) {
|
||||
|
||||
if (!pawn.CanReach(parent, PathEndMode.Touch, Danger.Deadly)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue