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
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