예제 #1
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Job result;

            if (t.Faction != pawn.Faction)
            {
                result = null;
            }
            else
            {
                Frame frame = t as Frame;
                if (frame == null)
                {
                    result = null;
                }
                else if (GenConstruct.FirstBlockingThing(frame, pawn) != null)
                {
                    result = GenConstruct.HandleBlockingThingJob(frame, pawn, forced);
                }
                else
                {
                    bool checkConstructionSkill = this.def.workType == WorkTypeDefOf.Construction;
                    if (!GenConstruct.CanConstruct(frame, pawn, checkConstructionSkill, forced))
                    {
                        result = null;
                    }
                    else
                    {
                        result = base.ResourceDeliverJobFor(pawn, frame, true);
                    }
                }
            }
            return(result);
        }
예제 #2
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (t.Faction != pawn.Faction)
            {
                return(null);
            }
            Frame frame = t as Frame;

            if (frame == null)
            {
                return(null);
            }
            if (frame.MaterialsNeeded().Count > 0)
            {
                return(null);
            }
            if (GenConstruct.FirstBlockingThing(frame, pawn) != null)
            {
                return(GenConstruct.HandleBlockingThingJob(frame, pawn, forced));
            }
            if (!GenConstruct.CanConstruct(frame, pawn, forced))
            {
                return(null);
            }
            return(new Job(JobDefOf.FinishFrame, frame));
        }
예제 #3
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (t.Faction != pawn.Faction)
            {
                return(null);
            }
            Blueprint blueprint = t as Blueprint;

            if (blueprint == null)
            {
                return(null);
            }
            if (GenConstruct.FirstBlockingThing(blueprint, pawn) != null)
            {
                return(GenConstruct.HandleBlockingThingJob(blueprint, pawn, forced));
            }
            bool flag = def.workType == WorkTypeDefOf.Construction;

            if (!GenConstruct.CanConstruct(blueprint, pawn, flag, forced))
            {
                return(null);
            }
            if (!flag && WorkGiver_ConstructDeliverResources.ShouldRemoveExistingFloorFirst(pawn, blueprint))
            {
                return(null);
            }
            Job job = RemoveExistingFloorJob(pawn, blueprint);

            if (job != null)
            {
                return(job);
            }
            Job job2 = ResourceDeliverJobFor(pawn, blueprint);

            if (job2 != null)
            {
                return(job2);
            }
            if (def.workType != WorkTypeDefOf.Hauling)
            {
                Job job3 = NoCostFrameMakeJobFor(pawn, blueprint);
                if (job3 != null)
                {
                    return(job3);
                }
            }
            return(null);
        }
예제 #4
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (t.Faction != pawn.Faction)
            {
                return(null);
            }
            Blueprint blueprint = t as Blueprint;

            if (blueprint == null)
            {
                return(null);
            }
            if (GenConstruct.FirstBlockingThing(blueprint, pawn) != null)
            {
                return(GenConstruct.HandleBlockingThingJob(blueprint, pawn, forced));
            }
            if (!GenConstruct.CanConstruct(blueprint, pawn, forced))
            {
                return(null);
            }
            Job job = base.RemoveExistingFloorJob(pawn, blueprint);

            if (job != null)
            {
                return(job);
            }
            Job job2 = base.ResourceDeliverJobFor(pawn, blueprint, true);

            if (job2 != null)
            {
                return(job2);
            }
            Job job3 = this.NoCostFrameMakeJobFor(pawn, blueprint);

            if (job3 != null)
            {
                return(job3);
            }
            return(null);
        }
예제 #5
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (t.Faction != pawn.Faction)
            {
                return(null);
            }
            Frame frame = t as Frame;

            if (frame == null)
            {
                return(null);
            }
            if (GenConstruct.FirstBlockingThing(frame, pawn) != null)
            {
                return(GenConstruct.HandleBlockingThingJob(frame, pawn, forced));
            }
            if (!GenConstruct.CanConstruct(frame, pawn, forced))
            {
                return(null);
            }
            return(base.ResourceDeliverJobFor(pawn, frame, true));
        }
		public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
		{
			if (t.Faction != pawn.Faction)
			{
				return null;
			}
			Frame frame = t as Frame;
			if (frame == null)
			{
				return null;
			}
			if (GenConstruct.FirstBlockingThing(frame, pawn) != null)
			{
				return GenConstruct.HandleBlockingThingJob(frame, pawn, forced);
			}
			bool checkConstructionSkill = def.workType == WorkTypeDefOf.Construction;
			if (!GenConstruct.CanConstruct(frame, pawn, checkConstructionSkill, forced))
			{
				return null;
			}
			return ResourceDeliverJobFor(pawn, frame);
		}
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Job result;

            if (t.Faction != pawn.Faction)
            {
                result = null;
            }
            else
            {
                Frame frame = t as Frame;
                if (frame == null)
                {
                    result = null;
                }
                else if (frame.MaterialsNeeded().Count > 0)
                {
                    result = null;
                }
                else if (GenConstruct.FirstBlockingThing(frame, pawn) != null)
                {
                    result = GenConstruct.HandleBlockingThingJob(frame, pawn, forced);
                }
                else
                {
                    Frame t2 = frame;
                    if (!GenConstruct.CanConstruct(t2, pawn, true, forced))
                    {
                        result = null;
                    }
                    else
                    {
                        result = new Job(JobDefOf.FinishFrame, frame);
                    }
                }
            }
            return(result);
        }
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Job result;

            if (t.Faction != pawn.Faction)
            {
                result = null;
            }
            else
            {
                Blueprint blueprint = t as Blueprint;
                if (blueprint == null)
                {
                    result = null;
                }
                else if (GenConstruct.FirstBlockingThing(blueprint, pawn) != null)
                {
                    result = GenConstruct.HandleBlockingThingJob(blueprint, pawn, forced);
                }
                else
                {
                    bool flag = this.def.workType == WorkTypeDefOf.Construction;
                    if (!GenConstruct.CanConstruct(blueprint, pawn, flag, forced))
                    {
                        result = null;
                    }
                    else if (!flag && WorkGiver_ConstructDeliverResources.ShouldRemoveExistingFloorFirst(pawn, blueprint))
                    {
                        result = null;
                    }
                    else
                    {
                        Job job = base.RemoveExistingFloorJob(pawn, blueprint);
                        if (job != null)
                        {
                            result = job;
                        }
                        else
                        {
                            Job job2 = base.ResourceDeliverJobFor(pawn, blueprint, true);
                            if (job2 != null)
                            {
                                result = job2;
                            }
                            else
                            {
                                Job job3 = this.NoCostFrameMakeJobFor(pawn, blueprint);
                                if (job3 != null)
                                {
                                    result = job3;
                                }
                                else
                                {
                                    result = null;
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }