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
Binary file not shown.
21
Defs/ThinkTreeDefs/ThinkTrees_Masturbate.xml
Normal file
21
Defs/ThinkTreeDefs/ThinkTrees_Masturbate.xml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Defs>
|
||||||
|
<ThinkTreeDef>
|
||||||
|
<defName>FapWithToyTree</defName>
|
||||||
|
<insertTag>Humanlike_PostMentalState</insertTag>
|
||||||
|
<insertPriority>12</insertPriority> <!--A little lower than regular fap-->
|
||||||
|
<thinkRoot Class="ThinkNode_Priority">
|
||||||
|
<subNodes>
|
||||||
|
<li Class="rjw.ThinkNode_ConditionalSexChecks">
|
||||||
|
<subNodes>
|
||||||
|
<li Class="rjw.ThinkNode_ChancePerHour_Fappin">
|
||||||
|
<subNodes>
|
||||||
|
<li Class="RJW_ToysAndMasturbation.JobGiver_MasturbateWithToy"/>
|
||||||
|
</subNodes>
|
||||||
|
</li>
|
||||||
|
</subNodes>
|
||||||
|
</li>
|
||||||
|
</subNodes>
|
||||||
|
</thinkRoot>
|
||||||
|
</ThinkTreeDef>
|
||||||
|
</Defs>
|
17
Defs/ThoughtDefs/Thoughts_SexToy.xml
Normal file
17
Defs/ThoughtDefs/Thoughts_SexToy.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Defs>
|
||||||
|
<ThoughtDef>
|
||||||
|
<defName>UsedSexToy</defName>
|
||||||
|
<thoughtClass>Thought_Memory</thoughtClass>
|
||||||
|
<durationDays>1.0</durationDays>
|
||||||
|
<stackLimit>3</stackLimit>
|
||||||
|
<stackedEffectMultiplier>0.2</stackedEffectMultiplier>
|
||||||
|
<stages>
|
||||||
|
<li>
|
||||||
|
<label>Masturbated with toy</label>
|
||||||
|
<description>A step above just using your hand.</description>
|
||||||
|
<baseMoodEffect>4</baseMoodEffect>
|
||||||
|
</li>
|
||||||
|
</stages>
|
||||||
|
</ThoughtDef>
|
||||||
|
</Defs>
|
|
@ -72,6 +72,8 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Defs\JobDefs\Jobs_MasturbateToy.xml" />
|
<Content Include="Defs\JobDefs\Jobs_MasturbateToy.xml" />
|
||||||
|
<Content Include="Defs\ThinkTreeDefs\ThinkTrees_Masturbate.xml" />
|
||||||
|
<Content Include="Defs\ThoughtDefs\Thoughts_SexToy.xml" />
|
||||||
<Content Include="Patches\HumpshroomPatch.xml" />
|
<Content Include="Patches\HumpshroomPatch.xml" />
|
||||||
<Content Include="Defs\ThingDefs\SexToys.xml" />
|
<Content Include="Defs\ThingDefs\SexToys.xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace RJW_ToysAndMasturbation {
|
||||||
|
|
||||||
public static JobDef MasturbateWithToy;
|
public static JobDef MasturbateWithToy;
|
||||||
|
|
||||||
|
public static ThoughtDef UsedSexToy;
|
||||||
|
|
||||||
static MasturbateToyDefOf() {
|
static MasturbateToyDefOf() {
|
||||||
DefOfHelper.EnsureInitializedInCtor(typeof(JobDefOf));
|
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_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.A);
|
||||||
yield return Toils_Haul.StartCarryThing(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
|
//place down if anims isn't loaded
|
||||||
yield return Toils_Haul.CarryHauledThingToCell(TargetIndex.C);
|
yield return Toils_Haul.CarryHauledThingToCell(TargetIndex.C);
|
||||||
yield return Toils_Haul.PlaceHauledThingInCell(TargetIndex.C, Toils_Goto.GotoCell(TargetIndex.C, PathEndMode.OnCell), storageMode: false);
|
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);
|
cleanup.AddQueuedTarget(TargetIndex.A, filth);
|
||||||
pawn.jobs.jobQueue.EnqueueFirst(cleanup);
|
pawn.jobs.jobQueue.EnqueueFirst(cleanup);
|
||||||
}
|
}
|
||||||
|
//bonus mood
|
||||||
|
pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(MasturbateToyDefOf.UsedSexToy);
|
||||||
|
|
||||||
};
|
};
|
||||||
yield return AfterToil;
|
yield return AfterToil;
|
||||||
|
|
|
@ -21,20 +21,59 @@ namespace RJW_ToysAndMasturbation {
|
||||||
if (!xxx.can_be_fucked(pawn) && !xxx.can_fuck(pawn)) {
|
if (!xxx.can_be_fucked(pawn) && !xxx.can_fuck(pawn)) {
|
||||||
return null;
|
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) {
|
if(findSexToyOnMap(pawn, out Thing sexToy)) {
|
||||||
Building_Bed bed = ((JobDriver_LayDown)pawn.jobs.curDriver).Bed;
|
if ((SexUtility.ReadyForLovin(pawn) && (!xxx.is_whore(pawn) || pawn.IsPrisoner || xxx.is_slave(pawn))) || xxx.is_frustrated(pawn)) {
|
||||||
if (bed != null) {
|
if (RJWPreferenceSettings.FapInBed && pawn.jobs.curDriver is JobDriver_LayDown) {
|
||||||
return JobMaker.MakeJob(xxx.Masturbate, null, bed, bed.Position);
|
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;
|
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 {
|
namespace RJW_ToysAndMasturbation {
|
||||||
public class CompProperties_SexToy : CompProperties {
|
public class CompProperties_SexToy : CompProperties {
|
||||||
|
|
||||||
|
public Gender primaryGender = Gender.Female;
|
||||||
public CompProperties_SexToy() {
|
public CompProperties_SexToy() {
|
||||||
compClass = typeof(CompSexToy);
|
compClass = typeof(CompSexToy);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace RJW_ToysAndMasturbation {
|
||||||
|
|
||||||
public static IntVec3 FapLocation(Pawn p) => (new JobGiver_Masturbate()).FindFapLocation(p);
|
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) {
|
public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn pawn) {
|
||||||
|
|
||||||
if (!pawn.CanReach(parent, PathEndMode.Touch, Danger.Deadly)) {
|
if (!pawn.CanReach(parent, PathEndMode.Touch, Danger.Deadly)) {
|
||||||
|
|
Loading…
Reference in a new issue