2022-05-03 05:09:29 +00:00
|
|
|
|
using RimWorld;
|
2022-09-08 14:42:19 +00:00
|
|
|
|
using RJWSexperience;
|
2022-05-03 05:09:29 +00:00
|
|
|
|
using Verse;
|
|
|
|
|
using Verse.AI;
|
|
|
|
|
|
2022-09-08 14:42:19 +00:00
|
|
|
|
namespace RJWSexperienceCum
|
2022-05-03 05:09:29 +00:00
|
|
|
|
{
|
|
|
|
|
public class WorkGiver_CleanSelfWithBucket : WorkGiver_Scanner
|
|
|
|
|
{
|
2022-09-08 14:42:19 +00:00
|
|
|
|
public override ThingRequest PotentialWorkThingRequest => ThingRequest.ForDef(ThingDefOf.CumBucket);
|
2022-05-03 05:09:29 +00:00
|
|
|
|
public override PathEndMode PathEndMode => PathEndMode.ClosestTouch;
|
|
|
|
|
public override bool ShouldSkip(Pawn pawn, bool forced = false)
|
|
|
|
|
{
|
2022-09-08 14:42:19 +00:00
|
|
|
|
return HediffDefOf.Hediff_CumController == null || !pawn.health.hediffSet.HasHediff(HediffDefOf.Hediff_CumController);
|
2022-05-03 05:09:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
|
|
|
|
|
{
|
|
|
|
|
if (!(t is Building_CumBucket bucket))
|
|
|
|
|
return false;
|
|
|
|
|
|
2022-09-08 14:42:19 +00:00
|
|
|
|
return bucket.StoredStackCount < ThingDefOf.GatheredCum.stackLimit;
|
2022-05-03 05:09:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
|
|
|
|
|
{
|
2022-09-08 14:42:19 +00:00
|
|
|
|
return JobMaker.MakeJob(JobDefOf.CleanSelfwithBucket, pawn, t);
|
2022-05-03 05:09:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|