Example #1
0
        protected override Job TryGiveJob(Pawn pawn)
        {
            Pawn pawnToFollow = JobGiver_PackAnimalFollowColonists.GetPawnToFollow(pawn);

            if (pawnToFollow == null)
            {
                return(null);
            }
            if (pawnToFollow.Position.InHorDistOf(pawn.Position, 10f) && pawnToFollow.Position.WithinRegions(pawn.Position, pawn.Map, 5, TraverseParms.For(pawn, Danger.Deadly, TraverseMode.ByPawn, false), RegionType.Set_Passable))
            {
                return(null);
            }
            return(new Job(JobDefOf.Follow, pawnToFollow)
            {
                locomotionUrgency = LocomotionUrgency.Walk,
                checkOverrideOnExpire = true,
                expiryInterval = 120
            });
        }
 protected override bool Satisfied(Pawn pawn)
 {
     return(JobGiver_PackAnimalFollowColonists.GetPawnToFollow(pawn) != null);
 }