using Verse;
using Verse.AI;
using Verse.AI.Group;
using RimWorld;

namespace SCE
{
    public class JobGiver_Consummate : ThinkNode_JobGiver
    {
        protected override Job TryGiveJob(Pawn pawn)
        {            
            LocalTargetInfo target = pawn.mindState.duty?.focusSecond ?? LocalTargetInfo.Invalid;
            if (!target.IsValid || !target.HasThing)
            {
                return null;
            }

            var result = JobMaker.MakeJob(SCEJobDefOf.MarryLewd, target);
            result.locomotionUrgency = LocomotionUrgency.Walk;
            return result;
        }
    }
}