Update for RJW 4.6.6 + tweaks to allow threesomes again

This commit is contained in:
c0ffee 2021-04-02 09:18:43 -07:00
parent 099ad96551
commit a940108cc3
6 changed files with 42 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>Rimworld-Animations</identifier>
<version>1.0.14</version>
<version>1.0.15</version>
</Manifest>

View File

@ -45,7 +45,7 @@
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\RJW\1.2\Assemblies\RJW.dll</HintPath>
<HintPath>..\rjw-master\1.2\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />

View File

@ -47,7 +47,19 @@ namespace Rimworld_Animations {
yield return Toils_Reserve.Reserve(ibed, Bed.SleepingSlotsCount, 0);
Toil get_loved = new Toil();
get_loved.FailOn(() => Partner.CurJobDef != DefDatabase<JobDef>.GetNamed("JoinInBedAnimation", true));
get_loved.FailOn(() => {
for (int i = 0; i < parteners.Count; i++)
{
if (parteners[i].CurJobDef != DefDatabase<JobDef>.GetNamed("JoinInBedAnimation", true))
{
return true;
}
}
return false;
});
get_loved.defaultCompleteMode = ToilCompleteMode.Never;
get_loved.socialMode = RandomSocialMode.Off;
get_loved.handlingFacing = true;
@ -55,6 +67,15 @@ namespace Rimworld_Animations {
if (pawn.IsHashIntervalTick(ticks_between_hearts))
MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);
});
get_loved.AddEndCondition(() =>
{
if (parteners.Count <= 0)
{
return JobCondition.Succeeded;
}
return JobCondition.Ongoing;
});
get_loved.AddFinishAction(delegate {
if (xxx.is_human(pawn))
pawn.Drawer.renderer.graphics.ResolveApparelGraphics();

View File

@ -27,7 +27,7 @@ namespace Rimworld_Animations {
yield return Toils_Reserve.Reserve(ipartner, xxx.max_rapists_per_prisoner, 0, null);
Toil goToPawnInBed = Toils_Goto.GotoThing(ipartner, PathEndMode.OnCell);
goToPawnInBed.FailOn(() => !RestUtility.InBed(Partner) && !xxx.in_same_bed(Partner, pawn));
goToPawnInBed.FailOn(() => !RestUtility.InBed(Partner) && Partner.CurJobDef != DefDatabase<JobDef>.GetNamed("GettinLovedAnimation") && !xxx.in_same_bed(Partner, pawn));
yield return goToPawnInBed;
@ -35,10 +35,14 @@ namespace Rimworld_Animations {
Toil startPartnerSex = new Toil();
startPartnerSex.initAction = delegate {
Job gettinLovedJob = JobMaker.MakeJob(DefDatabase<JobDef>.GetNamed("GettinLovedAnimation"), pawn, Bed); // new gettin loved toil that wakes up the pawn goes here
if(Partner.CurJobDef != DefDatabase<JobDef>.GetNamed("GettinLovedAnimation")) // allows threesomes
{
Job gettinLovedJob = JobMaker.MakeJob(DefDatabase<JobDef>.GetNamed("GettinLovedAnimation"), pawn, Bed); // new gettin loved toil that wakes up the pawn goes here
Partner.jobs.jobQueue.EnqueueFirst(gettinLovedJob);
Partner.jobs.EndCurrentJob(JobCondition.InterruptForced);
}
Partner.jobs.jobQueue.EnqueueFirst(gettinLovedJob);
Partner.jobs.EndCurrentJob(JobCondition.InterruptForced);
};
yield return startPartnerSex;
@ -55,6 +59,11 @@ namespace Rimworld_Animations {
sexToil.AddPreTickAction(delegate {
if(!Partner.TryGetComp<CompBodyAnimator>().isAnimating)
{
pawn.TryGetComp<CompBodyAnimator>().isAnimating = false;
}
ticks_left--;
if(Gen.IsHashIntervalTick(pawn, ticks_between_hearts)) {
MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);

View File

@ -106,7 +106,6 @@ namespace Rimworld_Animations {
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_left = anim.animationTimeTicks;
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticksLeftThisToil = anim.animationTimeTicks;
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).duration = anim.animationTimeTicks;
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_remaining = anim.animationTimeTicks;
if(!AnimationSettings.hearts) {
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_between_hearts = Int32.MaxValue;
}
@ -115,11 +114,16 @@ namespace Rimworld_Animations {
}
else {
Log.Message("No animation found");
/*
//if pawn isn't already animating,
if (!pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
(pawn.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration);
//they'll just do the thrusting anim
}
*/
}
}
}