Пример #1
0
        // Token: 0x06000002 RID: 2 RVA: 0x00002072 File Offset: 0x00000272
        protected override IEnumerable <Toil> MakeNewToils()
        {
            ToilFailConditions.FailOnDespawnedOrNull <JobDriver_RearmTrap>(this, TargetIndex.A);
            ToilFailConditions.FailOnThingMissingDesignation <JobDriver_RearmTrap>(this, TargetIndex.A, YautjaDefOf.RRY_RearmTrap);
            Toil toil = new Toil();

            toil.initAction = delegate()
            {
                this.pawn.pather.StartPath(base.TargetThingA, PathEndMode.Touch);
            };
            toil.defaultCompleteMode = ToilCompleteMode.PatherArrival;
            ToilFailConditions.FailOnDespawnedNullOrForbidden <Toil>(toil, TargetIndex.A);
            yield return(toil);

            yield return(ToilEffects.WithProgressBarToilDelay(Toils_General.Wait(1125, 0), TargetIndex.A, false, -0.5f));

            yield return(new Toil
            {
                initAction = delegate()
                {
                    Thing thing = this.job.targetA.Thing;
                    Designation designation = base.Map.designationManager.DesignationOn(thing, YautjaDefOf.RRY_RearmTrap);
                    if (designation != null)
                    {
                        designation.Delete();
                    }
                    (thing as Building_TrapRearmable).Rearm();
                    this.pawn.records.Increment(YautjaDefOf.RRY_TrapsRearmed);
                },
                defaultCompleteMode = ToilCompleteMode.Instant
            });

            yield break;
        }