mirror of
https://gitgud.io/AbstractConcept/privacy-please.git
synced 2024-08-15 00:03:18 +00:00
Bug fixes
- Animation keys should be better synced with the animation (fewer instance of missing keys) - Copied keyframes and cloned stages should no longer be linked to each other -If you delete the first keyframe in a clip, instead of denying you, it will reset the associated actor it to its default starting position - You can now move keyframes over the first one in a clip and override it. If less than two keys remain, new keys will be generated to a minimum of a two - Fixed error when cycling through actor body parts
This commit is contained in:
parent
03e634e56c
commit
a6a550af53
26 changed files with 519 additions and 469 deletions
|
@ -1,10 +1,13 @@
|
|||
namespace Privacy_Please
|
||||
{
|
||||
public enum ReactionToSexAct
|
||||
public enum ReactionToSexDiscovery
|
||||
{
|
||||
Approval = 1,
|
||||
Acceptance = 0,
|
||||
Discomfort = -1,
|
||||
Outrage = -2,
|
||||
Panick = -3,
|
||||
Nauseated = -3,
|
||||
Random = -99,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
|
@ -13,18 +13,16 @@ namespace Privacy_Please
|
|||
{
|
||||
public static class PrivacyUtility
|
||||
{
|
||||
public static bool PawnHasPrivacy(Pawn pawn, float radius)
|
||||
public static void PrivacyCheckForPawn(Pawn pawn, float radius)
|
||||
{
|
||||
//if (pawn.IsUnfazedBySex())
|
||||
//{ return true; }
|
||||
|
||||
if (pawn.IsHavingSex() == false && pawn.IsMasturbating() == false)
|
||||
{ return true; }
|
||||
{ return; }
|
||||
|
||||
//if (pawn.GetLord() != null && (pawn.GetLord().LordJob is LordJob_Ritual || pawn.GetLord().LordJob is LordJob_Joinable_Party) && BasicSettings.ignoreRitualAndPartySex)
|
||||
//{ return true; }
|
||||
if (BasicSettings.ignoreRitualAndPartySex && pawn.IsPartOfRitualOrGathering())
|
||||
{ return; }
|
||||
|
||||
bool hasPrivacy = true;
|
||||
// Local variables
|
||||
JobDriver_Sex jobDriver = pawn.jobs.curDriver as JobDriver_Sex;
|
||||
pawn.IsInBed(out Building bed);
|
||||
|
||||
foreach (Thing thing in GenRadial.RadialDistinctThingsAround(pawn.Position, pawn.Map, radius, true))
|
||||
|
@ -35,18 +33,21 @@ namespace Privacy_Please
|
|||
// 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
|
||||
// Get the pawn's and witness' reaction to the discovery
|
||||
SexInteractionUtility.GetReactionsToSexDiscovery(jobDriver, witness, out ReactionToSexDiscovery reactionOfPawn, out ReactionToSexDiscovery reactionOfWitness, true);
|
||||
bool tryToPropositionTheWitness = Random.value < BasicSettings.chanceForOtherToJoinInSex && SexInteractionUtility.PasserbyCanBePropositionedForSex(witness, pawn.GetAllSexParticipants());
|
||||
|
||||
if (CasualSex_Helper.CanHaveSex(witness) && xxx.IsTargetPawnOkay(witness) &&
|
||||
(xxx.has_quirk(witness, "Voyeur") || (xxx.has_quirk(witness, "Cuckold") && SexInteractionUtility.SexParticipantsIncludesACheatingPartner(witness, pawn.GetAllSexParticipants()))))
|
||||
// Try to proposition the witness
|
||||
if ((int)reactionOfPawn >= (int)ReactionToSexDiscovery.Acceptance && (int)reactionOfWitness >= (int)ReactionToSexDiscovery.Acceptance && tryToPropositionTheWitness)
|
||||
{
|
||||
// Voyeurism
|
||||
if (pawn.IsVoyeur() || (pawn.IsCuckold() && SexInteractionUtility.SexParticipantsIncludesACheatingPartner(witness, pawn.GetAllSexParticipants())))
|
||||
{
|
||||
Job job = new Job(DefDatabase<JobDef>.GetNamed("WatchSex", false), pawn.GetSexReceiver(), bed);
|
||||
witness.jobs.TryTakeOrderedJob(job);
|
||||
}
|
||||
|
||||
// Consensual sex
|
||||
else if (pawn.IsMasturbating())
|
||||
{
|
||||
if (bed == null)
|
||||
|
@ -62,6 +63,7 @@ namespace Privacy_Please
|
|||
}
|
||||
}
|
||||
|
||||
// Threesome
|
||||
else if (pawn.GetSexReceiver() != null)
|
||||
{
|
||||
Job job = new Job(DefDatabase<JobDef>.GetNamed("JoinInSex", false), pawn.GetSexReceiver(), bed);
|
||||
|
@ -69,16 +71,18 @@ namespace Privacy_Please
|
|||
}
|
||||
}
|
||||
|
||||
else
|
||||
{ hasPrivacy = false; }
|
||||
// The proposition failed. Awwkkkwaaarrddd....
|
||||
else if (pawn.IsUnfazedBySex() == false && (int)reactionOfPawn < (int)ReactionToSexDiscovery.Approval)
|
||||
{
|
||||
if (BasicSettings.whoringIsUninteruptable && jobDriver?.Sexprops.isWhoring == true)
|
||||
{ return; }
|
||||
|
||||
// The pawn is uncomfortable and is stopping sex
|
||||
foreach (Pawn participant in pawn.GetAllSexParticipants())
|
||||
{ participant.jobs.EndCurrentJob(JobCondition.InterruptForced, false, 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,19 +14,13 @@ namespace Privacy_Please
|
|||
{
|
||||
public static bool PawnCaughtLovinByWitness(Pawn pawn, Pawn witness)
|
||||
{
|
||||
return true;
|
||||
|
||||
if (witness == null ||
|
||||
pawn == witness ||
|
||||
(pawn.IsMasturbating() == false && pawn.IsHavingSex() == false) ||
|
||||
witness.IsUnfazedBySex() == false ||
|
||||
witness.CanSee(pawn) == false)
|
||||
if (witness == null || pawn == witness || witness.IsUnableToSenseSex() || witness.CanSee(pawn) == false)
|
||||
{ return false; }
|
||||
|
||||
List<Pawn> sexParticipants = pawn.GetAllSexParticipants();
|
||||
bool witnessIsApproachingSexParticipant = witness.jobs.curDriver is JobDriver_SexBaseInitiator && sexParticipants.Contains((witness.jobs.curDriver as JobDriver_SexBaseInitiator).Partner);
|
||||
bool witnessIsJoiningSex = witness.jobs.curDriver is JobDriver_SexBaseInitiator && sexParticipants.Contains((witness.jobs.curDriver as JobDriver_SexBaseInitiator).Partner);
|
||||
|
||||
if (sexParticipants.Contains(witness) || witnessIsApproachingSexParticipant)
|
||||
if (sexParticipants.Contains(witness) || witnessIsJoiningSex)
|
||||
{ return false; }
|
||||
|
||||
return true;
|
||||
|
@ -62,41 +56,34 @@ namespace Privacy_Please
|
|||
return false;
|
||||
}
|
||||
|
||||
public static bool CouldInvitePasserbyForSex(Pawn passerby, List<Pawn> participants)
|
||||
public static bool PasserbyCanBePropositionedForSex(Pawn passerby, List<Pawn> participants)
|
||||
{
|
||||
if (passerby == null ||
|
||||
participants.Contains(passerby) ||
|
||||
passerby.IsUnfazedBySex() == false ||
|
||||
participants.All(x => x.CanSee(passerby) == false))
|
||||
participants.Contains(passerby) ||
|
||||
participants.Any(x => x.CanSee(passerby) == false))
|
||||
{ return false; }
|
||||
|
||||
if (participants.Count > 2 ||
|
||||
participants.Any(x => x.IsForbidden(passerby) || x.HostileTo(passerby) || PawnIsCheatingOnPartner(x, passerby)) ||
|
||||
participants.Any(x => x.IsForbidden(passerby) || x.HostileTo(passerby)) ||
|
||||
CasualSex_Helper.CanHaveSex(passerby) == false ||
|
||||
xxx.IsTargetPawnOkay(passerby) == false)
|
||||
{ return false; }
|
||||
|
||||
if (passerby.MentalState != null ||
|
||||
passerby.jobs.curDriver is JobDriver_Flee ||
|
||||
passerby.jobs.curDriver is JobDriver_AttackMelee ||
|
||||
passerby.jobs.curDriver is JobDriver_Vomit)
|
||||
xxx.IsTargetPawnOkay(passerby) == false)
|
||||
{ return false; }
|
||||
|
||||
if (SexUtility.ReadyForHookup(passerby) &&
|
||||
(passerby?.jobs?.curJob == null || (passerby.jobs.curJob.playerForced == false && CasualSex_Helper.quickieAllowedJobs.Contains(passerby.jobs.curJob.def))) &&
|
||||
participants.Any(x => SexAppraiser.would_fuck(x, passerby) > 0.1f && SexAppraiser.would_fuck(passerby, x) > 0.1f) &&
|
||||
participants.All(x => SexAppraiser.would_fuck(x, passerby, false, false, true) > 0.1f && SexAppraiser.would_fuck(passerby, x, false, false, true) > 0.1f))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
{ return true; }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ReactionToSexAct GetReactionToSexAct(Pawn witness, JobDriver_Sex jobDriver, bool applyThoughtDefs = false)
|
||||
public static void GetReactionsToSexDiscovery(JobDriver_Sex jobDriver, Pawn witness, out ReactionToSexDiscovery reactionOfPawn, out ReactionToSexDiscovery reactionOfWitness, bool applyThoughtDefs = false)
|
||||
{
|
||||
Pawn pawn = jobDriver.pawn;
|
||||
ReactionToSexAct reactionOfWitness = ReactionToSexAct.Acceptance;
|
||||
|
||||
reactionOfPawn = ReactionToSexDiscovery.Acceptance;
|
||||
reactionOfWitness = ReactionToSexDiscovery.Acceptance;
|
||||
|
||||
// Determine if there are any issues with the sex event and the witness' morals
|
||||
foreach (SexActReactionDef sexActReactionDef in DefDatabase<SexActReactionDef>.AllDefs)
|
||||
|
@ -109,11 +96,9 @@ namespace Privacy_Please
|
|||
if ((bool)methodInfo.Invoke(null, new object[] { jobDriver }))
|
||||
{
|
||||
DebugMode.Message(sexActReactionDef.defName);
|
||||
reactionOfWitness = sexActReactionDef.DetermineReactionOfPawns(pawn, witness, applyThoughtDefs);
|
||||
sexActReactionDef.DetermineReactionOfPawns(pawn, witness, out reactionOfPawn, out reactionOfWitness, applyThoughtDefs);
|
||||
}
|
||||
}
|
||||
|
||||
return reactionOfWitness;
|
||||
}
|
||||
|
||||
public static bool SexActIsNecrophilia(JobDriver_Sex jobDriver)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue