コード例 #1
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Pawn pawn2 = (Pawn)t;
            Job  job   = new Job(JobDefOf.VisitSickPawn, pawn2, SickPawnVisitUtility.FindChair(pawn, pawn2));

            job.ignoreJoyTimeAssignment = true;
            return(job);
        }
コード例 #2
0
        // Token: 0x060000C7 RID: 199 RVA: 0x000062D4 File Offset: 0x000044D4
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Pawn pawn2 = (Pawn)t;

            return(new Job(WPJobDefOf.WPVisitSickPawn, pawn2, SickPawnVisitUtility.FindChair(pawn, pawn2))
            {
                ignoreJoyTimeAssignment = true
            });
        }
コード例 #3
0
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Pawn pawn2 = t as Pawn;

            if (pawn2 == null)
            {
                return(false);
            }
            return(SickPawnVisitUtility.CanVisit(pawn, pawn2, JoyCategory.VeryLow));
        }
コード例 #4
0
        public static Pawn FindRandomSickPawn(Pawn pawn, JoyCategory maxPatientJoy)
        {
            IEnumerable <Pawn> source = from x in pawn.Map.mapPawns.FreeColonistsSpawned
                                        where SickPawnVisitUtility.CanVisit(pawn, x, maxPatientJoy)
                                        select x;
            Pawn result = default(Pawn);

            if (!source.TryRandomElementByWeight <Pawn>((Func <Pawn, float>)((Pawn x) => SickPawnVisitUtility.VisitChanceScore(pawn, x)), out result))
            {
                return(null);
            }
            return(result);
        }
コード例 #5
0
		public override Job TryGiveJob(Pawn pawn)
		{
			if (!InteractionUtility.CanInitiateInteraction(pawn))
			{
				return null;
			}
			Pawn pawn2 = SickPawnVisitUtility.FindRandomSickPawn(pawn, JoyCategory.Low);
			if (pawn2 == null)
			{
				return null;
			}
			return new Job(base.def.jobDef, pawn2, SickPawnVisitUtility.FindChair(pawn, pawn2));
		}
コード例 #6
0
        public static Pawn FindRandomSickPawn(Pawn pawn, JoyCategory maxPatientJoy)
        {
            IEnumerable <Pawn> source = from x in pawn.Map.mapPawns.FreeColonistsSpawned
                                        where SickPawnVisitUtility.CanVisit(pawn, x, maxPatientJoy)
                                        select x;
            Pawn pawn2;
            Pawn result;

            if (!source.TryRandomElementByWeight((Pawn x) => SickPawnVisitUtility.VisitChanceScore(pawn, x), out pawn2))
            {
                result = null;
            }
            else
            {
                result = pawn2;
            }
            return(result);
        }
コード例 #7
0
        public override Job TryGiveJob(Pawn pawn)
        {
            Job result;

            if (!InteractionUtility.CanInitiateInteraction(pawn))
            {
                result = null;
            }
            else
            {
                Pawn pawn2 = SickPawnVisitUtility.FindRandomSickPawn(pawn, JoyCategory.Low);
                if (pawn2 == null)
                {
                    result = null;
                }
                else
                {
                    result = new Job(this.def.jobDef, pawn2, SickPawnVisitUtility.FindChair(pawn, pawn2));
                }
            }
            return(result);
        }
コード例 #8
0
        // Token: 0x0600006E RID: 110 RVA: 0x0000463C File Offset: 0x0000283C
        public override Job TryGiveJob(Pawn pawn)
        {
            bool flag = !InteractionUtility.CanInitiateInteraction(pawn, null);
            Job  result;

            if (flag)
            {
                result = null;
            }
            else
            {
                Pawn pawn2 = SickPawnVisitUtility.FindRandomSickPawn(pawn, JoyCategory.Low);
                bool flag2 = pawn2 == null;
                if (flag2)
                {
                    result = null;
                }
                else
                {
                    result = new Job(WPJobDefOf.WPVisitSickPawn, pawn2, SickPawnVisitUtility.FindChair(pawn, pawn2));
                }
            }
            return(result);
        }
コード例 #9
0
 public static bool CanVisit(Pawn pawn, Pawn sick, JoyCategory maxPatientJoy)
 {
     return(sick.IsColonist && !sick.Dead && pawn != sick && sick.InBed() && sick.Awake() && !sick.IsForbidden(pawn) && sick.needs.joy != null && (int)sick.needs.joy.CurCategory <= (int)maxPatientJoy && InteractionUtility.CanReceiveInteraction(sick) && !sick.needs.food.Starving && sick.needs.rest.CurLevel > 0.33000001311302185 && pawn.CanReserveAndReach(sick, PathEndMode.InteractionCell, Danger.None, 1, -1, null, false) && !SickPawnVisitUtility.AboutToRecover(sick));
 }
コード例 #10
0
 internal float <> m__1(Pawn x)
 {
     return(SickPawnVisitUtility.VisitChanceScore(this.pawn, x));
 }
コード例 #11
0
 internal bool <> m__0(Pawn x)
 {
     return(SickPawnVisitUtility.CanVisit(this.pawn, x, this.maxPatientJoy));
 }