rjw_menstruation/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs
moreoreganostodump a4e1be39f2 1.0.1.12
2021-03-06 22:32:33 +09:00

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