mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
4.1.1 compatibility
This commit is contained in:
parent
2b2eee2e6f
commit
150e567a1d
7 changed files with 34 additions and 38 deletions
Binary file not shown.
|
@ -16,7 +16,7 @@ namespace Rimworld_Animations {
|
||||||
*/
|
*/
|
||||||
public static AnimationDef tryFindAnimation(ref List<Pawn> participants, rjw.xxx.rjwSextype sexType = 0) {
|
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();
|
participants = participants.OrderBy(p => p.jobs.curDriver is rjw.JobDriver_SexBaseInitiator).ToList();
|
||||||
|
|
||||||
//fucked first, fucking second
|
//fucked first, fucking second
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace Rimworld_Animations {
|
||||||
Animating = value;
|
Animating = value;
|
||||||
|
|
||||||
if(value == true) {
|
if(value == true) {
|
||||||
xxx.DrawNude(pawn);
|
SexUtility.DrawNude(pawn);
|
||||||
} else {
|
} else {
|
||||||
pawn.Drawer.renderer.graphics.ResolveAllGraphics();
|
pawn.Drawer.renderer.graphics.ResolveAllGraphics();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,11 +41,10 @@ namespace Rimworld_Animations {
|
||||||
get_loved.FailOn(() => Partner.CurJobDef != DefDatabase<JobDef>.GetNamed("JoinInBedAnimation", true));
|
get_loved.FailOn(() => Partner.CurJobDef != DefDatabase<JobDef>.GetNamed("JoinInBedAnimation", true));
|
||||||
get_loved.defaultCompleteMode = ToilCompleteMode.Never;
|
get_loved.defaultCompleteMode = ToilCompleteMode.Never;
|
||||||
get_loved.socialMode = RandomSocialMode.Off;
|
get_loved.socialMode = RandomSocialMode.Off;
|
||||||
|
get_loved.handlingFacing = true;
|
||||||
get_loved.AddPreTickAction(delegate {
|
get_loved.AddPreTickAction(delegate {
|
||||||
if (pawn.IsHashIntervalTick(ticks_between_hearts))
|
if (pawn.IsHashIntervalTick(ticks_between_hearts))
|
||||||
MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);
|
MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);
|
||||||
if (pawn.IsHashIntervalTick(ticks_between_thrusts))
|
|
||||||
xxx.sexTick(pawn, Partner, false);
|
|
||||||
});
|
});
|
||||||
get_loved.AddFinishAction(delegate {
|
get_loved.AddFinishAction(delegate {
|
||||||
if (xxx.is_human(pawn))
|
if (xxx.is_human(pawn))
|
||||||
|
|
|
@ -14,11 +14,8 @@ namespace Rimworld_Animations {
|
||||||
public readonly TargetIndex ipartner = TargetIndex.A;
|
public readonly TargetIndex ipartner = TargetIndex.A;
|
||||||
public readonly TargetIndex ibed = TargetIndex.B;
|
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) {
|
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() {
|
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.FailOn(() => (Partner.CurJobDef == null) || Partner.CurJobDef != DefDatabase<JobDef>.GetNamed("GettinLovedAnimation", true)); //partner jobdriver is not sexbaserecieverlovedforanim
|
||||||
sexToil.socialMode = RandomSocialMode.Off;
|
sexToil.socialMode = RandomSocialMode.Off;
|
||||||
sexToil.defaultCompleteMode = ToilCompleteMode.Never;
|
sexToil.defaultCompleteMode = ToilCompleteMode.Never;
|
||||||
|
sexToil.handlingFacing = true;
|
||||||
sexToil.initAction = delegate {
|
sexToil.initAction = delegate {
|
||||||
|
|
||||||
usedCondom = (CondomUtility.TryUseCondom(base.pawn) || CondomUtility.TryUseCondom(Partner));
|
usedCondom = (CondomUtility.TryUseCondom(base.pawn) || CondomUtility.TryUseCondom(Partner));
|
||||||
|
@ -61,10 +59,9 @@ namespace Rimworld_Animations {
|
||||||
if(Gen.IsHashIntervalTick(pawn, ticks_between_hearts)) {
|
if(Gen.IsHashIntervalTick(pawn, ticks_between_hearts)) {
|
||||||
MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);
|
MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);
|
||||||
}
|
}
|
||||||
PawnUtility.GainComfortFromCellIfPossible(pawn, false);
|
SexTick(pawn, Partner);
|
||||||
PawnUtility.GainComfortFromCellIfPossible(Partner, false);
|
SexUtility.reduce_rest(Partner);
|
||||||
xxx.reduce_rest(Partner);
|
SexUtility.reduce_rest(pawn, 2);
|
||||||
xxx.reduce_rest(pawn, 2);
|
|
||||||
if (ticks_left <= 0)
|
if (ticks_left <= 0)
|
||||||
ReadyForNextToil();
|
ReadyForNextToil();
|
||||||
|
|
||||||
|
@ -72,16 +69,13 @@ namespace Rimworld_Animations {
|
||||||
sexToil.AddFinishAction(delegate {
|
sexToil.AddFinishAction(delegate {
|
||||||
|
|
||||||
End();
|
End();
|
||||||
if(xxx.is_human(pawn)) {
|
|
||||||
pawn.Drawer.renderer.graphics.ResolveApparelGraphics();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
yield return sexToil;
|
yield return sexToil;
|
||||||
|
|
||||||
Toil finish = new Toil();
|
Toil finish = new Toil();
|
||||||
finish.initAction = delegate {
|
finish.initAction = delegate {
|
||||||
SexUtility.ProcessSex(pawn, Partner, usedCondom);
|
SexUtility.ProcessSex(pawn, Partner, usedCondom, isRape, isCoreLovin: false, isWhoring, sexType);
|
||||||
};
|
};
|
||||||
finish.defaultCompleteMode = ToilCompleteMode.Instant;
|
finish.defaultCompleteMode = ToilCompleteMode.Instant;
|
||||||
yield return finish;
|
yield return finish;
|
||||||
|
|
|
@ -41,8 +41,8 @@ namespace Rimworld_Animations {
|
||||||
}
|
}
|
||||||
else if (__instance is JobDriver_Masturbate_Bed)
|
else if (__instance is JobDriver_Masturbate_Bed)
|
||||||
bed = (__instance as JobDriver_Masturbate_Bed).Bed;
|
bed = (__instance as JobDriver_Masturbate_Bed).Bed;
|
||||||
else if (__instance is JobDriver_RapeComfortPawn || __instance is JobDriver_Breeding)
|
else if (__instance is JobDriver_Rape)
|
||||||
bed = (__instance?.Partner?.jobs?.curDriver as JobDriver_Sex)?.pBed;
|
bed = (__instance?.Partner?.jobs?.curDriver as JobDriver_Sex)?.Bed;
|
||||||
|
|
||||||
if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) {
|
if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) {
|
||||||
|
|
||||||
|
|
|
@ -11,32 +11,35 @@ using Verse.Sound;
|
||||||
|
|
||||||
namespace Rimworld_Animations {
|
namespace Rimworld_Animations {
|
||||||
|
|
||||||
[HarmonyPatch(typeof(xxx), "sexTick")]
|
[HarmonyPatch(typeof(JobDriver_Sex), "SexTick")]
|
||||||
public static class HarmonyPatch_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) {
|
__instance.Animate(pawn, pawn2);
|
||||||
pawn.rotationTracker.Face(((Thing)partner).DrawPos);
|
|
||||||
partner.rotationTracker.Face(((Thing)pawn).DrawPos);
|
if (!AnimationSettings.soundOverride) {
|
||||||
|
__instance.PlaySexSound();
|
||||||
}
|
}
|
||||||
if (RJWSettings.sounds_enabled && (!pawn.TryGetComp<CompBodyAnimator>().isAnimating || !AnimationSettings.soundOverride)) {
|
|
||||||
SoundDef.Named("Sex").PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
if (!__instance.isRape) {
|
||||||
|
pawn.GainComfortFromCellIfPossible();
|
||||||
|
pawn2?.GainComfortFromCellIfPossible();
|
||||||
}
|
}
|
||||||
pawn.Drawer.Notify_MeleeAttackOn((Thing)(object)partner);
|
|
||||||
if (enablerotation) {
|
|
||||||
pawn.rotationTracker.FaceCell(partner.Position);
|
|
||||||
}
|
}
|
||||||
if (pawnnude && !xxx.has_quirk(pawn, "Endytophile")) {
|
if (!xxx.has_quirk(pawn, "Endytophile")) {
|
||||||
xxx.DrawNude(pawn);
|
if (pawnnude) {
|
||||||
|
SexUtility.DrawNude(pawn);
|
||||||
|
}
|
||||||
|
if (pawn2 != null && partnernude) {
|
||||||
|
SexUtility.DrawNude(pawn2);
|
||||||
}
|
}
|
||||||
if (partnernude && !xxx.has_quirk(pawn, "Endytophile")) {
|
|
||||||
xxx.DrawNude(partner);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue