mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using Verse.AI;
|
|
|
|
namespace RJW_Menstruation
|
|
{
|
|
public class JobDriver_VaginaWashing : JobDriver
|
|
{
|
|
const int excretingTime = 300;//ticks - 120 = 2 real seconds, 3 in-game minutes
|
|
|
|
public override bool TryMakePreToilReservations(bool errorOnFailed)
|
|
{
|
|
return pawn.Reserve(pawn, job, 1, -1, null, errorOnFailed);
|
|
}
|
|
|
|
protected override IEnumerable<Toil> MakeNewToils()
|
|
{
|
|
|
|
HediffComp_Menstruation Comp = Utility.GetMenstruationComp(pawn);
|
|
this.FailOn(delegate
|
|
{
|
|
return !(Comp.TotalCumPercent > 0.01);
|
|
});
|
|
Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of
|
|
|
|
excreting.WithProgressBarToilDelay(TargetIndex.A);
|
|
yield return excreting;
|
|
yield return new Toil()
|
|
{
|
|
initAction = delegate ()
|
|
{
|
|
Comp.CumOutForce(null, 0.5f);
|
|
if (Comp.TotalCumPercent > 0.01) this.JumpToToil(excreting);
|
|
}
|
|
};
|
|
//yield return excreting;
|
|
|
|
}
|
|
}
|
|
}
|