diff --git a/1.4/Assemblies/RJWSexperience.dll b/1.4/Assemblies/RJWSexperience.dll index b494450..d07dbbe 100644 Binary files a/1.4/Assemblies/RJWSexperience.dll and b/1.4/Assemblies/RJWSexperience.dll differ diff --git a/About/Manifest.xml b/About/Manifest.xml index b412805..99d4cc2 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJWSexperience - 1.1.3.0 + 1.1.2.1
  • RimJobWorld >= 5.3.0
  • diff --git a/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll b/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll index 318e183..1e02e43 100644 Binary files a/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll and b/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll differ diff --git a/Source/RJWSexperience/Patches/RJW_Patch.cs b/Source/RJWSexperience/Patches/RJW_Patch.cs index b3ccd7c..e0c3418 100644 --- a/Source/RJWSexperience/Patches/RJW_Patch.cs +++ b/Source/RJWSexperience/Patches/RJW_Patch.cs @@ -5,7 +5,6 @@ using RJWSexperience.Cum; using RJWSexperience.Logs; using RJWSexperience.SexHistory; using System; -using System.Collections.Generic; using UnityEngine; using Verse; @@ -45,7 +44,7 @@ namespace RJWSexperience LustUtility.UpdateLust(props, satisfaction, base_sat_per_fuck); CumUtility.FillCumBuckets(props); props.pawn.records?.Increment(VariousDefOf.OrgasmCount); - if (SexperienceMod.Settings.EnableSexHistory && props.hasPartner()) + if (SexperienceMod.Settings.EnableSexHistory && props.partner != null) props.pawn.TryGetComp()?.RecordSatisfaction(props.partner, props, satisfaction); } } @@ -81,7 +80,7 @@ namespace RJWSexperience { RJWUtility.UpdateSextypeRecords(props); - if (!SexperienceMod.Settings.EnableSexHistory || !props.hasPartner()) + if (!SexperienceMod.Settings.EnableSexHistory || props.partner == null) return; props.pawn.TryGetComp()?.RecordSex(props.partner, props); @@ -94,7 +93,7 @@ namespace RJWSexperience { public static void Postfix(JobDriver_SexBaseInitiator __instance) { - if (__instance.Sexprops.hasPartner()) + if (__instance.Partner != null) { __instance.pawn.PoptheCherry(__instance.Partner, __instance.Sexprops); __instance.Partner.PoptheCherry(__instance.pawn, __instance.Sexprops); @@ -111,10 +110,10 @@ namespace RJWSexperience /// /// /// - /// Run original method + /// public static bool Prefix(Pawn pawn, Pawn partner, ref IntVec3 __result) { - if (partner != null && partner != pawn) + if (partner != null) return true; // Not masturbation var log = LogManager.GetLogger("RJW_Patch_CasualSex_Helper_FindSexLocation"); @@ -130,51 +129,13 @@ namespace RJWSexperience if (bucket == null) { - log.Message("404 Bucket not found"); + log.Message("Bucket not found"); return true; } - Room bucketRoom = bucket.GetRoom(); - - List cellsAroundBucket = GenAdjFast.AdjacentCells8Way(bucket.Position); - IntVec3 doorNearBucket = IntVec3.Invalid; - - foreach (IntVec3 cell in cellsAroundBucket.InRandomOrder()) - { - if (!cell.Standable(bucket.Map)) - { - log.Message($"Discarded {cell}: not standable"); - continue; - } - - if (cell.GetRoom(bucket.Map) != bucketRoom) - { - if (cell.GetDoor(bucket.Map) != null) - { - doorNearBucket = cell; - } - else - { - log.Message($"Discarded {cell}: different room"); - } - - continue; - } - - __result = cell; - log.Message($"Masturbate at location: {__result}"); - return false; - } - - if (doorNearBucket != IntVec3.Invalid) - { - __result = doorNearBucket; - log.Message($"No proper place found, go jack off in the doorway: {__result}"); - return false; - } - - log.Message($"Failed to find situable location near the bucket at {bucket.Position}"); - return true; + __result = bucket.RandomAdjacentCell8Way(); + log.Message($"Bucket location: {__result}"); + return false; } } diff --git a/Source/RJWSexperience/SexHistory/SexHistoryComp.cs b/Source/RJWSexperience/SexHistory/SexHistoryComp.cs index 65f7928..3598d3a 100644 --- a/Source/RJWSexperience/SexHistory/SexHistoryComp.cs +++ b/Source/RJWSexperience/SexHistory/SexHistoryComp.cs @@ -44,8 +44,6 @@ namespace RJWSexperience.SexHistory public Gizmo Gizmo { get; private set; } - public Pawn ParentPawn => parent as Pawn; - public SexPartnerHistoryRecord GetFirstPartnerHistory => histories.TryGetValue(first); public SexPartnerHistoryRecord GetMostPartnerHistory @@ -247,16 +245,17 @@ namespace RJWSexperience.SexHistory public void RecordSex(Pawn partner, SexProps props) { + Pawn pawn = parent as Pawn; RecordFirst(partner, props); GetPartnerRecord(partner)?.RecordSex(props); recentPartner = partner.ThingID; recentSex = props.sexType; sextypeCount[(int)props.sexType]++; sextypeRecentTickAbs[(int)props.sexType] = GenTicks.TicksAbs; - if (partner.IsIncest(ParentPawn)) incestuous++; + if (partner.IsIncest(pawn)) incestuous++; if (partner.Dead) corpsefuck++; if (props.IsBestiality()) bestiality++; - else if (ParentPawn.def != partner.def) interspecies++; + else if (pawn.def != partner.def) interspecies++; dirty = true; } @@ -276,7 +275,7 @@ namespace RJWSexperience.SexHistory first = partner.ThingID; SexHistoryComp history = partner.TryGetComp(); firstSexTickAbs = GenTicks.TicksAbs; - history?.TakeSomeonesVirgin(ParentPawn); + history?.TakeSomeonesVirgin(parent as Pawn); } } @@ -289,9 +288,12 @@ namespace RJWSexperience.SexHistory return record; } - SexPartnerHistoryRecord newRecord = new SexPartnerHistoryRecord(partner, partner.IsIncest(ParentPawn)); + SexPartnerHistoryRecord newRecord = new SexPartnerHistoryRecord(partner, partner.IsIncest(parent as Pawn)); histories.Add(partnerId, newRecord); - ParentPawn.records.Increment(VariousDefOf.SexPartnerCount); + if (parent is Pawn pawn) + { + pawn.records.Increment(VariousDefOf.SexPartnerCount); + } return newRecord; } @@ -416,15 +418,15 @@ namespace RJWSexperience.SexHistory protected bool VirginCheck() { - if (histories.TryGetValue(first) != null) - return false; + if (histories.TryGetValue(first) != null) return false; - return ParentPawn.IsVirgin(); + Pawn pawn = parent as Pawn; + return pawn?.IsVirgin() == true; } public override IEnumerable CompGetGizmosExtra() { - if (SexperienceMod.Settings.HideGizmoWhenDrafted && ParentPawn.Drafted) + if (SexperienceMod.Settings.HideGizmoWhenDrafted && (parent as Pawn)?.Drafted == true) yield break; if (Find.Selector.NumSelected > 1) @@ -445,7 +447,7 @@ namespace RJWSexperience.SexHistory hotKey = VariousDefOf.OpenSexStatistics, action = delegate { - UI.SexStatusWindow.ToggleWindow(ParentPawn, this); + UI.SexStatusWindow.ToggleWindow(parent as Pawn, this); } }; } diff --git a/Source/RJWSexperience/SexHistory/UI/SexStatus.cs b/Source/RJWSexperience/SexHistory/UI/SexStatus.cs index 880933b..f9dfe8c 100644 --- a/Source/RJWSexperience/SexHistory/UI/SexStatus.cs +++ b/Source/RJWSexperience/SexHistory/UI/SexStatus.cs @@ -223,7 +223,7 @@ namespace RJWSexperience.SexHistory.UI DrawBaseSexInfoLeft(leftRect.ContractedBy(4f)); //Center section - DrawBaseSexInfoCenter(centerRect.ContractedBy(4f), history.ParentPawn); + DrawBaseSexInfoCenter(centerRect.ContractedBy(4f), history.parent as Pawn); //Right section DrawBaseSexInfoRight(rightRect.ContractedBy(4f)); diff --git a/changelogs.txt b/changelogs.txt index ff36265..da650a5 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,9 +1,3 @@ -Version 1.1.3.0 - - Removed "Hide Sex History button with RJW designators" setting - - Fixed error with pawn masturbated on the map border - - Fixed counting self as a sex partner - - Fixed patch on FindSexLocation returning location in walls - Version 1.1.2.1 - Fixed 1.3 assembly