diff --git a/About/About.xml b/About/About.xml new file mode 100644 index 0000000..ceea282 --- /dev/null +++ b/About/About.xml @@ -0,0 +1,37 @@ + + + + RJW-Events + C0ffee + +
  • 1.2
  • +
    + c0ffee.rjw.events + +
  • + brrainz.harmony + Harmony + steam://url/CommunityFilePage/2009463077 + https://github.com/pardeike/HarmonyRimWorld/releases/latest +
  • +
  • + UnlimitedHugs.HugsLib + HugsLib + https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest + steam://url/CommunityFilePage/818773962 +
  • +
  • + rim.job.world + RimJobWorld + https://www.loverslab.com/topic/110270-mod-rimjobworld/ +
  • +
    + +
  • UnlimitedHugs.HugsLib
  • +
  • brrainz.harmony
  • +
  • rim.job.world
  • +
    + + RJW Events + +
    diff --git a/About/Manifest.xml b/About/Manifest.xml new file mode 100644 index 0000000..2a41c8c --- /dev/null +++ b/About/Manifest.xml @@ -0,0 +1,5 @@ + + + RJW-Events + 0.0.1 + \ No newline at end of file diff --git a/Assemblies/RJW-Events.dll b/Assemblies/RJW-Events.dll new file mode 100644 index 0000000..4c12f27 Binary files /dev/null and b/Assemblies/RJW-Events.dll differ diff --git a/Defs/DutyDefs/DutyDefs_Sex.xml b/Defs/DutyDefs/DutyDefs_Sex.xml new file mode 100644 index 0000000..b2219b1 --- /dev/null +++ b/Defs/DutyDefs/DutyDefs_Sex.xml @@ -0,0 +1,48 @@ + + + + Orgy + + MediumPriority + + + +
  • + +
  • + +
  • + 0.25 + +
  • +
    + + +
  • + 0.45 + +
  • + + + +
  • + 50~250 +
  • + + + +
  • + + + + +
  • + Jog + 50~250 +
  • + +
    + +
    + +
    \ No newline at end of file diff --git a/Defs/GatheringDefs/Gatherings_Sex.xml b/Defs/GatheringDefs/Gatherings_Sex.xml new file mode 100644 index 0000000..a344ed3 --- /dev/null +++ b/Defs/GatheringDefs/Gatherings_Sex.xml @@ -0,0 +1,18 @@ + + + + Orgy + + 1 + Orgy + {ORGANIZER_labelShort} is hosting an orgy! Everyone who goes will gain social and sexual energy. + The orgy has been called off. + The orgy has finished. + Orgy + GatheringWorker_Party + +
  • PartySpot
  • +
    +
    +
    + diff --git a/Defs/JobDefs/Jobs_Naked.xml b/Defs/JobDefs/Jobs_Naked.xml new file mode 100644 index 0000000..48f8bd6 --- /dev/null +++ b/Defs/JobDefs/Jobs_Naked.xml @@ -0,0 +1,8 @@ + + + + GetNaked + RJW_Events.JobDriver_GetNaked + Gettin' nekkid. + + diff --git a/Defs/JobDefs/Jobs_OrgySex.xml b/Defs/JobDefs/Jobs_OrgySex.xml new file mode 100644 index 0000000..ae500a4 --- /dev/null +++ b/Defs/JobDefs/Jobs_OrgySex.xml @@ -0,0 +1,15 @@ + + + + OrgySex + RJW_Events.JobDriver_OrgySex + lovin' in orgy. + false + + + GettinOrgySex + RJW_Events.JobDriver_OrgySexReceiver + Gettin' loved in orgy. + false + + \ No newline at end of file diff --git a/Defs/TaleDefs/Tales_Sex.xml b/Defs/TaleDefs/Tales_Sex.xml new file mode 100644 index 0000000..952844f --- /dev/null +++ b/Defs/TaleDefs/Tales_Sex.xml @@ -0,0 +1,32 @@ + + + + AttendedOrgy + + Tale_DoublePawn + Volatile + ATTENDER + ORGANIZER + 1 + + +
  • tale_noun->[ATTENDER_nameDef] attending [ORGANIZER_nameDef]'s orgy
  • +
  • tale_noun->[ATTENDER_nameDef] having sex with [ORGANIZER_nameDef] at an orgy
  • +
  • image->[ATTENDER_nameFull] making out with [ORGANIZER_nameFull] [circumstance_group]
  • +
  • image->[ATTENDER_nameFull] getting a drink from [ORGANIZER_nameFull] [circumstance_group]
  • +
  • image->[ATTENDER_nameFull] chatting with [ORGANIZER_nameFull] [circumstance_group]
  • +
  • image->[ORGANIZER_nameFull] welcoming [ATTENDER_nameFull] [circumstance_group]
  • +
  • image->[ORGANIZER_nameFull] introducing [ATTENDER_nameFull] to a friend [circumstance_group]
  • +
  • circumstance_phrase->with a broad grin
  • +
  • circumstance_phrase->with a laugh
  • +
  • circumstance_phrase->with a [AdjectiveFriendly] smile
  • +
  • circumstance_phrase->while laughing uproariously
  • +
  • circumstance_phrase->while [AdjectiveFriendly]
  • +
  • desc_sentence->[Quantity_adjphrase] [PersonJob]s are involved in the conversation.
  • +
  • desc_sentence->The area is decorated with [Color] and [Color].
  • +
  • desc_sentence->[Quantity_adjphrase] [Animal]s play nearby.
  • +
    +
    +
    +
    + diff --git a/Defs/ThoughtDefs/Thoughts_Sex.xml b/Defs/ThoughtDefs/Thoughts_Sex.xml new file mode 100644 index 0000000..d06d5ce --- /dev/null +++ b/Defs/ThoughtDefs/Thoughts_Sex.xml @@ -0,0 +1,15 @@ + + + + AttendedOrgy + 10 + 10 + +
  • + + I got very intimate with everyone at that orgy. + 8 +
  • +
    +
    +
    diff --git a/RJW-Events.csproj b/RJW-Events.csproj new file mode 100644 index 0000000..e5ef7b7 --- /dev/null +++ b/RJW-Events.csproj @@ -0,0 +1,81 @@ + + + + + Debug + AnyCPU + {938E73E7-1D25-4842-A27F-8C7D0EE7F67F} + Library + Properties + RJW_Events + RJW-Events + v4.7.2 + 512 + true + + + false + none + false + Assemblies\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\Modpacks\Mods\836308268\1.2\Assemblies\0Harmony.dll + False + + + ..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\rjw-master\1.2\Assemblies\RJW.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RJW-Events.sln b/RJW-Events.sln new file mode 100644 index 0000000..086d215 --- /dev/null +++ b/RJW-Events.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31112.23 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW-Events", "RJW-Events.csproj", "{FCB2ED70-7FE4-4C45-B90C-D7BF7E5B5E06}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FCB2ED70-7FE4-4C45-B90C-D7BF7E5B5E06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCB2ED70-7FE4-4C45-B90C-D7BF7E5B5E06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCB2ED70-7FE4-4C45-B90C-D7BF7E5B5E06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCB2ED70-7FE4-4C45-B90C-D7BF7E5B5E06}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {839AB9DE-FF41-498A-9F8F-1DE2BCC6ECD5} + EndGlobalSection +EndGlobal diff --git a/Source/DefOfs/TaleDefOf.cs b/Source/DefOfs/TaleDefOf.cs new file mode 100644 index 0000000..388561b --- /dev/null +++ b/Source/DefOfs/TaleDefOf.cs @@ -0,0 +1,20 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RJW_Events +{ + [DefOf] + public static class TaleDefOf + { + static TaleDefOf() + { + DefOfHelper.EnsureInitializedInCtor(typeof(TaleDefOf)); + } + + public static TaleDef AttendedOrgy; + } +} diff --git a/Source/DefOfs/ThoughtDefOf.cs b/Source/DefOfs/ThoughtDefOf.cs new file mode 100644 index 0000000..dc1b044 --- /dev/null +++ b/Source/DefOfs/ThoughtDefOf.cs @@ -0,0 +1,20 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RJW_Events +{ + [DefOf] + public static class ThoughtDefOf + { + static ThoughtDefOf() + { + DefOfHelper.EnsureInitializedInCtor(typeof(ThoughtDefOf)); + } + + public static ThoughtDef AttendedOrgy; + } +} diff --git a/Source/GatheringWorkers/GatheringWorker_Orgy.cs b/Source/GatheringWorkers/GatheringWorker_Orgy.cs new file mode 100644 index 0000000..ebf91cc --- /dev/null +++ b/Source/GatheringWorkers/GatheringWorker_Orgy.cs @@ -0,0 +1,25 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using Verse.AI.Group; + +namespace RJW_Events +{ + class GatheringWorker_Orgy : GatheringWorker + { + + protected override LordJob CreateLordJob(IntVec3 spot, Pawn organizer) + { + return new LordJob_Joinable_Orgy(spot, organizer, this.def); + } + protected override bool TryFindGatherSpot(Pawn organizer, out IntVec3 spot) + { + return RCellFinder.TryFindGatheringSpot_NewTemp(organizer, this.def, false, out spot); + } + + } +} diff --git a/Source/JobDrivers/JobDriver_GetNaked.cs b/Source/JobDrivers/JobDriver_GetNaked.cs new file mode 100644 index 0000000..53e3d57 --- /dev/null +++ b/Source/JobDrivers/JobDriver_GetNaked.cs @@ -0,0 +1,29 @@ +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse.AI; + +namespace RJW_Events +{ + class JobDriver_GetNaked : JobDriver + { + public override bool TryMakePreToilReservations(bool errorOnFailed) + { + return true; + } + + protected override IEnumerable MakeNewToils() + { + Toil t = new Toil(); + t.AddFinishAction(() => { + + SexUtility.DrawNude(pawn); + + }); + yield return t; + } + } +} diff --git a/Source/JobDrivers/JobDriver_OrgySex.cs b/Source/JobDrivers/JobDriver_OrgySex.cs new file mode 100644 index 0000000..d9f0340 --- /dev/null +++ b/Source/JobDrivers/JobDriver_OrgySex.cs @@ -0,0 +1,111 @@ +using RimWorld; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using Verse.AI; +using Verse.AI.Group; + +namespace RJW_Events +{ + class JobDriver_OrgySex : JobDriver_SexQuick + { + + public override bool TryMakePreToilReservations(bool errorOnFailed) + { + return true; + } + + protected override IEnumerable MakeNewToils() + { + base.setup_ticks(); + JobDef PartnerJob = DefDatabase.GetNamed("GettinOrgySex", true); + this.FailOnDespawnedNullOrForbidden(this.iTarget); + this.FailOn(() => !this.Partner.health.capacities.CanBeAwake); + this.FailOn(() => this.pawn.IsFighting()); + this.FailOn(() => this.Partner.IsFighting()); + this.FailOn(() => this.pawn.Drafted); + yield return Toils_Goto.GotoThing(this.iTarget, PathEndMode.OnCell); + yield return new Toil + { + defaultCompleteMode = ToilCompleteMode.Delay, + initAction = delegate () + { + this.ticksLeftThisToil = 5000; + }, + tickAction = delegate () + { + this.pawn.GainComfortFromCellIfPossible(false); + if (this.pawn.Position.DistanceTo(this.Partner.Position) <= 1f) + { + this.ReadyForNextToil(); + } + } + }; + yield return new Toil + { + defaultCompleteMode = ToilCompleteMode.Instant, + socialMode = RandomSocialMode.Off, + initAction = delegate () + { + + if(Partner.CurJob.def != PartnerJob) + { + Job newJob = JobMaker.MakeJob(PartnerJob, this.pawn, this.Partner); + this.Partner.jobs.StartJob(newJob, JobCondition.InterruptForced, null, false, true, null, null, false, false); + } + + } + }; + Toil toil = new Toil(); + toil.defaultCompleteMode = ToilCompleteMode.Never; + toil.socialMode = RandomSocialMode.Off; + toil.defaultDuration = this.duration; + toil.handlingFacing = true; + toil.FailOn(() => this.Partner.CurJob.def != PartnerJob); + toil.initAction = delegate () + { + this.Partner.pather.StopDead(); + this.Partner.jobs.curDriver.asleep = false; + this.usedCondom = (CondomUtility.TryUseCondom(this.pawn) || CondomUtility.TryUseCondom(this.Partner)); + this.Start(); + }; + toil.AddPreTickAction(delegate + { + this.ticks_left--; + if (this.pawn.IsHashIntervalTick(this.ticks_between_hearts)) + { + this.ThrowMetaIcon(this.pawn.Position, this.pawn.Map, ThingDefOf.Mote_Heart); + } + this.SexTick(this.pawn, this.Partner, true, true); + SexUtility.reduce_rest(this.Partner, 1f); + SexUtility.reduce_rest(this.pawn, 1f); + if (this.ticks_left <= 0) + { + this.ReadyForNextToil(); + } + }); + toil.AddFinishAction(delegate + { + this.End(); + if(LordUtility.GetLord(pawn)?.CurLordToil != null && !(LordUtility.GetLord(pawn).CurLordToil is LordToil_End)) + SexUtility.DrawNude(pawn); + }); + yield return toil; + yield return new Toil + { + initAction = delegate () + { + SexUtility.ProcessSex(this.pawn, this.Partner, this.usedCondom, this.isRape, false, false, this.sexType); + }, + defaultCompleteMode = ToilCompleteMode.Instant + }; + yield break; + } + + + } +} diff --git a/Source/JobDrivers/JobDriver_OrgySexReceiver.cs b/Source/JobDrivers/JobDriver_OrgySexReceiver.cs new file mode 100644 index 0000000..4596cd1 --- /dev/null +++ b/Source/JobDrivers/JobDriver_OrgySexReceiver.cs @@ -0,0 +1,79 @@ +using RimWorld; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using Verse.AI; + +namespace RJW_Events +{ + class JobDriver_OrgySexReceiver : JobDriver_SexBaseReciever + { + + protected override IEnumerable MakeNewToils() + { + base.setup_ticks(); + this.parteners.Add(base.Partner); + float num = xxx.get_sex_ability(base.Partner); + if (num < 0.8f) + { + this.ticks_between_thrusts += 120; + } + else if (num > 2f) + { + this.ticks_between_thrusts -= 30; + } + if (this.pawn.relations.OpinionOf(base.Partner) < 0) + { + this.ticks_between_hearts += 50; + } + else if (this.pawn.relations.OpinionOf(base.Partner) > 60) + { + this.ticks_between_hearts -= 25; + } + this.FailOnDespawnedOrNull(this.iTarget); + this.FailOn(() => !base.Partner.health.capacities.CanBeAwake); + this.FailOn(() => this.pawn.Drafted); + this.FailOn(() => base.Partner.Drafted); + + + yield return Toils_Reserve.Reserve(this.iTarget, 1, 0, null); + Toil toil2 = this.MakeSexToil(); + toil2.handlingFacing = false; + yield return toil2; + + + yield break; + } + + private Toil MakeSexToil() + { + Toil toil = new Toil(); + toil.defaultCompleteMode = ToilCompleteMode.Never; + toil.socialMode = RandomSocialMode.Off; + toil.handlingFacing = true; + toil.tickAction = delegate () + { + if (this.pawn.IsHashIntervalTick(this.ticks_between_hearts)) + { + base.ThrowMetaIcon(this.pawn.Position, this.pawn.Map, ThingDefOf.Mote_Heart); + } + }; + toil.AddEndCondition(delegate + { + if (this.parteners.Count <= 0) + { + return JobCondition.Succeeded; + } + return JobCondition.Ongoing; + }); + toil.socialMode = RandomSocialMode.Off; + return toil; + } + + + } +} diff --git a/Source/JobGivers/JobGiver_FindOrgyPartner.cs b/Source/JobGivers/JobGiver_FindOrgyPartner.cs new file mode 100644 index 0000000..2f08b90 --- /dev/null +++ b/Source/JobGivers/JobGiver_FindOrgyPartner.cs @@ -0,0 +1,102 @@ +using RimWorld; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using Verse.AI; +using Verse.AI.Group; + +namespace RJW_Events +{ + + + public class JobGiver_FindOrgyPartner : ThinkNode_JobGiver + { + + protected override Job TryGiveJob(Pawn pawn) + { + if (!RJWHookupSettings.HookupsEnabled) + { + return null; + } + if (pawn.Drafted) + { + return null; + } + + Pawn_MindState mindState = pawn.mindState; + DutyDef dutyDef; + if (mindState == null) + { + dutyDef = null; + } + else + { + PawnDuty duty = mindState.duty; + dutyDef = ((duty != null) ? duty.def : null); + } + if (dutyDef == DutyDefOf.TravelOrLeave) + { + if (RJWSettings.DebugLogJoinInBed) + { + ModLog.Message("JoinInBed.TryGiveJob:(" + xxx.get_pawnname(pawn) + "): has TravelOrLeave, no time for lovin!"); + } + return null; + } + + if (!CasualSex_Helper.CanHaveSex(pawn)) + { + return null; + } + + List targets = LordUtility.GetLord(pawn).ownedPawns; + + Pawn pawn2 = null; + if(!BestPawnForOrgyExists(pawn, targets, out pawn2)) + { + return null; + } + if (pawn2 == null) + { + return null; + } + + if (pawn2.jobs.curDriver is JobDriver_SexBaseInitiator) + { + pawn2 = (Pawn)pawn2.CurJob.targetA; + } + else if (pawn.CurJob != null && pawn.jobs.curDriver != null) + { + pawn.jobs.curDriver.EndJobWith(JobCondition.InterruptForced); + } + return JobMaker.MakeJob(DefDatabase.GetNamed("OrgySex", true), pawn2); + } + + public bool BestPawnForOrgyExists(Pawn pawn1, List targets, out Pawn result) + { + if(targets.TryRandomElementByWeight((Pawn p) => { + + float chance = pawn1.relations.SecondaryRomanceChanceFactor(p); + if(!(p.jobs.curDriver is JobDriver_Sex)) + { + //higher chance if person is doing nothing + chance *= 3f; + } + return chance; + + }, out Pawn option)) { + result = option; + return true; + } + else + { + result = null; + return false; + } + + } + } +} diff --git a/Source/JobGivers/JobGiver_GetNaked.cs b/Source/JobGivers/JobGiver_GetNaked.cs new file mode 100644 index 0000000..d6e8878 --- /dev/null +++ b/Source/JobGivers/JobGiver_GetNaked.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using Verse.AI; + +namespace RJW_Events +{ + public class JobGiver_GetNaked : ThinkNode_JobGiver + { + protected override Job TryGiveJob(Pawn pawn) + { + return JobMaker.MakeJob(DefDatabase.GetNamed("GetNaked", true)); + } + } +} diff --git a/Source/LordJobs/LordJob_Joinable_Orgy.cs b/Source/LordJobs/LordJob_Joinable_Orgy.cs new file mode 100644 index 0000000..567c155 --- /dev/null +++ b/Source/LordJobs/LordJob_Joinable_Orgy.cs @@ -0,0 +1,64 @@ +using RimWorld; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace RJW_Events +{ + class LordJob_Joinable_Orgy : LordJob_Joinable_Party + { + protected override ThoughtDef AttendeeThought + { + get + { + return ThoughtDefOf.AttendedOrgy; + } + } + + protected override TaleDef AttendeeTale + { + get + { + return TaleDefOf.AttendedOrgy; + } + } + protected override ThoughtDef OrganizerThought + { + get + { + return ThoughtDefOf.AttendedOrgy; + } + } + + protected override TaleDef OrganizerTale + { + get + { + return TaleDefOf.AttendedOrgy; + } + } + + public LordJob_Joinable_Orgy(IntVec3 spot, Pawn organizer, GatheringDef gatheringDef) : base(spot, organizer, gatheringDef) + { + + } + + + public override float VoluntaryJoinPriorityFor(Pawn p) + { + if (!CasualSex_Helper.CanHaveSex(p) || p.Map.mapPawns.FreeColonists.Exists((Pawn p1) => + { + + return p.relations.SecondaryRomanceChanceFactor(p1) > 0 || p1.relations.SecondaryRomanceChanceFactor(p) > 0; + + })) return 0; + + return base.VoluntaryJoinPriorityFor(p); + } + + } +} diff --git a/Source/Patches/HarmonyPatch_ReclotheOnEnd.cs b/Source/Patches/HarmonyPatch_ReclotheOnEnd.cs new file mode 100644 index 0000000..4b0f197 --- /dev/null +++ b/Source/Patches/HarmonyPatch_ReclotheOnEnd.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using RimWorld; +using Verse; + +namespace RJW_Events +{ + [HarmonyPatch(typeof(LordJob_Joinable_Party), "ApplyOutcome")] + public static class HarmonyPatch_ReclotheOnEnd + { + public static void Postfix(LordToil_Party toil) + { + List ownedPawns = toil.lord.ownedPawns; + foreach(Pawn p in ownedPawns) + { + p.Drawer.renderer.graphics.ResolveApparelGraphics(); + } + } + } +} diff --git a/Source/Patches/Harmony_PatchAll.cs b/Source/Patches/Harmony_PatchAll.cs new file mode 100644 index 0000000..88dba15 --- /dev/null +++ b/Source/Patches/Harmony_PatchAll.cs @@ -0,0 +1,21 @@ +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace RJW_Events +{ + [StaticConstructorOnStartup] + class Harmony_PatchAll + { + static Harmony_PatchAll() + { + Harmony harmony = new Harmony("rimworldevents"); + harmony.PatchAll(Assembly.GetExecutingAssembly()); + } + } +} diff --git a/Source/ThinkNodes/ThinkNode_ConditionalNude.cs b/Source/ThinkNodes/ThinkNode_ConditionalNude.cs new file mode 100644 index 0000000..6e71124 --- /dev/null +++ b/Source/ThinkNodes/ThinkNode_ConditionalNude.cs @@ -0,0 +1,39 @@ +using RimWorld; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using Verse.AI; + +namespace RJW_Events +{ + public class ThinkNode_ConditionalNude : ThinkNode_Conditional + { + protected override bool Satisfied(Pawn pawn) + { + //if pawn is rendering apparel they shouldn't be, + if (pawn.Drawer.renderer.graphics.apparelGraphics.Any((ApparelGraphicRecord x) => { + + if (x.sourceApparel.def.defName.ToLower().ContainsAny(new string[] + { + "vibrator", + "piercing", + "strapon" + }) || (RJWPreferenceSettings.sex_wear == RJWPreferenceSettings.Clothing.Headgear && !x.sourceApparel.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.UpperHead))) + return false; + + return true; + + })) + { + //they aren't nude + return false; + } + + return true; + } + } +}