Пример #1
0
        public override IEnumerable <FloatMenuOption> CompFloatMenuOptions(Pawn pawn)
        {
            _003CCompFloatMenuOptions_003Ec__Iterator0 _003CCompFloatMenuOptions_003Ec__Iterator = (_003CCompFloatMenuOptions_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            if (pawn.RaceProps.ToolUser && pawn.CanReserveAndReach(parent, PathEndMode.InteractionCell, Danger.Deadly))
            {
                if (Props.manWorkType == WorkTags.None || pawn.story == null || !pawn.story.WorkTagIsDisabled(Props.manWorkType))
                {
                    FloatMenuOption opt = new FloatMenuOption("OrderManThing".Translate(parent.LabelShort, parent), delegate
                    {
                        Job job = new Job(JobDefOf.ManTurret, _003CCompFloatMenuOptions_003Ec__Iterator._0024this.parent);
                        pawn.jobs.TryTakeOrderedJob(job);
                    });
                    yield return(opt);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
                if (Props.manWorkType == WorkTags.Violent)
                {
                    yield return(new FloatMenuOption("CannotManThing".Translate(parent.LabelShort, parent) + " (" + "IsIncapableOfViolenceLower".Translate(pawn.LabelShort, pawn) + ")", null));

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
        }
Пример #2
0
        public override IEnumerable <FloatMenuOption> CompFloatMenuOptions(Pawn myPawn)
        {
            _003CCompFloatMenuOptions_003Ec__Iterator0 _003CCompFloatMenuOptions_003Ec__Iterator = (_003CCompFloatMenuOptions_003Ec__Iterator0) /*Error near IL_0036: stateMachine*/;

            if (!myPawn.CanReserve(base.parent, 1, -1, null, false))
            {
                yield return(new FloatMenuOption(this.FloatMenuOptionLabel + " (" + "Reserved".Translate() + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            FloatMenuOption useopt = new FloatMenuOption(this.FloatMenuOptionLabel, delegate
            {
                if (myPawn.CanReserveAndReach(_003CCompFloatMenuOptions_003Ec__Iterator._0024this.parent, PathEndMode.Touch, Danger.Deadly, 1, -1, null, false))
                {
                    foreach (CompUseEffect comp in _003CCompFloatMenuOptions_003Ec__Iterator._0024this.parent.GetComps <CompUseEffect>())
                    {
                        if (comp.SelectedUseOption(myPawn))
                        {
                            return;
                        }
                    }
                    _003CCompFloatMenuOptions_003Ec__Iterator._0024this.TryStartUseJob(myPawn);
                }
            }, MenuOptionPriority.Default, null, null, 0f, null, null);

            yield return(useopt);

            /*Error: Unable to find new state assignment for yield return*/;
        }
Пример #3
0
        public override IEnumerable <FloatMenuOption> CompFloatMenuOptions(Pawn pawn)
        {
            _003CCompFloatMenuOptions_003Ec__Iterator0 _003CCompFloatMenuOptions_003Ec__Iterator = (_003CCompFloatMenuOptions_003Ec__Iterator0) /*Error near IL_0032: stateMachine*/;

            if (pawn.RaceProps.ToolUser && pawn.CanReserveAndReach(base.parent, PathEndMode.InteractionCell, Danger.Deadly, 1, -1, null, false) && (this.Props.manWorkType == WorkTags.None || pawn.story == null || !pawn.story.WorkTagIsDisabled(this.Props.manWorkType)))
            {
                FloatMenuOption opt = new FloatMenuOption("OrderManThing".Translate(base.parent.LabelShort), delegate
                {
                    Job job = new Job(JobDefOf.ManTurret, _003CCompFloatMenuOptions_003Ec__Iterator._0024this.parent);
                    pawn.jobs.TryTakeOrderedJob(job, JobTag.Misc);
                }, MenuOptionPriority.Default, null, null, 0f, null, null);
                yield return(opt);

                /*Error: Unable to find new state assignment for yield return*/;
            }
        }
Пример #4
0
        public override IEnumerable <FloatMenuOption> CompFloatMenuOptions(Pawn myPawn)
        {
            _003CCompFloatMenuOptions_003Ec__Iterator0 _003CCompFloatMenuOptions_003Ec__Iterator = (_003CCompFloatMenuOptions_003Ec__Iterator0) /*Error near IL_0042: stateMachine*/;

            if (CanBeUsedBy(myPawn, out string failReason))
            {
                if (myPawn.CanReach(parent, PathEndMode.Touch, Danger.Deadly))
                {
                    if (myPawn.CanReserve(parent))
                    {
                        if (myPawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation))
                        {
                            FloatMenuOption useopt = new FloatMenuOption(FloatMenuOptionLabel, delegate
                            {
                                if (myPawn.CanReserveAndReach(_003CCompFloatMenuOptions_003Ec__Iterator._0024this.parent, PathEndMode.Touch, Danger.Deadly))
                                {
                                    foreach (CompUseEffect comp in _003CCompFloatMenuOptions_003Ec__Iterator._0024this.parent.GetComps <CompUseEffect>())
                                    {
                                        if (comp.SelectedUseOption(myPawn))
                                        {
                                            return;
                                        }
                                    }
                                    _003CCompFloatMenuOptions_003Ec__Iterator._0024this.TryStartUseJob(myPawn);
                                }
                            });
                            yield return(useopt);

                            /*Error: Unable to find new state assignment for yield return*/;
                        }
                        yield return(new FloatMenuOption(FloatMenuOptionLabel + " (" + "Incapable".Translate() + ")", null));

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                    yield return(new FloatMenuOption(FloatMenuOptionLabel + " (" + "Reserved".Translate() + ")", null));

                    /*Error: Unable to find new state assignment for yield return*/;
                }
                yield return(new FloatMenuOption(FloatMenuOptionLabel + " (" + "NoPath".Translate() + ")", null));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            yield return(new FloatMenuOption(FloatMenuOptionLabel + ((failReason == null) ? string.Empty : (" (" + failReason + ")")), null));

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