Example #1
0
        // Token: 0x060000A0 RID: 160 RVA: 0x00005934 File Offset: 0x00003B34
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Pawn pawn2 = t as Pawn;
            bool flag  = pawn2 == null || !pawn2.RaceProps.Animal;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                CompHasGatherableBodyResource comp = this.GetComp(pawn2);
                bool flag2 = comp != null && comp.ActiveAndFull && !pawn2.Downed && pawn2.CanCasuallyInteractNow(false);
                if (flag2)
                {
                    LocalTargetInfo target = pawn2;
                    bool            flag3  = pawn.CanReserve(target, 1, -1, null, forced);
                    if (flag3)
                    {
                        return(true);
                    }
                }
                result = false;
            }
            return(result);
        }
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Pawn pawn2 = t as Pawn;

            if (pawn2 == null || !pawn2.RaceProps.Animal)
            {
                return(false);
            }
            CompHasGatherableBodyResource comp = GetComp(pawn2);

            if (comp == null || !comp.ActiveAndFull || pawn2.Downed || !pawn2.CanCasuallyInteractNow() || !pawn.CanReserve(pawn2, 1, -1, null, forced))
            {
                return(false);
            }
            return(true);
        }
        public override bool ShouldSkip(Pawn pawn, bool forced = false)
        {
            List <Pawn> list = pawn.Map.mapPawns.SpawnedPawnsInFaction(pawn.Faction);

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].RaceProps.Animal)
                {
                    CompHasGatherableBodyResource comp = GetComp(list[i]);
                    if (comp != null && comp.ActiveAndFull)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Pawn pawn2 = t as Pawn;

            if (pawn2 == null || !pawn2.RaceProps.Animal)
            {
                return(false);
            }
            CompHasGatherableBodyResource comp = GetComp(pawn2);

            if (comp != null && comp.ActiveAndFull && !pawn2.Downed && pawn2.CanCasuallyInteractNow())
            {
                LocalTargetInfo target = pawn2;
                bool            ignoreOtherReservations = forced;
                if (pawn.CanReserve(target, 1, -1, null, ignoreOtherReservations))
                {
                    return(true);
                }
            }
            return(false);
        }
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Pawn pawn2 = t as Pawn;

            if (pawn2 != null && pawn2.RaceProps.Animal)
            {
                CompHasGatherableBodyResource comp = this.GetComp(pawn2);
                if (comp != null && comp.ActiveAndFull && !pawn2.Downed && pawn2.CanCasuallyInteractNow(false))
                {
                    LocalTargetInfo target = pawn2;
                    if (!pawn.CanReserve(target, 1, -1, null, forced))
                    {
                        goto IL_006c;
                    }
                    return(true);
                }
                goto IL_006c;
            }
            return(false);

IL_006c:
            return(false);
        }