Example #1
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOnDespawnedOrNull(TargetIndex.A);
            Toil beat     = new Toil();
            Toil approach = new Toil();

            approach.initAction = delegate
            {
                if (_003CMakeNewToils_003Ec__Iterator._0024this.Map.reservationManager.CanReserve(_003CMakeNewToils_003Ec__Iterator._0024this.pawn, _003CMakeNewToils_003Ec__Iterator._0024this.TargetFire))
                {
                    _003CMakeNewToils_003Ec__Iterator._0024this.pawn.Reserve(_003CMakeNewToils_003Ec__Iterator._0024this.TargetFire, _003CMakeNewToils_003Ec__Iterator._0024this.job);
                }
                _003CMakeNewToils_003Ec__Iterator._0024this.pawn.pather.StartPath(_003CMakeNewToils_003Ec__Iterator._0024this.TargetFire, PathEndMode.Touch);
            };
            approach.tickAction = delegate
            {
                if (_003CMakeNewToils_003Ec__Iterator._0024this.pawn.pather.Moving && _003CMakeNewToils_003Ec__Iterator._0024this.pawn.pather.nextCell != _003CMakeNewToils_003Ec__Iterator._0024this.TargetFire.Position)
                {
                    _003CMakeNewToils_003Ec__Iterator._0024this.StartBeatingFireIfAnyAt(_003CMakeNewToils_003Ec__Iterator._0024this.pawn.pather.nextCell, beat);
                }
                if (_003CMakeNewToils_003Ec__Iterator._0024this.pawn.Position != _003CMakeNewToils_003Ec__Iterator._0024this.TargetFire.Position)
                {
                    _003CMakeNewToils_003Ec__Iterator._0024this.StartBeatingFireIfAnyAt(_003CMakeNewToils_003Ec__Iterator._0024this.pawn.Position, beat);
                }
            };
            approach.FailOnDespawnedOrNull(TargetIndex.A);
            approach.defaultCompleteMode = ToilCompleteMode.PatherArrival;
            approach.atomicWithPrevious  = true;
            yield return(approach);

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #2
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            yield return(Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.Touch).FailOn(() => PlantUtility.AdjacentSowBlocker(_003CMakeNewToils_003Ec__Iterator._0024this.job.plantDefToSow, _003CMakeNewToils_003Ec__Iterator._0024this.TargetA.Cell, _003CMakeNewToils_003Ec__Iterator._0024this.Map) != null).FailOn(() => !_003CMakeNewToils_003Ec__Iterator._0024this.job.plantDefToSow.CanEverPlantAt(_003CMakeNewToils_003Ec__Iterator._0024this.TargetLocA, _003CMakeNewToils_003Ec__Iterator._0024this.Map)));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #3
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            yield return(Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.Touch));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #4
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0046: stateMachine*/;
            Toil initExtractTargetFromQueue = Toils_JobTransforms.ClearDespawnedNullOrForbiddenQueuedTargets(TargetIndex.A);

            yield return(initExtractTargetFromQueue);

            /*Error: Unable to find new state assignment for yield return*/;
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOnDespawnedOrNull(TargetIndex.B);
            yield return(Toils_Goto.Goto(TargetIndex.B, this.PathEndMode));

            /*Error: Unable to find new state assignment for yield return*/;
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_004e: stateMachine*/;

            this.Init();
            yield return(Toils_JobTransforms.MoveCurrentTargetIntoQueue(TargetIndex.A));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #7
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOnAggroMentalState(TargetIndex.A);
            yield return(Toils_Interpersonal.GotoPrisoner(base.pawn, this.Victim, PrisonerInteractionModeDefOf.Execution).FailOn(() => !_003CMakeNewToils_003Ec__Iterator._0024this.Victim.IsPrisonerOfColony || !_003CMakeNewToils_003Ec__Iterator._0024this.Victim.guest.PrisonerIsSecure));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #8
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #9
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0052: stateMachine*/;

            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            this.FailOn(delegate
            {
                if (!WorkGiver_Tend.GoodLayingStatusForTend(_003CMakeNewToils_003Ec__Iterator._0024this.Deliveree, _003CMakeNewToils_003Ec__Iterator._0024this.pawn))
                {
                    return(true);
                }
                if (_003CMakeNewToils_003Ec__Iterator._0024this.MedicineUsed != null && _003CMakeNewToils_003Ec__Iterator._0024this.pawn.Faction == Faction.OfPlayer)
                {
                    if (_003CMakeNewToils_003Ec__Iterator._0024this.Deliveree.playerSettings == null)
                    {
                        return(true);
                    }
                    if (!_003CMakeNewToils_003Ec__Iterator._0024this.Deliveree.playerSettings.medCare.AllowsMedicine(_003CMakeNewToils_003Ec__Iterator._0024this.MedicineUsed.def))
                    {
                        return(true);
                    }
                }
                if (_003CMakeNewToils_003Ec__Iterator._0024this.pawn == _003CMakeNewToils_003Ec__Iterator._0024this.Deliveree && _003CMakeNewToils_003Ec__Iterator._0024this.pawn.Faction == Faction.OfPlayer && !_003CMakeNewToils_003Ec__Iterator._0024this.pawn.playerSettings.selfTend)
                {
                    return(true);
                }
                return(false);
            });
            AddEndCondition(delegate
            {
                if (_003CMakeNewToils_003Ec__Iterator._0024this.pawn.Faction == Faction.OfPlayer && HealthAIUtility.ShouldBeTendedNowByPlayer(_003CMakeNewToils_003Ec__Iterator._0024this.Deliveree))
                {
                    return(JobCondition.Ongoing);
                }
                if (_003CMakeNewToils_003Ec__Iterator._0024this.pawn.Faction != Faction.OfPlayer && _003CMakeNewToils_003Ec__Iterator._0024this.Deliveree.health.HasHediffsNeedingTend())
                {
                    return(JobCondition.Ongoing);
                }
                return(JobCondition.Succeeded);
            });
            this.FailOnAggroMentalState(TargetIndex.A);
            Toil reserveMedicine = null;

            if (!usesMedicine)
            {
                PathEndMode interactionCell = (Deliveree == pawn) ? PathEndMode.OnCell : PathEndMode.InteractionCell;
                Toil        gotoToil        = Toils_Goto.GotoThing(TargetIndex.A, interactionCell);
                yield return(gotoToil);

                /*Error: Unable to find new state assignment for yield return*/;
            }
            reserveMedicine = Toils_Tend.ReserveMedicine(TargetIndex.B, Deliveree).FailOnDespawnedNullOrForbidden(TargetIndex.B);
            yield return(reserveMedicine);

            /*Error: Unable to find new state assignment for yield return*/;
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOnDespawnedOrNull(TargetIndex.A);
            yield return(Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.InteractionCell).FailOn(delegate(Toil to)
            {
                Building_CommsConsole building_CommsConsole = (Building_CommsConsole)to.actor.jobs.curJob.GetTarget(TargetIndex.A).Thing;
                return !building_CommsConsole.CanUseCommsNow;
            }));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #11
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0042: stateMachine*/;

            this.FailOnDestroyedOrNull(TargetIndex.A);
            this.FailOnBurningImmobile(TargetIndex.B);
            this.FailOn(() => ((Pawn)(Thing)_003CMakeNewToils_003Ec__Iterator._0024this.GetActor().CurJob.GetTarget(TargetIndex.A)).guest.interactionMode != PrisonerInteractionModeDefOf.Release);
            this.FailOnDowned(TargetIndex.A);
            this.FailOnAggroMentalState(TargetIndex.A);
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch).FailOn(() => !_003CMakeNewToils_003Ec__Iterator._0024this.Prisoner.IsPrisonerOfColony || !_003CMakeNewToils_003Ec__Iterator._0024this.Prisoner.guest.PrisonerIsSecure).FailOnSomeonePhysicallyInteracting(TargetIndex.A));

            /*Error: Unable to find new state assignment for yield return*/;
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_004a: stateMachine*/;

            base.AddFinishAction(delegate
            {
                _003CMakeNewToils_003Ec__Iterator._0024this.Map.attackTargetsCache.UpdateTarget(_003CMakeNewToils_003Ec__Iterator._0024this.pawn);
            });
            Toil prepareToEatCorpse = new Toil();

            prepareToEatCorpse.initAction = delegate
            {
                Pawn   actor  = prepareToEatCorpse.actor;
                Corpse corpse = _003CMakeNewToils_003Ec__Iterator._0024this.Corpse;
                if (corpse == null)
                {
                    Pawn prey = _003CMakeNewToils_003Ec__Iterator._0024this.Prey;
                    if (prey == null)
                    {
                        actor.jobs.EndCurrentJob(JobCondition.Incompletable, true);
                    }
                    else
                    {
                        corpse = prey.Corpse;
                        if (corpse != null && corpse.Spawned)
                        {
                            goto IL_006e;
                        }
                        actor.jobs.EndCurrentJob(JobCondition.Incompletable, true);
                    }
                    return;
                }
                goto IL_006e;
IL_006e:
                if (actor.Faction == Faction.OfPlayer)
                {
                    corpse.SetForbidden(false, false);
                }
                else
                {
                    corpse.SetForbidden(true, false);
                }
                actor.CurJob.SetTarget(TargetIndex.A, corpse);
            };
            yield return(Toils_General.DoAtomic(delegate
            {
                _003CMakeNewToils_003Ec__Iterator._0024this.Map.attackTargetsCache.UpdateTarget(_003CMakeNewToils_003Ec__Iterator._0024this.pawn);
            }));

            /*Error: Unable to find new state assignment for yield return*/;
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            this.FailOnBurningImmobile(TargetIndex.A);
            this.FailOn(delegate
            {
                CompDeepDrill compDeepDrill = _003CMakeNewToils_003Ec__Iterator._0024this.job.targetA.Thing.TryGetComp <CompDeepDrill>();
                return(!compDeepDrill.CanDrillNow());
            });
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.InteractionCell));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #14
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0046: stateMachine*/;

            this.FailOnDestroyedOrNull(TargetIndex.A);
            this.FailOnBurningImmobile(TargetIndex.B);
            if (!forbiddenInitially)
            {
                this.FailOnForbidden(TargetIndex.A);
            }
            Toil reserveTargetA = Toils_Reserve.Reserve(TargetIndex.A);

            yield return(reserveTargetA);

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #15
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_003e: stateMachine*/;

            this.EndOnDespawnedOrNull(TargetIndex.A);
            if (!base.TargetC.HasThing || !(base.TargetC.Thing is Building_Bed))
            {
                yield return(Toils_Goto.GotoCell(TargetIndex.B, PathEndMode.OnCell));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            this.KeepLyingDown(TargetIndex.C);
            yield return(Toils_Bed.ClaimBedIfNonMedical(TargetIndex.C));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #16
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOn(delegate
            {
                if (!_003CMakeNewToils_003Ec__Iterator._0024this.job.ignoreDesignations && _003CMakeNewToils_003Ec__Iterator._0024this.Map.designationManager.DesignationAt(_003CMakeNewToils_003Ec__Iterator._0024this.TargetLocA, _003CMakeNewToils_003Ec__Iterator._0024this.DesDef) == null)
                {
                    return(true);
                }
                return(false);
            });
            yield return(Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.Touch));

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #17
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_003a: stateMachine*/;

            this.FailOnDespawnedOrNull(TargetIndex.A);
            this.FailOn(delegate
            {
                Designation designation = _003CMakeNewToils_003Ec__Iterator._0024this.Map.designationManager.DesignationOn(_003CMakeNewToils_003Ec__Iterator._0024this.TargetThingA, DesignationDefOf.Flick);
                if (designation != null)
                {
                    return(false);
                }
                return(true);
            });
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            /*Error: Unable to find new state assignment for yield return*/;
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            this.FailOn(() => !JoyUtility.EnjoyableOutsideNow(_003CMakeNewToils_003Ec__Iterator._0024this.pawn, null));
            Toil goToil = Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.OnCell);

            goToil.tickAction = delegate
            {
                if (Find.TickManager.TicksGame > _003CMakeNewToils_003Ec__Iterator._0024this.startTick + _003CMakeNewToils_003Ec__Iterator._0024this.job.def.joyDuration)
                {
                    _003CMakeNewToils_003Ec__Iterator._0024this.EndJobWith(JobCondition.Succeeded);
                }
                else
                {
                    JoyUtility.JoyTickCheckEnd(_003CMakeNewToils_003Ec__Iterator._0024this.pawn, JoyTickFullJoyAction.EndJob, 1f);
                }
            };
            yield return(goToil);

            /*Error: Unable to find new state assignment for yield return*/;
        }
