4.1.1 compatibility

This commit is contained in:
Platinum 2020-04-26 08:03:57 -07:00
parent 2b2eee2e6f
commit 150e567a1d
7 changed files with 34 additions and 38 deletions

View File

@ -16,7 +16,7 @@ namespace Rimworld_Animations {
*/
public static AnimationDef tryFindAnimation(ref List<Pawn> 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

View File

@ -26,7 +26,7 @@ namespace Rimworld_Animations {
Animating = value;
if(value == true) {
xxx.DrawNude(pawn);
SexUtility.DrawNude(pawn);
} else {
pawn.Drawer.renderer.graphics.ResolveAllGraphics();
}

View File

@ -41,11 +41,10 @@ namespace Rimworld_Animations {
get_loved.FailOn(() => Partner.CurJobDef != DefDatabase<JobDef>.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))

View File

@ -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<Toil> MakeNewToils() {
@ -49,6 +46,7 @@ namespace Rimworld_Animations {
sexToil.FailOn(() => (Partner.CurJobDef == null) || Partner.CurJobDef != DefDatabase<JobDef>.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;

View File

@ -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) {

View File

@ -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<CompBodyAnimator>().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;
}
}
}
}