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

@ -5,9 +5,7 @@
Approval = 1,
Acceptance = 0,
Discomfort = -1,
Outrage = -2,
Panick = -3,
Nauseated = -3,
Random = -99,
Panic = -2,
Nausea = -3,
}
}

View file

@ -12,20 +12,6 @@ namespace Privacy_Please
public static BodyPartGroupDef ChestBPG;
}
/*[DefOf]
public static class ModThoughtDefOf
{
public static ThoughtDef SeenHavingSex;
public static ThoughtDef SeenHavingSexExhibitionist;
public static ThoughtDef SeenMasturbating;
public static ThoughtDef SeenMasturbatingExhibitionist;
public static ThoughtDef SawSex;
public static ThoughtDef SawSexVoyeur;
public static ThoughtDef SawMasturbation;
public static ThoughtDef SawMasturbationVoyeur;
public static ThoughtDef CaughtCheating;
}*/
[DefOf]
public static class ModPreceptDefOf
{

View file

@ -30,7 +30,6 @@ namespace Privacy_Please
Pawn witness = thing as Pawn;
if (witness == null) continue;
// Caught having sex
if (SexInteractionUtility.PawnCaughtLovinByWitness(pawn, witness))
{
// Get the pawn's and witness' reaction to the discovery
@ -63,20 +62,17 @@ namespace Privacy_Please
}
}
// Threesome
else if (pawn.GetSexReceiver() != null)
// Group sex
else
{
Job job = new Job(DefDatabase<JobDef>.GetNamed("JoinInSex", false), pawn.GetSexReceiver(), bed);
witness.jobs.TryTakeOrderedJob(job);
}
}
// The proposition failed. Awwkkkwaaarrddd....
else if (pawn.IsUnfazedBySex() == false && (int)reactionOfPawn < (int)ReactionToSexDiscovery.Approval)
{
if (BasicSettings.whoringIsUninteruptable && jobDriver?.Sexprops.isWhoring == true)
{ return; }
// The proposition failed. Is this awkward for those having sex?
else if (SexInteractionUtility.PawnWorriesAboutSexWitness(pawn, witness) && (int)reactionOfPawn < (int)ReactionToSexDiscovery.Approval)
{
// The pawn is uncomfortable and is stopping sex
foreach (Pawn participant in pawn.GetAllSexParticipants())
{ participant.jobs.EndCurrentJob(JobCondition.InterruptForced, false, false); }

View file

@ -14,18 +14,35 @@ namespace Privacy_Please
{
public static bool PawnCaughtLovinByWitness(Pawn pawn, Pawn witness)
{
if (witness == null || pawn == witness || witness.IsUnableToSenseSex() || witness.CanSee(pawn) == false)
{ return false; }
if (witness == null || pawn == witness || witness.IsUnableToSenseSex() || witness.CanSee(pawn) == false) return false;
List<Pawn> sexParticipants = pawn.GetAllSexParticipants();
bool witnessIsJoiningSex = witness.jobs.curDriver is JobDriver_SexBaseInitiator && sexParticipants.Contains((witness.jobs.curDriver as JobDriver_SexBaseInitiator).Partner);
if (sexParticipants.Contains(witness) || witnessIsJoiningSex)
{ return false; }
if (sexParticipants.Contains(witness) || witnessIsJoiningSex) return false;
return true;
}
public static bool PawnWorriesAboutSexWitness(Pawn pawn, Pawn witness)
{
JobDriver_Sex jobDriver = pawn.jobs.curDriver as JobDriver_Sex;
if (pawn.IsUnableToSenseSex() || pawn.AnimalOrWildMan() || pawn.RaceProps.IsMechanoid || pawn.Faction.HostileTo(Faction.OfPlayer)) return false;
if (BasicSettings.rapeIsUninteruptable && jobDriver?.Sexprops.isRape == true) return true;
if (witness.HostileTo(pawn)) return true;
if (witness.RaceProps.Animal || witness.RaceProps.IsMechanoid) return false;
if (pawn.Drafted == true || pawn.mindState?.duty?.def?.alwaysShowWeapon == true) return false;
if (BasicSettings.slavesIgnoreSex && (pawn.IsPrisoner || pawn.IsSlave || witness.IsPrisoner || witness.IsSlave)) return false;
if (BasicSettings.otherFactionsIgnoreSex && (pawn.Faction.IsPlayer == false || witness.Faction.IsPlayer == false)) return false;
if (BasicSettings.whoringIsUninteruptable && jobDriver?.Sexprops.isWhoring == true) return true;
return true;
}
public static bool PawnIsCheatingOnPartner(Pawn pawn, Pawn partner)
{
List<Pawn> spouses = pawn.GetSpouses(false);
@ -36,8 +53,8 @@ namespace Privacy_Please
partner.HasTrait("Polygamous") ||
partner.IsMasturbating() ||
partner.IsHavingSex() == false ||
partner.GetSexPartner()?.Dead == true ||
partner.GetSexPartner()?.IsAnimal() == true ||
SexActIsXenophilia(partner.jobs.curDriver as JobDriver_Sex) ||
SexActIsBestiality(partner.jobs.curDriver as JobDriver_Sex) ||
partner.GetAllSexParticipants().Contains(pawn) ||
(spouses.NullOrEmpty() == false && partner.GetAllSexParticipants().Any(x => spouses.Contains(x))))
{ return false; }
@ -94,10 +111,36 @@ namespace Privacy_Please
{ DebugMode.Message("Method '" + sexActReactionDef.sexActCheck + "' was not found"); continue; }
if ((bool)methodInfo.Invoke(null, new object[] { jobDriver }))
{ sexActReactionDef.DetermineReactionOfPawns(pawn, witness, out reactionOfPawn, out reactionOfWitness, applyThoughtDefs); }
}
// Exit here if thoughtDefs are not being applied
if (applyThoughtDefs == false) return;
// Panic reaction
if (reactionOfWitness == ReactionToSexDiscovery.Panic)
{
Job job = JobMaker.MakeJob(JobDefOf.FleeAndCower, CellFinderLoose.GetFleeDest(witness, new List<Thing>() { pawn }, 24f), pawn);
witness.jobs.EndCurrentJob(JobCondition.InterruptForced, false, false);
witness.jobs.StartJob(job);
}
// Vomit reaction
else if (reactionOfWitness == ReactionToSexDiscovery.Nausea)
{
Job jobVomit = JobMaker.MakeJob(JobDefOf.Vomit);
Job jobFlee = JobMaker.MakeJob(JobDefOf.FleeAndCower, CellFinderLoose.GetFleeDest(witness, new List<Thing>() { pawn }, 24f), pawn);
witness.jobs.EndCurrentJob(JobCondition.InterruptForced, false, false);
if (Random.value <= 0.25f)
{
DebugMode.Message(sexActReactionDef.defName);
sexActReactionDef.DetermineReactionOfPawns(pawn, witness, out reactionOfPawn, out reactionOfWitness, applyThoughtDefs);
witness.jobs.StartJob(jobVomit);
witness.jobs.jobQueue.EnqueueFirst(jobFlee);
}
else
{ witness.jobs.StartJob(jobFlee); }
}
}