Further updates

This commit is contained in:
AbstractConcept 2023-01-26 00:36:18 -06:00
parent 3eec691bd3
commit 299934584e
25 changed files with 180 additions and 144 deletions

View file

@ -23,7 +23,7 @@ namespace Privacy_Please
(__instance is JobDriver_JoinInSex) == false &&
Random.value < BasicSettings.chanceForOtherToJoinInSex)
{
DebugMode.Message("Find another to join in sex");
DebugMode.Message("Find another to join in sex?");
List<Pawn> candidates = new List<Pawn>();
float radius = 4f;
@ -31,10 +31,12 @@ namespace Privacy_Please
foreach (Thing thing in GenRadial.RadialDistinctThingsAround(pawn.Position, pawn.Map, radius, true))
{
Pawn other = thing as Pawn;
ThoughtDef thoughtDef = null; // SexInteractionUtility.GetThoughtsAboutSexAct(other, __instance, out Precept precept);
if (other == null) continue;
SexInteractionUtility.GetReactionsToSexDiscovery(pawn.jobs.curDriver as JobDriver_Sex, other, out ReactionToSexDiscovery reactionOfPawn, out ReactionToSexDiscovery reactionOfOther, false);
// Find candidates to invite
if (other != null && thoughtDef?.hediff == null && SexInteractionUtility.PasserbyCanBePropositionedForSex(other, pawn.GetAllSexParticipants()))
if ((int)reactionOfOther >= (int)ReactionToSexDiscovery.Acceptance && SexInteractionUtility.PasserbyCanBePropositionedForSex(other, pawn.GetAllSexParticipants()))
{
DebugMode.Message(other.NameShortColored + " is a potential candidate");
candidates.Add(other);
@ -59,7 +61,7 @@ namespace Privacy_Please
[HarmonyPatch(typeof(JobDriver_Sex), "SexTick")]
public static class HarmonyPatch_JobDriver_Sex_SexTick
{
// If pawns don't have privacy, they'll stop having sex
// When pawns are having sex, intermittently check their surrounds for privacy
public static void Postfix(ref JobDriver_Sex __instance, Pawn pawn)
{
if (pawn.IsHashIntervalTick(90))