public override bool HasJobOnCell(Pawn pawn, IntVec3 c, bool forced = false)
        {
            Plant plant = c.GetPlant(pawn.Map);

            if (plant == null)
            {
                return(false);
            }
            if (plant.IsForbidden(pawn))
            {
                return(false);
            }
            if (!plant.HarvestableNow || plant.LifeStage != PlantLifeStage.Mature)
            {
                return(false);
            }
            if (!plant.CanYieldNow())
            {
                return(false);
            }
            if (!pawn.CanReserve(plant, 1, -1, null, forced))
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public override bool HasJobOnCell(Pawn pawn, IntVec3 c, bool forced = false)
        {
            Plant plant = c.GetPlant(pawn.Map);
            bool  result;

            if (plant == null)
            {
                result = false;
            }
            else if (plant.IsForbidden(pawn))
            {
                result = false;
            }
            else if (!plant.HarvestableNow || plant.LifeStage != PlantLifeStage.Mature)
            {
                result = false;
            }
            else if (!plant.CanYieldNow())
            {
                result = false;
            }
            else
            {
                LocalTargetInfo target = plant;
                result = pawn.CanReserve(target, 1, -1, null, forced);
            }
            return(result);
        }
Esempio n. 3
0
        public override bool HasJobOnCell(Pawn pawn, IntVec3 c, bool forced = false)
        {
            Plant plant = c.GetPlant(pawn.Map);

            if (plant == null)
            {
                return(false);
            }
            if (plant.IsForbidden(pawn))
            {
                return(false);
            }
            if (!plant.HarvestableNow || plant.LifeStage != PlantLifeStage.Mature)
            {
                return(false);
            }
            if (!plant.CanYieldNow())
            {
                return(false);
            }
            LocalTargetInfo target = plant;
            bool            ignoreOtherReservations = forced;

            if (!pawn.CanReserve(target, 1, -1, null, ignoreOtherReservations))
            {
                return(false);
            }
            return(true);
        }