Example #19
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            _003CMakeNewToils_003Ec__Iterator0 _003CMakeNewToils_003Ec__Iterator = (_003CMakeNewToils_003Ec__Iterator0) /*Error near IL_004e: stateMachine*/;

            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            Toil gotoTurret   = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.InteractionCell);
            Toil loadIfNeeded = new Toil();

            loadIfNeeded.initAction = delegate
            {
                Pawn               actor              = loadIfNeeded.actor;
                Building           building           = (Building)actor.CurJob.targetA.Thing;
                Building_TurretGun building_TurretGun = building as Building_TurretGun;
                if (!JobDriver_ManTurret.GunNeedsLoading(building))
                {
                    _003CMakeNewToils_003Ec__Iterator._0024this.JumpToToil(gotoTurret);
                }
                else
                {
                    Thing thing = JobDriver_ManTurret.FindAmmoForTurret(_003CMakeNewToils_003Ec__Iterator._0024this.pawn, building_TurretGun);
                    if (thing == null)
                    {
                        if (actor.Faction == Faction.OfPlayer)
                        {
                            Messages.Message("MessageOutOfNearbyShellsFor".Translate(actor.LabelShort, building_TurretGun.Label).CapitalizeFirst(), building_TurretGun, MessageTypeDefOf.NegativeEvent);
                        }
                        actor.jobs.EndCurrentJob(JobCondition.Incompletable, true);
                    }
                    actor.CurJob.targetB = thing;
                    actor.CurJob.count   = 1;
                }
            };
            yield return(loadIfNeeded);

            /*Error: Unable to find new state assignment for yield return*/;
        }