diff --git a/1.1/Assemblies/Rimworld-Animations.dll b/1.1/Assemblies/Rimworld-Animations.dll index 282998b..49e0e8f 100644 Binary files a/1.1/Assemblies/Rimworld-Animations.dll and b/1.1/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/AnimationUtility.cs b/Source/AnimationUtility.cs index 705fb78..1056a62 100644 --- a/Source/AnimationUtility.cs +++ b/Source/AnimationUtility.cs @@ -16,7 +16,7 @@ namespace Rimworld_Animations { */ public static AnimationDef tryFindAnimation(ref List participants, rjw.xxx.rjwSextype sexType = 0) { - //aggressors first + //aggressors last participants = participants.OrderBy(p => p.jobs.curDriver is rjw.JobDriver_SexBaseInitiator).ToList(); //fucked first, fucking second diff --git a/Source/Comps/CompBodyAnimator.cs b/Source/Comps/CompBodyAnimator.cs index 7614254..efa0fc5 100644 --- a/Source/Comps/CompBodyAnimator.cs +++ b/Source/Comps/CompBodyAnimator.cs @@ -26,7 +26,7 @@ namespace Rimworld_Animations { Animating = value; if(value == true) { - xxx.DrawNude(pawn); + SexUtility.DrawNude(pawn); } else { pawn.Drawer.renderer.graphics.ResolveAllGraphics(); } diff --git a/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs b/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs index 0456ffe..30302e1 100644 --- a/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs +++ b/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs @@ -41,11 +41,10 @@ namespace Rimworld_Animations { get_loved.FailOn(() => Partner.CurJobDef != DefDatabase.GetNamed("JoinInBedAnimation", true)); get_loved.defaultCompleteMode = ToilCompleteMode.Never; get_loved.socialMode = RandomSocialMode.Off; + get_loved.handlingFacing = true; get_loved.AddPreTickAction(delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); - if (pawn.IsHashIntervalTick(ticks_between_thrusts)) - xxx.sexTick(pawn, Partner, false); }); get_loved.AddFinishAction(delegate { if (xxx.is_human(pawn)) diff --git a/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs b/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs index ee111f9..25e46f3 100644 --- a/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs +++ b/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs @@ -14,11 +14,8 @@ namespace Rimworld_Animations { public readonly TargetIndex ipartner = TargetIndex.A; public readonly TargetIndex ibed = TargetIndex.B; - public Pawn Partner => (Pawn)job.GetTarget(ipartner); - public new Building_Bed Bed => (Building_Bed)job.GetTarget(ibed); - public override bool TryMakePreToilReservations(bool errorOnFailed) { - return ReservationUtility.Reserve(base.pawn, Partner, job, xxx.max_rapists_per_prisoner, 0, null, errorOnFailed); + return pawn.Reserve(Target, job, xxx.max_rapists_per_prisoner, 0, null, errorOnFailed); } protected override IEnumerable MakeNewToils() { @@ -49,6 +46,7 @@ namespace Rimworld_Animations { sexToil.FailOn(() => (Partner.CurJobDef == null) || Partner.CurJobDef != DefDatabase.GetNamed("GettinLovedAnimation", true)); //partner jobdriver is not sexbaserecieverlovedforanim sexToil.socialMode = RandomSocialMode.Off; sexToil.defaultCompleteMode = ToilCompleteMode.Never; + sexToil.handlingFacing = true; sexToil.initAction = delegate { usedCondom = (CondomUtility.TryUseCondom(base.pawn) || CondomUtility.TryUseCondom(Partner)); @@ -61,10 +59,9 @@ namespace Rimworld_Animations { if(Gen.IsHashIntervalTick(pawn, ticks_between_hearts)) { MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); } - PawnUtility.GainComfortFromCellIfPossible(pawn, false); - PawnUtility.GainComfortFromCellIfPossible(Partner, false); - xxx.reduce_rest(Partner); - xxx.reduce_rest(pawn, 2); + SexTick(pawn, Partner); + SexUtility.reduce_rest(Partner); + SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); @@ -72,16 +69,13 @@ namespace Rimworld_Animations { sexToil.AddFinishAction(delegate { End(); - if(xxx.is_human(pawn)) { - pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); - } }); yield return sexToil; Toil finish = new Toil(); finish.initAction = delegate { - SexUtility.ProcessSex(pawn, Partner, usedCondom); + SexUtility.ProcessSex(pawn, Partner, usedCondom, isRape, isCoreLovin: false, isWhoring, sexType); }; finish.defaultCompleteMode = ToilCompleteMode.Instant; yield return finish; diff --git a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs index 6600394..310aee1 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -41,8 +41,8 @@ namespace Rimworld_Animations { } else if (__instance is JobDriver_Masturbate_Bed) bed = (__instance as JobDriver_Masturbate_Bed).Bed; - else if (__instance is JobDriver_RapeComfortPawn || __instance is JobDriver_Breeding) - bed = (__instance?.Partner?.jobs?.curDriver as JobDriver_Sex)?.pBed; + else if (__instance is JobDriver_Rape) + bed = (__instance?.Partner?.jobs?.curDriver as JobDriver_Sex)?.Bed; if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) { diff --git a/Source/Patches/rjwPatches/HarmonyPatch_SexTick.cs b/Source/Patches/rjwPatches/HarmonyPatch_SexTick.cs index 7a55e98..289e8b4 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_SexTick.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_SexTick.cs @@ -11,32 +11,35 @@ using Verse.Sound; namespace Rimworld_Animations { - [HarmonyPatch(typeof(xxx), "sexTick")] - public static class HarmonyPatch_SexTick { + [HarmonyPatch(typeof(JobDriver_Sex), "SexTick")] + public static class HarmonyPatch_SexTick { - public static bool Prefix(ref Pawn pawn, ref Pawn partner, ref bool enablerotation, ref bool pawnnude, ref bool partnernude) { + public static bool Prefix(ref JobDriver_Sex __instance, ref Pawn pawn, ref Thing target, ref bool pawnnude, ref bool partnernude) { + Pawn pawn2 = target as Pawn; + if (pawn.IsHashIntervalTick(__instance.ticks_between_thrusts)) { - if (enablerotation) { - pawn.rotationTracker.Face(((Thing)partner).DrawPos); - partner.rotationTracker.Face(((Thing)pawn).DrawPos); + __instance.Animate(pawn, pawn2); + + if (!AnimationSettings.soundOverride) { + __instance.PlaySexSound(); + } + + if (!__instance.isRape) { + pawn.GainComfortFromCellIfPossible(); + pawn2?.GainComfortFromCellIfPossible(); + } } - if (RJWSettings.sounds_enabled && (!pawn.TryGetComp().isAnimating || !AnimationSettings.soundOverride)) { - SoundDef.Named("Sex").PlayOneShot(new TargetInfo(pawn.Position, pawn.Map)); - } - pawn.Drawer.Notify_MeleeAttackOn((Thing)(object)partner); - if (enablerotation) { - pawn.rotationTracker.FaceCell(partner.Position); - } - if (pawnnude && !xxx.has_quirk(pawn, "Endytophile")) { - xxx.DrawNude(pawn); - } - if (partnernude && !xxx.has_quirk(pawn, "Endytophile")) { - xxx.DrawNude(partner); + if (!xxx.has_quirk(pawn, "Endytophile")) { + if (pawnnude) { + SexUtility.DrawNude(pawn); + } + if (pawn2 != null && partnernude) { + SexUtility.DrawNude(pawn2); + } } return false; } - - } + } }