Exemple #1
0
        protected override Job TryGiveJob(Pawn pawn)
        {
            if (pawn.gender != Gender.Male || !pawn.ageTracker.CurLifeStage.reproductive)
            {
                return(null);
            }
            Predicate <Thing> validator = delegate(Thing t)
            {
                Pawn pawn3 = t as Pawn;
                if (pawn3.Downed)
                {
                    return(false);
                }
                if (!pawn3.CanCasuallyInteractNow() || pawn3.IsForbidden(pawn))
                {
                    return(false);
                }
                if (pawn3.Faction != pawn.Faction)
                {
                    return(false);
                }
                return(PawnUtility.FertileMateTarget(pawn, pawn3) ? true : false);
            };
            Pawn pawn2 = (Pawn)GenClosest.ClosestThingReachable(pawn.Position, pawn.Map, ThingRequest.ForDef(pawn.def), PathEndMode.Touch, TraverseParms.For(pawn), 30f, validator);

            if (pawn2 == null)
            {
                return(null);
            }
            return(JobMaker.MakeJob(JobDefOf.Mate, pawn2));
        }
 protected override Job TryGiveJob(Pawn pawn)
 {
     if (pawn.gender == Gender.Male && pawn.ageTracker.CurLifeStage.reproductive)
     {
         Predicate <Thing> validator = delegate(Thing t)
         {
             Pawn pawn3 = t as Pawn;
             if (pawn3.Downed)
             {
                 return(false);
             }
             if (pawn3.CanCasuallyInteractNow(false) && !pawn3.IsForbidden(pawn))
             {
                 if (pawn3.Faction != pawn.Faction)
                 {
                     return(false);
                 }
                 if (!PawnUtility.FertileMateTarget(pawn, pawn3))
                 {
                     return(false);
                 }
                 return(true);
             }
             return(false);
         };
         Pawn pawn2 = (Pawn)GenClosest.ClosestThingReachable(pawn.Position, pawn.Map, ThingRequest.ForDef(pawn.def), PathEndMode.Touch, TraverseParms.For(pawn, Danger.Deadly, TraverseMode.ByPawn, false), 30f, validator, null, 0, -1, false, RegionType.Set_Passable, false);
         if (pawn2 == null)
         {
             return(null);
         }
         return(new Job(JobDefOf.Mate, pawn2));
     }
     return(null);
 }
Exemple #3
0
            internal bool <> m__0(Thing t)
            {
                Pawn pawn = t as Pawn;

                return(!pawn.Downed && pawn.CanCasuallyInteractNow(false) && !pawn.IsForbidden(this.pawn) && pawn.Faction == this.pawn.Faction && PawnUtility.FertileMateTarget(this.pawn, pawn));
            }