mirror of
https://gitgud.io/c0ffeeeeeeee/rjw-toys-and-masturbation.git
synced 2024-08-15 00:43:44 +00:00
updates for 1.3
This commit is contained in:
parent
da8939c4b8
commit
00e8d5cf4e
8 changed files with 58 additions and 19 deletions
|
@ -9,16 +9,18 @@ using rjw;
|
|||
using Verse.AI;
|
||||
|
||||
namespace RJW_ToysAndMasturbation {
|
||||
class JobDriver_MasturbateWithToy : JobDriver_SexBaseInitiator {
|
||||
public class JobDriver_MasturbateWithToy : JobDriver_SexBaseInitiator {
|
||||
|
||||
public IntVec3 cell => (IntVec3)job.GetTarget(iCell);
|
||||
public Thing dildo => (Thing)job.GetTarget(TargetIndex.A);
|
||||
public override bool TryMakePreToilReservations(bool errorOnFailed) {
|
||||
return ReservationUtility.Reserve(pawn, job.targetA, job, stackCount: 1, errorOnFailed: false);
|
||||
}
|
||||
|
||||
public new void setup_ticks() {
|
||||
base.setup_ticks();
|
||||
duration = (int)(xxx.is_frustrated(base.pawn) ? (2500f * Rand.Range(0.2f, 0.7f)) : (2500f * Rand.Range(0.2f, 0.4f)));
|
||||
duration = ticks_left = (int)(xxx.is_frustrated(base.pawn) ? (2500f * Rand.Range(0.2f, 0.7f)) : (2500f * Rand.Range(0.2f, 0.4f)));
|
||||
|
||||
}
|
||||
|
||||
protected override IEnumerable<Toil> MakeNewToils() {
|
||||
|
@ -31,12 +33,6 @@ namespace RJW_ToysAndMasturbation {
|
|||
|
||||
yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.A);
|
||||
yield return Toils_Haul.StartCarryThing(TargetIndex.A);
|
||||
|
||||
if (!SexToyUtility.isRJWAnimationsLoaded || true /*True for now*/) {
|
||||
//place down if anims isn't loaded
|
||||
yield return Toils_Haul.CarryHauledThingToCell(TargetIndex.C);
|
||||
yield return Toils_Haul.PlaceHauledThingInCell(TargetIndex.C, Toils_Goto.GotoCell(TargetIndex.C, PathEndMode.OnCell), storageMode: false);
|
||||
}
|
||||
|
||||
yield return Toils_Goto.GotoCell(TargetIndex.C, PathEndMode.OnCell);
|
||||
|
||||
|
@ -46,20 +42,19 @@ namespace RJW_ToysAndMasturbation {
|
|||
masturbationToil.defaultCompleteMode = ToilCompleteMode.Never;
|
||||
masturbationToil.initAction = delegate { Start(); };
|
||||
masturbationToil.tickAction = delegate {
|
||||
duration--;
|
||||
if (Gen.IsHashIntervalTick(pawn, ticks_between_hearts)) {
|
||||
ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);
|
||||
ThrowMetaIconF(pawn.Position, this.pawn.Map, FleckDefOf.Heart);
|
||||
}
|
||||
SexTick(pawn, null);
|
||||
SexUtility.reduce_rest(pawn);
|
||||
if (duration <= 0) ReadyForNextToil();
|
||||
if (ticks_left <= 0) ReadyForNextToil();
|
||||
};
|
||||
masturbationToil.AddFinishAction(delegate { End(); });
|
||||
yield return masturbationToil;
|
||||
|
||||
Toil AfterToil = new Toil();
|
||||
AfterToil.initAction = delegate {
|
||||
SexUtility.Aftersex(pawn);
|
||||
SexUtility.Aftersex(Sexprops);
|
||||
if(SexUtility.ConsiderCleaning(pawn)) {
|
||||
LocalTargetInfo filth = GridsUtility.GetFirstThing<Filth>(pawn.PositionHeld, pawn.Map);
|
||||
Job cleanup = JobMaker.MakeJob(JobDefOf.Clean);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue