Пример #1
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            yield return(Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.InteractionCell).FailOn((Toil to) => !((Building_Terminal)to.actor.jobs.curJob.GetTarget(TargetIndex.A).Thing).CanUseTerminalNow));

            yield return(new Toil
            {
                initAction = delegate
                {
                    Pawn actor = base.CurToil.actor;
                    if (((Building_Terminal)actor.jobs.curJob.GetTarget(TargetIndex.A).Thing).CanUseTerminalNow)
                    {
                        FloatMenuManager.currentAction(actor);
                    }
                }
            });
        }
Пример #2
0
 public override IEnumerable <FloatMenuOption> GetFloatMenuOptions(Pawn selPawn)
 {
     if (!selPawn.CanReach(this, PathEndMode.InteractionCell, Danger.Some))
     {
         FloatMenuOption item = new FloatMenuOption("CannotUseNoPath".Translate(), null);
         return(new List <FloatMenuOption>
         {
             item
         });
     }
     if (base.Spawned && base.Map.gameConditionManager.ConditionIsActive(GameConditionDefOf.SolarFlare))
     {
         FloatMenuOption item2 = new FloatMenuOption("CannotUseSolarFlare".Translate(), null);
         return(new List <FloatMenuOption>
         {
             item2
         });
     }
     if (!powerComp.PowerOn)
     {
         FloatMenuOption item3 = new FloatMenuOption("CannotUseNoPower".Translate(), null);
         return(new List <FloatMenuOption>
         {
             item3
         });
     }
     if (!selPawn.health.capacities.CapableOf(PawnCapacityDefOf.Sight))
     {
         FloatMenuOption item4 = new FloatMenuOption("CannotUseReason".Translate("IncapableOfCapacity".Translate(PawnCapacityDefOf.Sight.label)), null);
         return(new List <FloatMenuOption>
         {
             item4
         });
     }
     return(FloatMenuManager.RequestBuild(this, selPawn));
 }