2021-07-30 01:33:08 +00:00
|
|
|
|
using Milk;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
using RimWorld.Planet;
|
|
|
|
|
using rjw;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Verse;
|
|
|
|
|
using Verse.AI;
|
|
|
|
|
|
|
|
|
|
namespace CRIALactation
|
|
|
|
|
{
|
|
|
|
|
public class WorkGiver_MassageBreasts : WorkGiver_Scanner
|
|
|
|
|
{
|
|
|
|
|
public override IEnumerable<Thing> PotentialWorkThingsGlobal(Pawn pawn)
|
|
|
|
|
{
|
2021-11-15 22:58:49 +00:00
|
|
|
|
return pawn.Map.mapPawns.AllPawnsSpawned;
|
2021-07-30 01:33:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool ShouldSkip(Pawn pawn, bool forced = false)
|
|
|
|
|
{
|
2021-11-15 22:58:49 +00:00
|
|
|
|
List<Pawn> list = pawn.Map.mapPawns.AllPawnsSpawned;
|
2021-07-30 01:33:08 +00:00
|
|
|
|
for(int i = 0; i < list.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if(LactationUtility.isMassageable(list[i]))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool HasJobOnThing(Pawn p, Thing t, bool forced = false)
|
|
|
|
|
{
|
|
|
|
|
Pawn pawn2 = t as Pawn;
|
|
|
|
|
if(pawn2?.TryGetComp<CompInduceLactation>() == null)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
CompInduceLactation c = pawn2.TryGetComp<CompInduceLactation>();
|
|
|
|
|
|
|
|
|
|
return p != pawn2 && c.isActive && c.CanMassage && !pawn2.Downed && !pawn2.Drafted && !pawn2.InAggroMentalState && !pawn2.IsFormingCaravan() && pawn2.CanCasuallyInteractNow(false, true, false) && p.CanReserve(pawn2, 1, -1, null, forced);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
|
|
|
|
|
{
|
|
|
|
|
return JobMaker.MakeJob(JobDefOf_CRIALactation.MassageBreasts, t);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|