public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Building_GrowerBase grower = t as Building_GrowerBase;

            if (grower == null)
            {
                return(false);
            }

            IMaintainableGrower maintanable = grower as IMaintainableGrower;

            if (maintanable == null)
            {
                return(false);
            }

            if (t.IsForbidden(pawn))
            {
                return(false);
            }

            if (!pawn.CanReserve(t))
            {
                return(false);
            }

            if (grower.status != CrafterStatus.Crafting)
            {
                return(false);
            }

            bool maintainScience = true;

            if (maintanable.ScientistMaintence > 0.49f)
            {
                if (maintanable.ScientistMaintence > 0.90f)
                {
                    maintainScience = false;
                }
                maintainScience = forced;
            }

            bool maintainDoctor = true;

            if (maintanable.DoctorMaintence > 0.49f)
            {
                if (maintanable.DoctorMaintence > 0.90f)
                {
                    maintainDoctor = false;
                }
                maintainDoctor = forced;
            }

            bool maintainAtAll = maintainScience || maintainDoctor;

            return(maintainAtAll);
        }
示例#2
0
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Building_GrowerBase_WorkTable grower = t as Building_GrowerBase_WorkTable;

            if (grower == null)
            {
                return(false);
            }

            IMaintainableGrower maintainable = grower as IMaintainableGrower;

            if (maintainable == null)
            {
                return(false);
            }

            if (t.IsForbidden(pawn))
            {
                return(false);
            }

            if (!pawn.CanReserve(t))
            {
                return(false);
            }

            if (grower.status != CrafterStatus.Crafting)
            {
                return(false);
            }

            bool shouldMaintainScience = true;

            if (maintainable.ScientistMaintenance > QEESettings.instance.maintWorkThresholdFloat)
            {
                if (maintainable.ScientistMaintenance > 0.90f)
                {
                    shouldMaintainScience = false;
                }
                shouldMaintainScience = forced;
            }

            bool shouldMaintainDoctor = true;

            if (maintainable.DoctorMaintenance > QEESettings.instance.maintWorkThresholdFloat)
            {
                if (maintainable.DoctorMaintenance > 0.90f)
                {
                    shouldMaintainDoctor = false;
                }
                shouldMaintainDoctor = forced;
            }

            bool maintainAtAll = shouldMaintainScience || shouldMaintainDoctor;

            return(maintainAtAll);
        }
示例#3
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Job job = null;

            IMaintainableGrower maintainable = t as IMaintainableGrower;

            if (maintainable.ScientistMaintenance < QEESettings.instance.maintWorkThresholdFloat)
            {
                job = new Job(QEJobDefOf.QE_GrowerMaintenanceJob_Intellectual, t);
            }

            if (maintainable.DoctorMaintenance < QEESettings.instance.maintWorkThresholdFloat)
            {
                job = new Job(QEJobDefOf.QE_GrowerMaintenanceJob_Medicine, t);
            }

            return(job);
        }
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            //Building_GrowerBase grower = t as Building_GrowerBase;
            Job job = null;

            IMaintainableGrower maintanable = t as IMaintainableGrower;

            if (maintanable.ScientistMaintence < 0.49f)
            {
                job = new Job(QEJobDefOf.QE_MaintainGrowerJob_Intellectual, t);
            }

            if (maintanable.DoctorMaintence < 0.49f)
            {
                job = new Job(QEJobDefOf.QE_MaintainGrowerJob_Medicine, t);
            }

            return(job);
        }