mirror of
https://gitgud.io/AbstractConcept/privacy-please.git
synced 2024-08-15 00:03:18 +00:00
v 0.01
This commit is contained in:
parent
55402b9891
commit
03e634e56c
36 changed files with 866 additions and 491 deletions
84
Source/Scripts/Utilities/PrivacyUtility.cs
Normal file
84
Source/Scripts/Utilities/PrivacyUtility.cs
Normal file
|
@ -0,0 +1,84 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using Verse.AI.Group;
|
||||
using rjw;
|
||||
|
||||
namespace Privacy_Please
|
||||
{
|
||||
public static class PrivacyUtility
|
||||
{
|
||||
public static bool PawnHasPrivacy(Pawn pawn, float radius)
|
||||
{
|
||||
//if (pawn.IsUnfazedBySex())
|
||||
//{ return true; }
|
||||
|
||||
if (pawn.IsHavingSex() == false && pawn.IsMasturbating() == false)
|
||||
{ return true; }
|
||||
|
||||
//if (pawn.GetLord() != null && (pawn.GetLord().LordJob is LordJob_Ritual || pawn.GetLord().LordJob is LordJob_Joinable_Party) && BasicSettings.ignoreRitualAndPartySex)
|
||||
//{ return true; }
|
||||
|
||||
bool hasPrivacy = true;
|
||||
pawn.IsInBed(out Building bed);
|
||||
|
||||
foreach (Thing thing in GenRadial.RadialDistinctThingsAround(pawn.Position, pawn.Map, radius, true))
|
||||
{
|
||||
Pawn witness = thing as Pawn;
|
||||
if (witness == null) continue;
|
||||
|
||||
// Caught having sex
|
||||
if (SexInteractionUtility.PawnCaughtLovinByWitness(pawn, witness))
|
||||
{
|
||||
// Try to invite intruder to join in
|
||||
if (SexInteractionUtility.GetReactionToSexAct(witness, pawn.jobs.curDriver as JobDriver_Sex) >= (int)ReactionToSexAct.Acceptance)
|
||||
{
|
||||
// TODO roll for sex
|
||||
|
||||
if (CasualSex_Helper.CanHaveSex(witness) && xxx.IsTargetPawnOkay(witness) &&
|
||||
(xxx.has_quirk(witness, "Voyeur") || (xxx.has_quirk(witness, "Cuckold") && SexInteractionUtility.SexParticipantsIncludesACheatingPartner(witness, pawn.GetAllSexParticipants()))))
|
||||
{
|
||||
Job job = new Job(DefDatabase<JobDef>.GetNamed("WatchSex", false), pawn.GetSexReceiver(), bed);
|
||||
witness.jobs.TryTakeOrderedJob(job);
|
||||
}
|
||||
|
||||
else if (pawn.IsMasturbating())
|
||||
{
|
||||
if (bed == null)
|
||||
{
|
||||
Job job = new Job(xxx.quick_sex, pawn);
|
||||
witness.jobs.TryTakeOrderedJob(job);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Job job = new Job(xxx.casual_sex, pawn, bed);
|
||||
witness.jobs.TryTakeOrderedJob(job);
|
||||
}
|
||||
}
|
||||
|
||||
else if (pawn.GetSexReceiver() != null)
|
||||
{
|
||||
Job job = new Job(DefDatabase<JobDef>.GetNamed("JoinInSex", false), pawn.GetSexReceiver(), bed);
|
||||
witness.jobs.TryTakeOrderedJob(job);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{ hasPrivacy = false; }
|
||||
}
|
||||
}
|
||||
|
||||
return BasicSettings.needPrivacy == false ||
|
||||
hasPrivacy ||
|
||||
xxx.has_quirk(pawn, "Exhibitionist") ||
|
||||
pawn?.ideo?.Ideo.HasPrecept(ModPreceptDefOf.Exhibitionism_Acceptable) == true ||
|
||||
pawn?.ideo?.Ideo.HasPrecept(ModPreceptDefOf.Exhibitionism_Approved) == true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue