mirror of
https://gitgud.io/AbstractConcept/privacy-please.git
synced 2024-08-15 00:03:18 +00:00
Initial commit
This commit is contained in:
parent
fe7c28ad8e
commit
55402b9891
54 changed files with 2515 additions and 92 deletions
72
Source/Scripts/JobDrivers/JobDriver_JoinInSex.cs
Normal file
72
Source/Scripts/JobDrivers/JobDriver_JoinInSex.cs
Normal file
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using rjw;
|
||||
|
||||
namespace Privacy_Please
|
||||
{
|
||||
public class JobDriver_JoinInSex : JobDriver_SexBaseInitiator
|
||||
{
|
||||
public override bool TryMakePreToilReservations(bool errorOnFailed)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override IEnumerable<Toil> MakeNewToils()
|
||||
{
|
||||
setup_ticks();
|
||||
|
||||
this.FailOnDespawnedNullOrForbidden(iTarget);
|
||||
this.FailOn(() => !Partner.health.capacities.CanBeAwake);
|
||||
this.FailOn(() => pawn.Drafted);
|
||||
this.FailOn(() => Partner.Drafted);
|
||||
|
||||
Toil FollowToil = new Toil();
|
||||
FollowToil.defaultCompleteMode = ToilCompleteMode.Delay;
|
||||
FollowToil.socialMode = RandomSocialMode.Off;
|
||||
FollowToil.defaultDuration = 1200;
|
||||
FollowToil.tickAction = delegate
|
||||
{
|
||||
pawn.pather.StartPath(Partner, PathEndMode.Touch);
|
||||
|
||||
if (pawn.pather.Moving == false && Partner.pather.Moving == false && Partner.jobs.curDriver is JobDriver_SexBaseReciever)
|
||||
{ ReadyForNextToil(); }
|
||||
};
|
||||
yield return FollowToil;
|
||||
|
||||
Toil SexToil = new Toil();
|
||||
SexToil.socialMode = RandomSocialMode.Off;
|
||||
SexToil.defaultDuration = duration;
|
||||
SexToil.handlingFacing = true;
|
||||
SexToil.FailOn(() => (Partner.jobs.curDriver is JobDriver_SexBaseReciever) == false);
|
||||
SexToil.initAction = delegate
|
||||
{
|
||||
Start();
|
||||
Sexprops.usedCondom = CondomUtility.TryUseCondom(pawn) || CondomUtility.TryUseCondom(Partner);
|
||||
};
|
||||
SexToil.AddPreTickAction(delegate
|
||||
{
|
||||
if (pawn.IsHashIntervalTick(ticks_between_hearts))
|
||||
ThrowMetaIconF(pawn.Position, pawn.Map, FleckDefOf.Heart);
|
||||
SexTick(pawn, Partner);
|
||||
SexUtility.reduce_rest(pawn, 1);
|
||||
if (ticks_left <= 0)
|
||||
ReadyForNextToil();
|
||||
});
|
||||
SexToil.AddFinishAction(delegate
|
||||
{
|
||||
End();
|
||||
});
|
||||
yield return SexToil;
|
||||
|
||||
yield return new Toil
|
||||
{
|
||||
initAction = delegate { SexUtility.ProcessSex(Sexprops); },
|
||||
defaultCompleteMode = ToilCompleteMode.Instant
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
49
Source/Scripts/JobDrivers/JobDriver_WatchSex.cs
Normal file
49
Source/Scripts/JobDrivers/JobDriver_WatchSex.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RimWorld;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using rjw;
|
||||
using Rimworld_Animations;
|
||||
|
||||
namespace Privacy_Please
|
||||
{
|
||||
public class JobDriver_WatchSex : JobDriver_SexBaseInitiator
|
||||
{
|
||||
private int ticks_between_eyes = 120;
|
||||
|
||||
public override bool TryMakePreToilReservations(bool errorOnFailed)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override IEnumerable<Toil> MakeNewToils()
|
||||
{
|
||||
this.FailOnDespawnedNullOrForbidden(iTarget);
|
||||
this.FailOn(() => !Partner.health.capacities.CanBeAwake);
|
||||
this.FailOn(() => pawn.Drafted);
|
||||
this.FailOn(() => Partner.Drafted);
|
||||
|
||||
Toil WatchToil = new Toil();
|
||||
WatchToil.defaultCompleteMode = ToilCompleteMode.Never;
|
||||
WatchToil.socialMode = RandomSocialMode.Off;
|
||||
WatchToil.FailOn(() => (Partner.jobs.curDriver is JobDriver_Sex) == false);
|
||||
WatchToil.initAction = delegate
|
||||
{
|
||||
pawn.pather.StopDead();
|
||||
};
|
||||
WatchToil.AddPreTickAction(delegate
|
||||
{
|
||||
if (pawn.IsHashIntervalTick(ticks_between_eyes))
|
||||
{ ThrowMetaIconF(pawn.Position, pawn.Map, ModFleckDefOf.Eye); }
|
||||
|
||||
if (pawn?.needs?.TryGetNeed<Need_Sex>() != null)
|
||||
{ pawn.needs.TryGetNeed<Need_Sex>().CurLevel += 0.5f / 2500f; }
|
||||
});
|
||||
|
||||
yield return WatchToil;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue